1# Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved.
2#
3# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
4# OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
5#
6# Permission is hereby granted to use or copy this program
7# for any purpose,  provided the above notices are retained on all copies.
8# Permission to modify the code and to distribute modified code is granted,
9# provided the above notices are retained, and a notice that the code was
10# modified is included with the above copyright notice.
11#
12# Original author: Tom Tromey
13# Severely truncated by Hans-J. Boehm
14
15## Process this file with automake to produce Makefile.in.
16
17## FIXME: `make dist' in this directory will not currently work.  Many
18## files that should be in the distribution are not mentioned in this
19## Makefile.am.
20
21ACLOCAL_AMFLAGS = -I m4
22
23SUBDIRS = m4 include doc
24
25AM_CPPFLAGS = -I$(top_builddir)/.. -I$(top_srcdir)/..
26
27#
28# libtool is not capable of creating shared/static versions of a convenience
29# library, so we have to do it ourselves
30#
31
32noinst_LTLIBRARIES = libmonogc.la libmonogc-static.la
33
34EXTRA_DIST =
35    ## more items will be succesively added below
36
37if POWERPC_DARWIN
38asm_libgc_sources = powerpc_darwin_mach_dep.s
39endif
40
41if TARGET_IA64
42asm_libgc_sources = ia64_save_regs_in_stack.s
43endif
44
45libmonogc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
46dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c \
47malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
48obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
49solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \
50backgraph.c win32_threads.c \
51pthread_support.c pthread_stop_world.c darwin_stop_world.c \
52openbsd_stop_world.c mach_dep.c $(asm_libgc_sources)
53
54# Include THREADDLLIBS here to ensure that the correct versions of
55# linuxthread semaphore functions get linked:
56libmonogc_la_LIBADD = $(THREADDLLIBS) $(UNWINDLIBS)
57libmonogc_la_DEPENDENCIES =
58libmonogc_la_LDFLAGS = -version-info 1:2:0
59
60EXTRA_libmonogc_la_SOURCES = alpha_mach_dep.S \
61    mips_sgi_mach_dep.s mips_ultrix_mach_dep.s powerpc_darwin_mach_dep.s \
62    rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
63    sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
64
65libmonogc_static_la_SOURCES = $(libmonogc_la_SOURCES)
66libmonogc_static_la_LIBADD = $(libmonogc_la_LIBADD)
67libmonogc_static_la_LDFLAGS = -static
68
69EXTRA_DIST += alpha_mach_dep.S mips_sgi_mach_dep.s sparc_mach_dep.S
70
71AM_CFLAGS = $(WERROR_CFLAGS) @GC_CFLAGS@
72
73if CPLUSPLUS
74extra_checks = test_cpp
75else
76extra_checks =
77endif
78
79#check_PROGRAMS = gctest $(extra_checks)
80
81#test.o:	$(srcdir)/tests/test.c
82#	$(COMPILE) -c $(srcdir)/tests/test.c
83# 	Using $< in the above seems to fail with the HP/UX on Itanium make.
84#test_cpp.o:	$(srcdir)/tests/test_cpp.cc
85#	$(CXXCOMPILE) -c $(srcdir)/tests/test_cpp.cc
86
87## FIXME: this is probably the reason why some files from BUILT_SOURCES
88##     are included in the distribution
89# gctest_OBJECTS = test.o
90#gctest_SOURCES = tests/test.c
91#gctest_LDADD = ./libgc.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
92#test_cpp_SOURCES = tests/test_cpp.cc
93#test_cpp_LDADD = ./libgc.la ./libgccpp.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
94
95#TESTS = gctest $(extra_checks)
96
97## FIXME: relies on internal code generated by automake.
98all_objs = $(libgc_la_OBJECTS)
99$(all_objs) : include/private/gcconfig.h include/private/gc_priv.h \
100include/private/gc_hdrs.h include/gc.h include/gc_gcj.h include/gc_mark.h
101
102## FIXME: we shouldn't have to do this, but automake forces us to.
103if COMPILER_XLC
104  ## XLC neither requires nor tolerates the unnecessary assembler goop
105  ASM_CPP_OPTIONS =
106else
107  ## We use -Wp,-P to strip #line directives.  Irix `as' chokes on
108  ## these.
109  ASM_CPP_OPTIONS = -Wp,-P -x assembler-with-cpp
110endif
111.s.lo:
112## We use -Wp,-P to strip #line directives.  Irix `as' chokes on
113## these.
114	$(LTCOMPILE) $(ASM_CPP_OPTIONS) -c $<
115
116## We have our own definition of LTCOMPILE because we want to use our
117## CFLAGS, not those passed in from the top level make.
118LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \
119	-I$(top_srcdir)/include $(AM_CPPFLAGS) $(CPPFLAGS) \
120	$(AM_CFLAGS) $(MY_CFLAGS) $(GC_CFLAGS)
121LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LDFLAGS) -o $@
122
123# Work around what appears to be a GNU make bug handling MAKEFLAGS
124# values defined in terms of make variables, as is the case for CC and
125# friends when we are called from the top level Makefile.
126AM_MAKEFLAGS = \
127	"AR_FLAGS=$(AR_FLAGS)" \
128	"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
129	"CFLAGS=$(CFLAGS)" \
130	"CXXFLAGS=$(CXXFLAGS)" \
131	"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
132	"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
133	"INSTALL=$(INSTALL)" \
134	"INSTALL_DATA=$(INSTALL_DATA)" \
135	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
136	"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
137	"LDFLAGS=$(LDFLAGS)" \
138	"LIBCFLAGS=$(LIBCFLAGS)" \
139	"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
140	"MAKE=$(MAKE)" \
141	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
142	"PICFLAG=$(PICFLAG)" \
143	"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
144	"SHELL=$(SHELL)" \
145	"EXPECT=$(EXPECT)" \
146	"RUNTEST=$(RUNTEST)" \
147	"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
148	"exec_prefix=$(exec_prefix)" \
149	"infodir=$(infodir)" \
150	"libdir=$(libdir)" \
151	"prefix=$(prefix)" \
152	"tooldir=$(tooldir)" \
153	"AR=$(AR)" \
154	"AS=$(AS)" \
155	"CC=$(CC)" \
156	"CXX=$(CXX)" \
157	"LD=$(LD)" \
158	"LIBCFLAGS=$(LIBCFLAGS)" \
159	"NM=$(NM)" \
160	"PICFLAG=$(PICFLAG)" \
161	"RANLIB=$(RANLIB)" \
162	"DESTDIR=$(DESTDIR)"
163
164MAKEOVERRIDES=
165
166# files used by makefiles other than Makefile.am
167#
168EXTRA_DIST += add_gc_prefix.c gcname.c if_mach.c if_not_there.c hpux_test_and_clear.s pc_excludes gc.mak MacOS.c MacProjects.sit.hqx mach_dep.c setjmp_t.c threadlibs.c AmigaOS.c version.h Mac_files/datastart.c Mac_files/dataend.c Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h
169
170# cord package
171#
172EXTRA_DIST += cord cord/cordbscs.c cord/cordtest.c cord/de.c cord/de_win.c cord/de_win.ICO cord/cordprnt.c cord/cordxtra.c cord/de_cmds.h cord/de_win.h cord/de_win.RC
173
174# this is an auxiliary shell file used by Makefile and Makefile.direct
175#
176CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
177
178# :FIXME: why do we distribute this one???
179#
180EXTRA_DIST += configure.host
181
182#
183# :GOTCHA: GNU make rule for making .s out of .S is flawed,
184# it will not remove dest if building fails
185.S.s:
186	if $(CPP) $< >$@ ; then :; else rm -f $@; fi
187
188