* Moved boehm-gc from src/ to src/mm/.
[cacao.git] / src / mm / boehm-gc / Makefile.am
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 # Modified by: Grzegorz Jakacki <jakacki at acm dot org>
15
16 ## Process this file with automake to produce Makefile.in.
17
18 ## FIXME: `make distcheck' in this directory will not currently work.
19 ##     This is most likely to the explicit flags passed to submakes.
20
21 AUTOMAKE_OPTIONS = foreign
22
23 SUBDIRS = doc include
24
25 EXTRA_DIST = 
26     ## more items will be succesively added below
27
28 if CPLUSPLUS
29 extra = libgccpp.la
30 else
31 extra = 
32 endif
33 noinst_LTLIBRARIES = libgc.la $(extra)
34
35 #include_HEADERS = include/gc.h include/gc_local_alloc.h \
36 #include/gc_pthread_redirects.h include/gc_config_macros.h \
37 #include/leak_detector.h include/gc_typed.h @addincludes@
38
39 EXTRA_HEADERS = include/gc_cpp.h include/gc_allocator.h
40
41 if POWERPC_DARWIN
42 asm_libgc_sources = powerpc_darwin_mach_dep.s
43 else
44 asm_libgc_sources = 
45 endif
46
47 libgc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
48 dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c \
49 malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
50 obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
51 solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \
52 backgraph.c win32_threads.c \
53 pthread_support.c pthread_stop_world.c darwin_stop_world.c \
54 $(asm_libgc_sources)
55
56 # Include THREADDLLIBS here to ensure that the correct versions of
57 # linuxthread semaphore functions get linked:
58 libgc_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS)
59 libgc_la_DEPENDENCIES = @addobjs@
60 libgc_la_LDFLAGS = -version-info 1:2:0
61
62 EXTRA_libgc_la_SOURCES = alpha_mach_dep.S \
63     mips_sgi_mach_dep.s mips_ultrix_mach_dep.s powerpc_darwin_mach_dep.s \
64     rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
65     sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
66
67 libgccpp_la_SOURCES = gc_cpp.cc
68 libgccpp_la_LIBADD = $(THREADDLLIBS) $(UNWINDLIBS)
69 libgccpp_la_LDFLAGS = -version-info 1:2:0
70
71 EXTRA_DIST += alpha_mach_dep.S mips_sgi_mach_dep.s sparc_mach_dep.S
72
73 #AM_CXXFLAGS = @GC_CFLAGS@
74 #AM_CFLAGS = @GC_CFLAGS@ -I$(top_builddir)/include
75 AM_CPPFLAGS = -I$(top_builddir)/include
76
77 if CPLUSPLUS
78 extra_checks = test_cpp
79 else
80 extra_checks = 
81 endif
82
83 #check_PROGRAMS = gctest $(extra_checks)
84
85 test.o: $(srcdir)/tests/test.c
86         $(COMPILE) -c $(srcdir)/tests/test.c
87 #       Using $< in the above seems to fail with the HP/UX on Itanium make.
88 test_cpp.o:     $(srcdir)/tests/test_cpp.cc
89         $(CXXCOMPILE) -c $(srcdir)/tests/test_cpp.cc
90
91 ## FIXME: this is probably the reason why some files from BUILT_SOURCES
92 ##     are included in the distribution
93 # gctest_OBJECTS = test.o
94 #gctest_SOURCES = tests/test.c
95 #gctest_LDADD = ./libgc.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
96 #test_cpp_SOURCES = tests/test_cpp.cc
97 #test_cpp_LDADD = ./libgc.la ./libgccpp.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
98
99 TESTS = $(check_PROGRAMS)
100
101 ## FIXME: relies on internal code generated by automake.
102 all_objs = @addobjs@ $(libgc_la_OBJECTS)
103 $(all_objs) : include/private/gcconfig.h include/private/gc_priv.h \
104 include/private/gc_hdrs.h include/gc.h include/gc_gcj.h \
105 include/gc_pthread_redirects.h include/gc_config_macros.h \
106 include/gc_mark.h @addincludes@
107
108 ## FIXME: we shouldn't have to do this, but automake forces us to.
109 if COMPILER_XLC
110   ## XLC neither requires nor tolerates the unnecessary assembler goop
111   ASM_CPP_OPTIONS =
112 else
113   ## We use -Wp,-P to strip #line directives.  Irix `as' chokes on
114   ## these.
115   ASM_CPP_OPTIONS = -Wp,-P -x assembler-with-cpp
116 endif
117 .s.lo:
118 ## We use -Wp,-P to strip #line directives.  Irix `as' chokes on
119 ## these.
120         $(LTCOMPILE) $(ASM_CPP_OPTIONS) -c $<
121
122 ## We have our own definition of LTCOMPILE because we want to use our
123 ## CFLAGS, not those passed in from the top level make.
124 #LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \
125 #       $(AM_CPPFLAGS) $(CPPFLAGS) \
126 #       $(AM_CFLAGS) $(MY_CFLAGS) $(GC_CFLAGS) 
127 #LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LDFLAGS) -o $@
128
129 ## We need to add DEFS to assembler flags
130 ## :FIXME: what if assembler does not accept -D... ?
131 ##     (use Autoconf to prepare ASDEFS ???)
132
133 CCASFLAGS += $(DEFS)
134
135 dist_noinst_SCRIPTS = callprocs configure.host
136     ## callprocs --- used by Makefile.{dj,direct}
137     ## configure.host --- used by Makefile.{am,dj,direct}
138
139 # headers which are not installed
140 # (see include/Makefile.am for more)
141 #
142 dist_noinst_HEADERS = version.h
143
144 # documentation which is not installed
145 #
146 EXTRA_DIST += README.QUICK
147
148 # other makefiles
149 # :GOTCHA: deliberately we do not include 'Makefile'
150 EXTRA_DIST += BCC_MAKEFILE NT_MAKEFILE NT_THREADS_MAKEFILE \
151     OS2_MAKEFILE PCR-Makefile digimars.mak EMX_MAKEFILE \
152     Makefile.direct Makefile.dj Makefile.DLLs SMakefile.amiga \
153     WCC_MAKEFILE
154
155 # files used by makefiles other than Makefile.am
156 #
157 EXTRA_DIST += add_gc_prefix.c gcname.c if_mach.c if_not_there.c \
158     hpux_test_and_clear.s pc_excludes gc.mak MacOS.c \
159     MacProjects.sit.hqx mach_dep.c setjmp_t.c \
160     threadlibs.c AmigaOS.c \
161     Mac_files/datastart.c Mac_files/dataend.c \
162     Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h
163
164 # part of C++ interface
165 #
166 EXTRA_DIST += gc_cpp.cc gc_cpp.cpp
167
168 # tests not used by Makefile.am (:FIXME: why?)
169 #
170 EXTRA_DIST += tests/test_cpp.cc tests/trace_test.c \
171     tests/leak_test.c tests/thread_leak_test.c
172
173 # cord package
174 #
175 EXTRA_DIST += cord/cordbscs.c cord/cordtest.c cord/de.c cord/de_win.c \
176     cord/de_win.ICO cord/cordprnt.c cord/cordxtra.c cord/de_cmds.h \
177     cord/de_win.h cord/de_win.RC
178
179 # this is an auxiliary shell file used by Makefile and Makefile.direct
180 #
181 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
182
183 # :FIXME: why do we distribute this one???
184 #
185 EXTRA_DIST += libtool.m4
186
187 #
188 # :GOTCHA: GNU make rule for making .s out of .S is flawed, 
189 # it will not remove dest if building fails
190 .S.s:
191         if $(CPP) $< >$@ ; then :; else rm -f $@; fi