• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Process this file with automake to produce Makefile.in
2include $(top_srcdir)/Makefile.decl
3
4if HAVE_GOOD_PRINTF
5else
6PRINTF_SUBDIR = gnulib
7printf_la = gnulib/libgnulib.la
8endif
9
10if ENABLE_REGEX
11if USE_SYSTEM_PCRE
12else
13MAYBE_PCRE = pcre
14endif
15gregex_c = gregex.c
16gregex_h = gregex.h
17else
18gregex_c =
19gregex_h =
20endif
21
22SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests
23
24DIST_SUBDIRS = libcharset gnulib pcre update-pcre tests
25
26AM_CPPFLAGS = 				\
27	-I$(top_srcdir) 		\
28	$(pcre_inc) 			\
29	-DG_LOG_DOMAIN=\"GLib\" 	\
30	$(GLIB_DEBUG_FLAGS) 		\
31	-DG_DISABLE_DEPRECATED 		\
32	-DGLIB_COMPILATION 		\
33	-DPCRE_STATIC
34
35glib.def: glib.symbols
36	(echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/glib.symbols | sed -e '/^$$/d' -e 's/^/	/' -e 's/G_GNUC_[^ ]*//g') > glib.def
37
38galias.h: glib.symbols
39	  $(PERL) $(srcdir)/makegalias.pl < $(srcdir)/glib.symbols > galias.h
40
41galiasdef.c: glib.symbols
42	  $(PERL) $(srcdir)/makegalias.pl -def < $(srcdir)/glib.symbols > galiasdef.c
43
44if OS_LINUX
45if HAVE_GNUC_VISIBILITY
46TESTS_ENVIRONMENT = GLIB_DEBUG_FLAGS="$(GLIB_DEBUG_FLAGS)"
47TESTS = abicheck.sh pltcheck.sh
48endif
49endif
50
51BUILT_SOURCES = galias.h galiasdef.c
52
53MIRRORING_TAB_SOURCE = 				\
54	glib-mirroring-tab/Makefile 		\
55	glib-mirroring-tab/gen-mirroring-tab.c	\
56	glib-mirroring-tab/packtab.h		\
57	glib-mirroring-tab/packtab.c
58
59# The compilation of GRegex can be disabled, but the source files must
60# be distributed.
61EXTRA_DIST += 			\
62	makefile.msc.in		\
63	glib.rc.in		\
64	gen-unicode-tables.pl	\
65	gen-script-table.pl	\
66	makegalias.pl		\
67	abicheck.sh		\
68	pltcheck.sh		\
69	glib.symbols		\
70	gregex.c		\
71	gregex.h		\
72	win_iconv.c		\
73	$(MIRRORING_TAB_SOURCE)
74
75# These may be in the builddir too
76BUILT_EXTRA_DIST = 		\
77	makefile.msc		\
78	glib.rc			\
79	galias.h		\
80	galiasdef.c
81
82lib_LTLIBRARIES = libglib-2.0.la
83
84if OS_WIN32_AND_DLL_COMPILATION
85if MS_LIB_AVAILABLE
86noinst_DATA = glib-2.0.lib
87
88install_ms_lib_cmd = $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
89uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/glib-2.0.lib
90endif
91endif
92
93install-ms-lib:
94	$(install_ms_lib_cmd)
95
96uninstall-ms-lib:
97	$(uninstall_ms_lib_cmd)
98
99libglib_2_0_la_SOURCES = 	\
100	garray.c		\
101	gasyncqueue.c		\
102	gatomic.c		\
103	gbacktrace.c		\
104	gbase64.c		\
105	gbookmarkfile.c 	\
106	gbsearcharray.h		\
107	gcache.c		\
108	gchecksum.c		\
109	gcompletion.c		\
110	gconvert.c		\
111	gdataset.c		\
112	gdatasetprivate.h	\
113	gdate.c         	\
114	gdir.c			\
115	gerror.c		\
116	gfileutils.c		\
117	ghash.c			\
118	ghook.c			\
119	giochannel.c    	\
120	gkeyfile.c        	\
121	glibintl.h		\
122	glist.c			\
123	gmain.c         	\
124	gmappedfile.c		\
125	gmarkup.c		\
126	gmem.c			\
127	gmessages.c		\
128	gmirroringtable.h	\
129	gnode.c			\
130	goption.c		\
131	gpattern.c		\
132	gpoll.c			\
133	gprimes.c		\
134	gqsort.c		\
135	gqueue.c		\
136	grel.c			\
137	grand.c			\
138	$(gregex_c)		\
139	gscanner.c		\
140	gscripttable.h		\
141	gsequence.c		\
142	gshell.c		\
143	gslice.c		\
144	gslist.c		\
145	gstdio.c		\
146	gstrfuncs.c		\
147	gstring.c		\
148	gtestutils.c		\
149	gthread.c       	\
150	gthreadprivate.h	\
151	gthreadpool.c   	\
152	gtimer.c		\
153	gtree.c			\
154	guniprop.c		\
155	gutf8.c			\
156	gunibreak.h		\
157	gunibreak.c		\
158	gunichartables.h	\
159	gunicollate.c		\
160	gunicomp.h		\
161	gunidecomp.h		\
162	gunidecomp.c		\
163	gunicodeprivate.h	\
164	gurifuncs.c 		\
165	gutils.c		\
166	gdebug.h		\
167	gprintf.c		\
168	gprintfint.h
169
170EXTRA_libglib_2_0_la_SOURCES = \
171	giounix.c	\
172	giowin32.c	\
173	gspawn.c	\
174	gspawn-win32.c	\
175	gwin32.c
176
177glibincludedir=$(includedir)/glib-2.0
178glibinclude_HEADERS =   \
179	glib-object.h	\
180	glib.h
181
182glibsubincludedir=$(includedir)/glib-2.0/glib
183glibsubinclude_HEADERS =   \
184	galloca.h	\
185	garray.h	\
186	gasyncqueue.h	\
187	gatomic.h	\
188	gbacktrace.h	\
189	gbase64.h	\
190	gbookmarkfile.h \
191	gcache.h	\
192	gchecksum.h	\
193	gcompletion.h	\
194	gconvert.h	\
195	gdataset.h	\
196	gdate.h		\
197	gdir.h		\
198	gerror.h	\
199	gfileutils.h	\
200	ghash.h		\
201	ghook.h		\
202	gi18n.h		\
203	gi18n-lib.h	\
204	giochannel.h	\
205	gkeyfile.h 	\
206	glist.h		\
207	gmacros.h	\
208	gmain.h		\
209	gmappedfile.h	\
210	gmarkup.h	\
211	gmem.h		\
212	gmessages.h	\
213	gnode.h		\
214	goption.h	\
215	gpattern.h	\
216	gpoll.h		\
217	gprimes.h	\
218	gqsort.h	\
219	gquark.h	\
220	gqueue.h	\
221	grand.h		\
222	$(gregex_h)	\
223	grel.h		\
224	gscanner.h	\
225	gsequence.h	\
226	gshell.h	\
227	gslice.h	\
228	gslist.h	\
229	gspawn.h	\
230	gstdio.h	\
231	gstrfuncs.h	\
232	gtestutils.h	\
233	gstring.h	\
234	gthread.h	\
235	gthreadpool.h	\
236	gtimer.h	\
237	gtree.h		\
238	gtypes.h	\
239	gunicode.h	\
240	gurifuncs.h 		\
241	gutils.h	\
242	gwin32.h	\
243	gprintf.h
244
245install-data-local: install-ms-lib install-def-file
246	@if test -f $(glibincludedir)/glist.h ; then					\
247	  echo "*** Old headers found in $(glibincludedir). You should remove the" ;	\
248	  echo "*** contents of this directory and type 'make install' again." ;	\
249	  false ;									\
250        fi
251
252uninstall-local: uninstall-ms-lib uninstall-def-file
253
254if PLATFORM_WIN32
255no_undefined = -no-undefined
256endif
257
258if OS_WIN32_AND_DLL_COMPILATION
259export_symbols = -export-symbols glib.def
260
261glib_win32_res = glib-win32-res.o
262glib_win32_res_ldflag = -Wl,$(glib_win32_res)
263
264glib_def = glib.def
265
266install-def-file:
267	$(INSTALL) glib.def $(DESTDIR)$(libdir)/glib-2.0.def
268
269uninstall-def-file:
270	-rm $(DESTDIR)$(libdir)/glib-2.0.def
271else
272install-def-file:
273uninstall-def-file:
274
275export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
276endif
277
278if ENABLE_REGEX
279if USE_SYSTEM_PCRE
280pcre_lib = $(PCRE_LIBS)
281pcre_inc = $(PCRE_CFLAGS)
282else
283pcre_lib = pcre/libpcre.la
284pcre_inc =
285endif
286else
287pcre_lib =
288pcre_inc =
289endif
290
291libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib)
292libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def)
293
294libglib_2_0_la_LDFLAGS = \
295	 $(glib_win32_res_ldflag) \
296	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
297	-export-dynamic $(no_undefined) $(export_symbols)
298
299INSTALL_PROGS=
300
301gspawn-win32-helper-console.c:
302	echo '#define HELPER_CONSOLE' >$@
303	echo '#include "gspawn-win32-helper.c"' >>$@
304
305gspawn-win64-helper.c:
306	echo '#include "gspawn-win32-helper.c"' >$@
307
308gspawn-win64-helper-console.c:
309	echo '#define HELPER_CONSOLE' >$@
310	echo '#include "gspawn-win32-helper.c"' >>$@
311
312if OS_WIN32
313if OS_WIN32_X64
314INSTALL_PROGS += gspawn-win64-helper gspawn-win64-helper-console
315gspawn_win64_helper_LDADD = libglib-2.0.la
316gspawn_win64_helper_LDFLAGS = -mwindows
317gspawn_win64_helper_console_LDADD = libglib-2.0.la
318else
319INSTALL_PROGS += gspawn-win32-helper gspawn-win32-helper-console
320gspawn_win32_helper_LDADD = libglib-2.0.la
321gspawn_win32_helper_LDFLAGS = -mwindows
322gspawn_win32_helper_console_LDADD = libglib-2.0.la
323endif
324endif
325
326glib-win32-res.o: glib.rc
327	$(WINDRES) glib.rc $@
328
329bin_PROGRAMS	 = ${INSTALL_PROGS}
330
331if OS_UNIX
332
333INSTALL_PROGS	+= gtester
334gtester_SOURCES	 = gtester.c
335gtester_LDADD	 = libglib-2.0.la
336
337auto_config_binscripts = gtester-report
338bin_SCRIPTS = ${auto_config_binscripts}
339EXTRA_DIST += ${auto_config_binscripts}
340
341CONFIGVARS = \
342        "bindir"    	: "${bindir}",		\
343        "glib-version"  : "${GLIB_VERSION}"
344
345install-exec-hook:
346	for sf in ${auto_config_binscripts} ; do \
347	  mv -f "$(DESTDIR)$(bindir)/$$sf" "$(DESTDIR)$(bindir)/$$sf".tmp \
348	  && sed < "$(DESTDIR)$(bindir)/$$sf".tmp > "$(DESTDIR)$(bindir)/$$sf" \
349	    -e '1,24s|^ *#@PKGINSTALL_CONFIGVARS_IN24LINES@|  ${CONFIGVARS}|' \
350	    -e '1,1s|#! /usr/bin/env python\([0-9]\+\(\.[0-9]\+\)\?\)\?|#!${PYTHON}|' \
351	  || exit $$? ; \
352	  rm -f "$(DESTDIR)$(bindir)/$$sf".tmp ; \
353	done
354
355endif
356
357glib-2.0.lib: libglib-2.0.la glib.def
358	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:glib.def -out:$@
359
360dist-hook: $(BUILT_EXTRA_DIST)
361	files='$(BUILT_EXTRA_DIST)'; \
362	for f in $$files; do \
363	  if test -f $$f; then d=.; else d=$(srcdir); fi; \
364	  cp $$d/$$f $(distdir) || exit 1; done
365