bump to 1.0.0 and clean up spec file
[platform/upstream/libical.git] / src / libical / Makefile.am
1 #======================================================================
2 #  FILE: Makefile.am
3 #  CREATOR: eric 
4 #  
5 #  $Id: Makefile.am,v 1.40 2008-01-02 20:07:30 dothebart Exp $
6 #
7 #
8 # (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
9 #
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of either: 
12 #
13 #    The LGPL as published by the Free Software Foundation, version
14 #    2.1, available at: http://www.fsf.org/copyleft/lesser.html
15 #
16 #  Or:
17 #
18 #    The Mozilla Public License Version 1.0. You may obtain a copy of
19 #    the License at http://www.mozilla.org/MPL/
20 #
21 #  
22 #
23 #======================================================================
24
25
26 DESIGNDATA = $(top_srcdir)/design-data
27 ICALSCRIPTS = $(top_srcdir)/scripts
28
29 if WITH_CXX_BINDINGS
30 cxx_lib=libical_cxx.la
31 cxx_headers=vcomponent.h icalparameter_cxx.h icalproperty_cxx.h icalvalue_cxx.h icptrholder.h
32 else
33 cxx_lib=
34 cxx_headers=
35 endif
36
37 lib_LTLIBRARIES = libical.la $(cxx_lib)
38 noinst_LTLIBRARIES = libical-static.la
39 libical_static_la_SOURCES = $(libical_la_SOURCES)
40 libical_static_la_LDFLAGS = --all-static
41
42 AM_CPPFLAGS = -DPACKAGE_DATA_DIR=\""$(datadir)/$(PACKAGE)"\"
43
44 # CFLAGS = -g
45
46 INCLUDES =                              \
47         -I$(top_builddir)               \
48         -I$(top_srcdir)/src             \
49         -I$(top_builddir)/src           \
50         -I$(top_srcdir)/src/libical     \
51         -I$(top_builddir)/src/libical   \
52         -I$(srcdir)
53
54 libical_la_LDFLAGS = -version-info 48:0:48
55
56 if OS_WIN32
57 libical_la_LDFLAGS += -no-undefined
58 endif
59
60 libical_la_LIBADD = $(PTHREAD_LIBS)
61
62 libical_la_SOURCES =            \
63         $(BUILT_SOURCES)        \
64         icalarray.c             \
65         icalarray.h             \
66         icalattach.h            \
67         icalattachimpl.h        \
68         icalattach.c            \
69         icalcomponent.c         \
70         icalcomponent.h         \
71         icalenums.c             \
72         icalenums.h             \
73         icalerror.c             \
74         icalerror.h             \
75         icalmemory.c            \
76         icalmemory.h            \
77         icalmime.c              \
78         icalmime.h              \
79         icalparameter.c         \
80         icalparameter.h         \
81         icalparameterimpl.h     \
82         icalparser.c            \
83         icalparser.h            \
84         icalproperty.c          \
85         icalproperty.h          \
86         icalrecur.c             \
87         icalrecur.h             \
88         icalrestriction.h       \
89         icaltime.c              \
90         icaltime.h              \
91         icaltz-util.c           \
92         icaltz-util.h           \
93         icaltimezone.c          \
94         icaltimezone.h          \
95         icalduration.h          \
96         icalduration.c          \
97         icalperiod.h            \
98         icalperiod.c            \
99         icaltypes.c             \
100         icaltypes.h             \
101         icalvalue.c             \
102         icalvalue.h             \
103         icalvalueimpl.h         \
104         pvl.c                   \
105         pvl.h                   \
106         sspm.c                  \
107         sspm.h                  \
108         libicals_w32_vsnprintf_replacement.c \
109         icallangbind.h          \
110         icallangbind.c          \
111         caldate.c               \
112         astime.h 
113
114 if WITH_CXX_BINDINGS
115 libical_cxx_la_SOURCES =        \
116         $(libical_la_SOURCES)   \
117         vcomponent.h            \
118         vcomponent.cpp          \
119         icalproperty_cxx.h      \
120         icalproperty_cxx.cpp    \
121         icalparameter_cxx.h     \
122         icalparameter_cxx.cpp   \
123         icalvalue_cxx.h         \
124         icalvalue_cxx.cpp       \
125         icptrholder.h
126 endif
127
128 libical_includedir = $(includedir)/libical
129
130 libical_include_HEADERS = \
131         ical.h                  \
132         icalarray.h             \
133         icalattach.h            \
134         icalcomponent.h         \
135         icalderivedparameter.h  \
136         icalderivedproperty.h   \
137         icalderivedvalue.h      \
138         icalduration.h          \
139         icalenums.h             \
140         icalerror.h             \
141         icallangbind.h          \
142         icalmemory.h            \
143         icalmime.h              \
144         icalparameter.h         \
145         icalparser.h            \
146         icalperiod.h            \
147         icalproperty.h          \
148         icalrecur.h             \
149         icalrestriction.h       \
150         icaltime.h              \
151         icaltz-util.h           \
152         icaltimezone.h          \
153         icaltypes.h             \
154         icalvalue.h             \
155         pvl.h                   \
156         sspm.h                  \
157         $(cxx_headers)
158
159 # ORDERING OF HEADERS IS SIGNIFICANT. Don't change this ordering. It
160 # is required to make the combined header ical.h properly
161 COMBINEDHEADERS =                                       \
162         $(top_builddir)/src/libical/icalversion.h       \
163         $(top_srcdir)/src/libical/icaltime.h            \
164         $(top_srcdir)/src/libical/icalduration.h        \
165         $(top_srcdir)/src/libical/icalperiod.h          \
166         $(top_srcdir)/src/libical/icalenums.h           \
167         $(top_srcdir)/src/libical/icaltypes.h           \
168         $(top_srcdir)/src/libical/icalrecur.h           \
169         $(top_srcdir)/src/libical/icalattach.h          \
170         icalderivedvalue.h                              \
171         icalderivedparameter.h                          \
172         $(top_srcdir)/src/libical/icalvalue.h           \
173         $(top_srcdir)/src/libical/icalparameter.h       \
174         icalderivedproperty.h                           \
175         $(top_srcdir)/src/libical/icalproperty.h        \
176         $(top_srcdir)/src/libical/pvl.h                 \
177         $(top_srcdir)/src/libical/icalarray.h           \
178         $(top_srcdir)/src/libical/icalcomponent.h       \
179         $(top_srcdir)/src/libical/icaltimezone.h        \
180         $(top_srcdir)/src/libical/icalparser.h          \
181         $(top_srcdir)/src/libical/icalmemory.h          \
182         icalerror.h                                     \
183         $(top_srcdir)/src/libical/icalrestriction.h     \
184         $(top_srcdir)/src/libical/sspm.h                \
185         $(top_srcdir)/src/libical/icalmime.h            \
186         $(top_srcdir)/src/libical/icallangbind.h        
187
188 # exporting the configure stuff is probably no good idea. 
189 # others use standard defines not in our namespace too.
190 #        $(top_builddir)/config.h                        
191
192 BUILT_COMBINEDHEADERS =         \
193         icalderivedparameter.h  \
194         icalderivedproperty.h   \
195         icalderivedvalue.h
196
197 BUILT_SOURCES =                 \
198         $(BUILT_COMBINEDHEADERS)\
199         icalderivedparameter.c  \
200         icalderivedproperty.c   \
201         icalrestriction.c       \
202         icalderivedvalue.c
203
204 ical.h: $(COMBINEDHEADERS)
205         echo '#ifndef LIBICAL_ICAL_H'     >  ical.h
206         echo '#define LIBICAL_ICAL_H'     >> ical.h
207         echo '#ifdef __cplusplus'         >> ical.h
208         echo 'extern "C" {'               >> ical.h
209         echo '#endif'                     >> ical.h
210         echo '/*'                         >> ical.h
211         echo ' $$''Id''$$'                >> ical.h
212         echo '*/'                         >> ical.h
213         cat $(COMBINEDHEADERS)                          \
214         | egrep -v "#include.*\"ical"                   \
215         | egrep -v "#include.*\"config"                 \
216         | egrep -v "#include.*\"pvl\.h\""               \
217         | egrep -v '\$$(Id|Locker): .+\$$'>> ical.h
218         echo '#ifdef __cplusplus'         >> ical.h
219         echo '}'                          >> ical.h
220         echo '#endif'                     >> ical.h
221         echo '#endif'                     >> ical.h
222
223
224 # parameters
225
226 PARAMETERDEPS = \
227         $(ICALSCRIPTS)/mkderivedparameters.pl \
228         $(DESIGNDATA)/parameters.csv    \
229         icalderivedparameter.c.in \
230         icalderivedparameter.h.in
231
232 icalderivedparameter.h: $(PARAMETERDEPS) 
233         $(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.h.in -h $(DESIGNDATA)/parameters.csv > icalderivedparameter.h 
234
235 icalderivedparameter.c: $(PARAMETERDEPS) $(BUILT_COMBINEDHEADERS)
236         $(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.c.in -c $(DESIGNDATA)/parameters.csv > icalderivedparameter.c
237
238 # properties
239
240 PROPERTYDEPS =                                  \
241         $(ICALSCRIPTS)/mkderivedproperties.pl   \
242         $(DESIGNDATA)/properties.csv            \
243         $(DESIGNDATA)/value-types.csv           \
244         icalderivedproperty.c.in                \
245         icalderivedproperty.h.in
246
247
248 icalderivedproperty.h: $(PROPERTYDEPS)
249         $(PERL)  -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedproperties.pl \
250                 -i $(srcdir)/icalderivedproperty.h.in -h $(DESIGNDATA)/properties.csv\
251                 ${DESIGNDATA}/value-types.csv > icalderivedproperty.h 
252
253 icalderivedproperty.c: $(PROPERTYDEPS) $(BUILT_COMBINEDHEADERS)
254         $(PERL)  -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedproperties.pl \
255                 -i $(srcdir)/icalderivedproperty.c.in -c $(DESIGNDATA)/properties.csv \
256                 ${DESIGNDATA}/value-types.csv > icalderivedproperty.c
257
258 # restrictions
259
260 RESTRICTIONDEPS =                               \
261         $(ICALSCRIPTS)/mkrestrictiontable.pl    \
262         $(DESIGNDATA)/restrictions.csv          \
263         icalrestriction.c.in
264
265 icalrestriction.c: $(RESTRICTIONDEPS)
266         $(PERL) $(ICALSCRIPTS)/mkrestrictiontable.pl  -i $(srcdir)/icalrestriction.c.in \
267                 $(DESIGNDATA)/restrictions.csv > icalrestriction.c
268
269 # values
270
271 VALUEDEPS =                                     \
272         $(ICALSCRIPTS)/mkderivedvalues.pl       \
273         $(DESIGNDATA)/value-types.csv           \
274         icalderivedvalue.c.in                           \
275         icalderivedvalue.h.in
276
277 icalderivedvalue.h: $(VALUEDEPS)
278         $(PERL) -I$(ICALSCRIPTS)  $(ICALSCRIPTS)/mkderivedvalues.pl \
279                  -i $(srcdir)/icalderivedvalue.h.in -h $(DESIGNDATA)/value-types.csv > icalderivedvalue.h
280
281 icalderivedvalue.c: $(VALUEDEPS) $(BUILT_COMBINEDHEADERS)
282         $(PERL)  -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \
283                 -i $(srcdir)/icalderivedvalue.c.in -c $(DESIGNDATA)/value-types.csv > icalderivedvalue.c
284
285 # c++ needs ical.h auto-generated.
286 icalparameter_cxx.lo: ical.h
287 icalproperty_cxx.lo: ical.h
288 icalvalue_cxx.lo: ical.h
289 vcomponent.lo: ical.h
290
291
292 # housekeeping
293 CONFIG_CLEAN_FILES = y.output
294
295 CLEANFILES = $(BUILT_SOURCES) $(BUILT_COMBINEDHEADERS)
296
297 dist-hook:
298         cd $(distdir); rm -f $(BUILT_SOURCES)
299         cd $(distdir); rm -f ical.h icalversion.h 
300
301 EXTRA_DIST =                    \
302         icalderivedparameter.c.in \
303         icalderivedparameter.h.in \
304         icalderivedproperty.c.in \
305         icalderivedproperty.h.in \
306         icalrestriction.c.in    \
307         icalderivedvalue.c.in   \
308         icalderivedvalue.h.in   \
309         icalversion.h.in
310
311 $(srcdir)/icalcomponent.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
312 icalderivedparameter.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
313 icalderivedproperty.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
314 icalderivedvalue.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
315 $(srcdir)/icalduration.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
316 $(srcdir)/icallangbind.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
317 $(srcdir)/icalmime.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
318 $(srcdir)/icalparameter.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
319 $(srcdir)/icalparser.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
320 $(srcdir)/icalproperty.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
321 icalrestriction.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
322 $(srcdir)/icaltime.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
323 $(srcdir)/icalvalue.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h