Add support for the internal boehm-gc on OpenBSD
[mono.git] / libgc / 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
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
21 AUTOMAKE_OPTIONS = foreign
22
23 SUBDIRS = include doc
24
25 INCLUDES = -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
32 noinst_LTLIBRARIES = libmonogc.la libmonogc-static.la
33
34 EXTRA_DIST = 
35     ## more items will be succesively added below
36
37 if POWERPC_DARWIN
38 asm_libgc_sources = powerpc_darwin_mach_dep.s
39 else
40 asm_libgc_sources = 
41 endif
42
43 libmonogc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
44 dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c \
45 malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
46 obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
47 solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \
48 backgraph.c win32_threads.c \
49 pthread_support.c pthread_stop_world.c darwin_stop_world.c \
50 openbsd_stop_world.c mach_dep.c $(asm_libgc_sources)
51
52 # Include THREADDLLIBS here to ensure that the correct versions of
53 # linuxthread semaphore functions get linked:
54 libmonogc_la_LIBADD = $(THREADDLLIBS) $(UNWINDLIBS)
55 libmonogc_la_DEPENDENCIES =
56 libmonogc_la_LDFLAGS = -version-info 1:2:0
57
58 EXTRA_libmonogc_la_SOURCES = alpha_mach_dep.S \
59     mips_sgi_mach_dep.s mips_ultrix_mach_dep.s powerpc_darwin_mach_dep.s \
60     rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
61     sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
62
63 libmonogc_static_la_SOURCES = $(libmonogc_la_SOURCES)
64 libmonogc_static_la_LIBADD = $(libmonogc_la_LIBADD)
65 libmonogc_static_la_LDFLAGS = -static
66
67 EXTRA_DIST += alpha_mach_dep.S mips_sgi_mach_dep.s sparc_mach_dep.S
68
69 AM_CFLAGS = @GC_CFLAGS@
70
71 if CPLUSPLUS
72 extra_checks = test_cpp
73 else
74 extra_checks = 
75 endif
76
77 #check_PROGRAMS = gctest $(extra_checks)
78
79 #test.o:        $(srcdir)/tests/test.c
80 #       $(COMPILE) -c $(srcdir)/tests/test.c
81 #       Using $< in the above seems to fail with the HP/UX on Itanium make.
82 #test_cpp.o:    $(srcdir)/tests/test_cpp.cc
83 #       $(CXXCOMPILE) -c $(srcdir)/tests/test_cpp.cc
84
85 ## FIXME: this is probably the reason why some files from BUILT_SOURCES
86 ##     are included in the distribution
87 # gctest_OBJECTS = test.o
88 #gctest_SOURCES = tests/test.c
89 #gctest_LDADD = ./libgc.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
90 #test_cpp_SOURCES = tests/test_cpp.cc
91 #test_cpp_LDADD = ./libgc.la ./libgccpp.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
92
93 #TESTS = gctest $(extra_checks)
94
95 ## FIXME: relies on internal code generated by automake.
96 all_objs = $(libgc_la_OBJECTS)
97 $(all_objs) : include/private/gcconfig.h include/private/gc_priv.h \
98 include/private/gc_hdrs.h include/gc.h include/gc_gcj.h include/gc_mark.h
99
100 ## FIXME: we shouldn't have to do this, but automake forces us to.
101 if COMPILER_XLC
102   ## XLC neither requires nor tolerates the unnecessary assembler goop
103   ASM_CPP_OPTIONS =
104 else
105   ## We use -Wp,-P to strip #line directives.  Irix `as' chokes on
106   ## these.
107   ASM_CPP_OPTIONS = -Wp,-P -x assembler-with-cpp
108 endif
109 .s.lo:
110 ## We use -Wp,-P to strip #line directives.  Irix `as' chokes on
111 ## these.
112         $(LTCOMPILE) $(ASM_CPP_OPTIONS) -c $<
113
114 ## We have our own definition of LTCOMPILE because we want to use our
115 ## CFLAGS, not those passed in from the top level make.
116 LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(INCLUDES) \
117         -I$(top_srcdir)/include $(AM_CPPFLAGS) $(CPPFLAGS) \
118         $(AM_CFLAGS) $(MY_CFLAGS) $(GC_CFLAGS) 
119 LINK = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(MY_CFLAGS) $(LDFLAGS) -o $@
120
121 # Work around what appears to be a GNU make bug handling MAKEFLAGS
122 # values defined in terms of make variables, as is the case for CC and
123 # friends when we are called from the top level Makefile.
124 AM_MAKEFLAGS = \
125         "AR_FLAGS=$(AR_FLAGS)" \
126         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
127         "CFLAGS=$(CFLAGS)" \
128         "CXXFLAGS=$(CXXFLAGS)" \
129         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
130         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
131         "INSTALL=$(INSTALL)" \
132         "INSTALL_DATA=$(INSTALL_DATA)" \
133         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
134         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
135         "LDFLAGS=$(LDFLAGS)" \
136         "LIBCFLAGS=$(LIBCFLAGS)" \
137         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
138         "MAKE=$(MAKE)" \
139         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
140         "PICFLAG=$(PICFLAG)" \
141         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
142         "SHELL=$(SHELL)" \
143         "EXPECT=$(EXPECT)" \
144         "RUNTEST=$(RUNTEST)" \
145         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
146         "exec_prefix=$(exec_prefix)" \
147         "infodir=$(infodir)" \
148         "libdir=$(libdir)" \
149         "prefix=$(prefix)" \
150         "tooldir=$(tooldir)" \
151         "AR=$(AR)" \
152         "AS=$(AS)" \
153         "CC=$(CC)" \
154         "CXX=$(CXX)" \
155         "LD=$(LD)" \
156         "LIBCFLAGS=$(LIBCFLAGS)" \
157         "NM=$(NM)" \
158         "PICFLAG=$(PICFLAG)" \
159         "RANLIB=$(RANLIB)" \
160         "DESTDIR=$(DESTDIR)"
161
162 MAKEOVERRIDES=
163
164 # files used by makefiles other than Makefile.am
165 #
166 EXTRA_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
167
168 # cord package
169 #
170 EXTRA_DIST += 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
171
172 # this is an auxiliary shell file used by Makefile and Makefile.direct
173 #
174 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
175
176 # :FIXME: why do we distribute this one???
177 #
178 EXTRA_DIST += configure.host
179
180 #
181 # :GOTCHA: GNU make rule for making .s out of .S is flawed, 
182 # it will not remove dest if building fails
183 .S.s:
184         if $(CPP) $< >$@ ; then :; else rm -f $@; fi