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