More Win32 automake macros. For .def files: GLIB_DEF, GMODULE_DEF,
[platform/upstream/glib.git] / gobject / Makefile.am
1 # GRuntime - GLib Type, Object, Parameter and Signal Library
2 # Copyright (C) 1997,98,99,2000 Tim Janik and Red Hat, Inc.
3 #
4 ## Process this file with automake to produce Makefile.in
5
6 INCLUDES = @STRIP_BEGIN@ \
7         -DG_LOG_DOMAIN=g_log_domain_gruntime    \
8         -I$(top_srcdir)                         \
9         -I$(top_srcdir)/glib                    \
10         -I$(top_builddir)                       \
11         @GLIB_DEBUG_FLAGS@                      \
12         -DG_DISABLE_CONST_RETURNS               \
13 @STRIP_END@
14
15 libglib = $(top_builddir)/glib/libglib-1.3.la
16
17 # libraries to compile and install
18 lib_LTLIBRARIES = libgobject-1.3.la
19
20 if MS_LIB_AVAILABLE
21 noinst_DATA = gobject-1.3.lib
22 endif
23
24 if PLATFORM_WIN32
25 no_undefined = -no-undefined
26 endif
27 if OS_WIN32
28 export_symbols = -export-symbols gobject.def
29 endif
30
31 # libtool stuff: set version and export symbols for resolving
32 libgobjectincludedir = $(includedir)/glib-2.0/gobject
33 libgobject_1_3_la_LDFLAGS = @STRIP_BEGIN@ \
34         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)    \
35         -export-dynamic $(no_undefined) $(export_symbols)       \
36 @STRIP_END@
37
38 libgobject_1_3_la_LIBADD = @G_OBJECT_WIN32_RESOURCE@ $(libglib)
39
40 libgobject_1_3_la_DEPENDENCIES = @G_OBJECT_WIN32_RESOURCE@ @GOBJECT_DEF@
41
42 #
43 # setup source file variables
44 #
45 # GRuntime header files for public installation (non-generated)
46 gruntime_public_h_sources = @STRIP_BEGIN@ \
47         gboxed.h                \
48         gclosure.h              \
49         genums.h                \
50         gobject.h               \
51         gparam.h                \
52         gparamspecs.h           \
53         gsignal.h               \
54         gsourceclosure.h        \
55         gtype.h                 \
56         gtypemodule.h           \
57         gtypeplugin.h           \
58         gvalue.h                \
59         gvaluearray.h           \
60         gvaluecollector.h       \
61         gvaluetypes.h           \
62         gobjectnotifyqueue.c    \
63 @STRIP_END@
64 # GRuntime header files that don't get installed
65 gruntime_private_h_sources = @STRIP_BEGIN@ \
66 @STRIP_END@
67 # GRuntime C sources to build the library from
68 gruntime_c_sources = @STRIP_BEGIN@ \
69         gboxed.c                \
70         gclosure.c              \
71         genums.c                \
72         gobject.c               \
73         gparam.c                \
74         gparamspecs.c           \
75         gsignal.c               \
76         gsourceclosure.c        \
77         gtype.c                 \
78         gtypemodule.c           \
79         gtypeplugin.c           \
80         gvalue.c                \
81         gvaluearray.c           \
82         gvaluetransform.c       \
83         gvaluetypes.c           \
84 @STRIP_END@
85
86 # we use our own built_sources variable rules to avoid automake's
87 # BUILT_SOURCES oddities
88 # we generate frequently rebuild files piggyback on a stamp file, so sources
89 # depending on them only get rebuild when the built source actually changed
90 # content
91
92 # built sources that get installed with the header files
93 gruntime_built_public_sources = @STRIP_BEGIN@ \
94         gmarshal.h      \
95 @STRIP_END@
96 # built sources that don't get installed
97 gruntime_built_sources = @STRIP_BEGIN@ \
98         stamp-gmarshal.h                 \
99         gmarshal.c                       \
100         ${gruntime_built_public_sources} \
101 @STRIP_END@
102 # non-header sources (headers should be specified in the above variables)
103 # that don't serve as direct make target sources, i.e. they don't have
104 # their own .lo rules and don't get publically installed
105 gruntime_extra_sources = @STRIP_BEGIN@ \
106         gmarshal.list           \
107         gmarshal.strings        \
108 @STRIP_END@
109
110
111 #
112 # setup GRuntime sources and their dependancies
113 #
114 gruntime_target_headers = $(gruntime_public_h_sources) $(gruntime_built_public_sources)
115 gruntime_target_sources = $(gruntime_c_sources)
116 MAINTAINERCLEANFILES += $(gruntime_built_sources)
117 EXTRA_HEADERS +=
118 EXTRA_DIST += $(gruntime_private_h_sources) $(gruntime_extra_sources)
119 EXTRA_DIST += $(gruntime_built_sources)
120
121 #
122 # rules to generate built sources
123 #
124 # setup autogeneration dependancies
125 gen_sources = xgen-gmh xgen-gmc xgen-gms
126 CLEANFILES += $(gen_sources)
127
128 $(libgobject_1_3_la_OBJECTS): $(gruntime_built_sources)  ${gruntime_built_public_sources} # this is our oldest file, used for implicit auto-generation deps
129 # initial creation of the real stamp-* files
130 gmarshal.h:     # never add deps here
131         test -f "$(srcdir)/$@" || touch $(srcdir)/$@
132 # normal autogeneration rules
133 # all autogenerated files need to be generated in the srcdir,
134 # so old versions get remade and are not confused with newer
135 # versions in the build dir. thus a development setup requires
136 # srcdir to be writable, passing --disable-rebuilds to
137 # ../configure will supress all autogeneration rules.
138 $(srcdir)/stamp-gmarshal.h: @REBUILD@ gmarshal.list gmarshal.h glib-genmarshal$(EXEEXT)
139         echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \
140         && echo "#define __G_MARSHAL_H__" >> xgen-gmh \
141         && ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --header >> xgen-gmh \
142         && echo "#endif /* __G_MARSHAL_H__ */" >> xgen-gmh \
143         && (cmp -s xgen-gmh $(srcdir)/gmarshal.h || cp xgen-gmh $(srcdir)/gmarshal.h) \
144         && rm -f xgen-gmh xgen-gmh~ \
145         && echo timestamp > $@
146 $(srcdir)/gmarshal.c: @REBUILD@ $(srcdir)/stamp-gmarshal.h
147         ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --body >> xgen-gmc \
148         && cp xgen-gmc $(srcdir)/gmarshal.c \
149         && rm -f xgen-gmc xgen-gmc~
150 $(srcdir)/gmarshal.strings: @REBUILD@ $(srcdir)/gmarshal.list
151         grep '^[A-Z]' $(srcdir)/gmarshal.list \
152         | sed -e 's/^/"g_cclosure_marshal_/' -e 's/:/__/' -e 's/,/_/g' -e 's/$$/",/' > xgen-gms \
153         && cp xgen-gms $(srcdir)/gmarshal.strings \
154         && rm -f xgen-gms xgen-gms~
155 glib-genmarshal.o: gmarshal.strings
156
157
158 # target platform:
159 libgobjectinclude_HEADERS = $(gruntime_target_headers)
160 libgobject_1_3_la_SOURCES = $(gruntime_target_sources)
161
162 #
163 # programs to compile and install
164 #
165 bin_PROGRAMS = gobject-query glib-genmarshal
166 bin_SCRIPTS = glib-mkenums
167 noinst_PROGRAMS =  testgruntime
168 # source files
169 gobject_query_SOURCES = gobject-query.c
170 glib_genmarshal_SOURCES = glib-genmarshal.c
171 testgruntime_SOURCES = testgruntime.c
172 # link programs against libgobject
173 progs_LDADD = ./libgobject-1.3.la $(libglib)
174 glib_genmarshal_LDADD = $(libglib)
175 gobject_query_LDADD = $(progs_LDADD)
176 testgruntime_LDADD = $(progs_LDADD)
177
178 #
179 # manual pages to install
180 #
181 man_MANS = glib-genmarshal.1 glib-mkenums.1
182
183 #
184 # auxillary files
185 #
186 EXTRA_DIST +=                   \
187         makefile.mingw.in       \
188         makefile.msc.in         \
189         gobject.def             \
190         gobject.rc.in           \
191         glib-genmarshal.1       \
192         glib-mkenums            \
193         glib-mkenums.1
194
195 BUILT_EXTRA_DIST = \
196         makefile.mingw          \
197         makefile.msc            \
198         gobject.rc
199
200 glib-mkenums: $(srcdir)/glib-mkenums
201         if test -e glib-mkenums; then           \
202           rm glib-mkenums;                      \
203         fi;                                     \
204         cp $(srcdir)/glib-mkenums glib-mkenums
205
206 if OS_WIN32
207 @G_OBJECT_WIN32_RESOURCE@ : gobject.rc
208         $(top_srcdir)/build/win32/lt-compile-resource gobject.rc @G_OBJECT_WIN32_RESOURCE@
209 endif
210
211 gobject-1.3.lib: libgobject-1.3.la gobject.def
212         lib -name:libgobject-1.3-@LT_CURRENT_MINUS_AGE@.dll -def:gobject.def -out:$@
213
214 gobject.rc: $(top_builddir)/config.status $(top_srcdir)/gobject/gobject.rc.in
215         cd $(top_builddir) && CONFIG_FILES=gobject/$@ CONFIG_HEADERS= $(SHELL) ./config.status
216
217 makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gobject/makefile.mingw.in
218         cd $(top_builddir) && CONFIG_FILES=gobject/$@ CONFIG_HEADERS= $(SHELL) ./config.status
219
220 makefile.msc: $(top_builddir)/config.status $(top_srcdir)/gobject/makefile.msc.in
221         cd $(top_builddir) && CONFIG_FILES=gobject/$@ CONFIG_HEADERS= $(SHELL) ./config.status
222
223 dist-hook: $(BUILT_EXTRA_DIST)
224         files='$(BUILT_EXTRA_DIST)'; \
225         for f in $$files; do \
226           if test -f $$f; then d=.; else d=$(srcdir); fi; \
227           cp $$d/$$f $(distdir) || exit 1; done