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