OSDN Git Service

* config/c4x/c4x.c (c4x_emit_move_sequence): Use loadqi_big_constant
[pf3gnuchains/gcc-fork.git] / boehm-gc / Makefile.orig
1 # Primary targets:
2 # gc.a - builds basic library
3 # libgc.a - builds library for use with g++ "-fgc-keyword" extension
4 # c++ - adds C++ interface to library
5 # cords - adds cords (heavyweight strings) to library
6 # test - prints porting information, then builds basic version of gc.a,
7 #        and runs some tests of collector and cords.  Does not add cords or
8 #        c++ interface to gc.a
9 # cord/de - builds dumb editor based on cords.
10 ABI_FLAG= 
11 CC=cc $(ABI_FLAG)
12 HOSTCC=$(CC)
13 CXX=g++ $(ABI_FLAG)
14 AS=as $(ABI_FLAG)
15 #  The above doesn't work with gas, which doesn't run cpp.
16 #  Define AS as `gcc -c -x assembler-with-cpp' instead.
17 #  Under Irix 6, you will have to specify the ABI (-o32, -n32, or -64)
18 #  if you use something other than the default ABI on your machine.
19
20 CFLAGS= -O -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DNO_EXECUTE_PERMISSION -DALL_INTERIOR_POINTERS -DSILENT
21
22 # For dynamic library builds, it may be necessary to add flags to generate
23 # PIC code, e.g. -fPIC on Linux.
24
25 # Setjmp_test may yield overly optimistic results when compiled
26 # without optimization.
27 # -DSILENT disables statistics printing, and improves performance.
28 # -DFIND_LEAK causes GC_find_leak to be initially set.
29 #   This causes the collector to assume that all inaccessible
30 #   objects should have been explicitly deallocated, and reports exceptions.
31 #   Finalization and the test program are not usable in this mode.
32 # -DSOLARIS_THREADS enables support for Solaris (thr_) threads.
33 #   (Clients should also define SOLARIS_THREADS and then include
34 #   gc.h before performing thr_ or dl* or GC_ operations.)
35 #   Must also define -D_REENTRANT.
36 # -D_SOLARIS_PTHREADS enables support for Solaris pthreads.
37 #   Define SOLARIS_THREADS as well.
38 # -DIRIX_THREADS enables support for Irix pthreads.  See README.irix.
39 # -DHPUX_THREADS enables support for HP/UX 11 pthreads.
40 #  Also requires -D_REENTRANT. See README.hp.
41 # -DLINUX_THREADS enables support for Xavier Leroy's Linux threads.
42 #   see README.linux.  -D_REENTRANT may also be required.
43 # -DALL_INTERIOR_POINTERS allows all pointers to the interior
44 #   of objects to be recognized.  (See gc_priv.h for consequences.)
45 # -DSMALL_CONFIG tries to tune the collector for small heap sizes,
46 #   usually causing it to use less space in such situations.
47 #   Incremental collection no longer works in this case.
48 # -DLARGE_CONFIG tunes the collector for unusually large heaps.
49 #   Necessary for heaps larger than about 500 MB on most machines.
50 #   Recommended for heaps larger than about 64 MB.
51 # -DDONT_ADD_BYTE_AT_END is meaningful only with
52 #   -DALL_INTERIOR_POINTERS.  Normally -DALL_INTERIOR_POINTERS
53 #   causes all objects to be padded so that pointers just past the end of
54 #   an object can be recognized.  This can be expensive.  (The padding
55 #   is normally more than one byte due to alignment constraints.)
56 #   -DDONT_ADD_BYTE_AT_END disables the padding.
57 # -DNO_SIGNALS does not disable signals during critical parts of
58 #   the GC process.  This is no less correct than many malloc 
59 #   implementations, and it sometimes has a significant performance
60 #   impact.  However, it is dangerous for many not-quite-ANSI C
61 #   programs that call things like printf in asynchronous signal handlers.
62 #   This is on by default.  Turning it off has not been extensively tested with
63 #   compilers that reorder stores.  It should have been.
64 # -DNO_EXECUTE_PERMISSION may cause some or all of the heap to not
65 #   have execute permission, i.e. it may be impossible to execute
66 #   code from the heap.  Currently this only affects the incremental
67 #   collector on UNIX machines.  It may greatly improve its performance,
68 #   since this may avoid some expensive cache synchronization.
69 # -DOPERATOR_NEW_ARRAY declares that the C++ compiler supports the
70 #   new syntax "operator new[]" for allocating and deleting arrays.
71 #   See gc_cpp.h for details.  No effect on the C part of the collector.
72 #   This is defined implicitly in a few environments.
73 # -DREDIRECT_MALLOC=X causes malloc, realloc, and free to be defined
74 #   as aliases for X, GC_realloc, and GC_free, respectively.
75 #   Calloc is redefined in terms of the new malloc.  X should
76 #   be either GC_malloc or GC_malloc_uncollectable.
77 #   The former is occasionally useful for working around leaks in code
78 #   you don't want to (or can't) look at.  It may not work for
79 #   existing code, but it often does.  Neither works on all platforms,
80 #   since some ports use malloc or calloc to obtain system memory.
81 #   (Probably works for UNIX, and win32.)
82 # -DIGNORE_FREE turns calls to free into a noop.  Only useful with
83 #   -DREDIRECT_MALLOC.
84 # -DNO_DEBUGGING removes GC_dump and the debugging routines it calls.
85 #   Reduces code size slightly at the expense of debuggability.
86 # -DJAVA_FINALIZATION makes it somewhat safer to finalize objects out of
87 #   order by specifying a nonstandard finalization mark procedure  (see
88 #   finalize.c).  Objects reachable from finalizable objects will be marked
89 #   in a sepearte postpass, and hence their memory won't be reclaimed.
90 #   Not recommended unless you are implementing a language that specifies
91 #   these semantics.  Since 5.0, determines only only the initial value
92 #   of GC_java_finalization variable.
93 # -DFINALIZE_ON_DEMAND causes finalizers to be run only in response
94 #   to explicit GC_invoke_finalizers() calls.
95 #   In 5.0 this became runtime adjustable, and this only determines the
96 #   initial value of GC_finalize_on_demand.
97 # -DATOMIC_UNCOLLECTABLE includes code for GC_malloc_atomic_uncollectable.
98 #   This is useful if either the vendor malloc implementation is poor,
99 #   or if REDIRECT_MALLOC is used.
100 # -DHBLKSIZE=ddd, where ddd is a power of 2 between 512 and 16384, explicitly
101 #   sets the heap block size.  Each heap block is devoted to a single size and
102 #   kind of object.  For the incremental collector it makes sense to match
103 #   the most likely page size.  Otherwise large values result in more
104 #   fragmentation, but generally better performance for large heaps.
105 # -DUSE_MMAP use MMAP instead of sbrk to get new memory.
106 #   Works for Solaris and Irix.
107 # -DUSE_MUNMAP causes memory to be returned to the OS under the right
108 #   circumstances.  This currently disables VM-based incremental collection.
109 #   This is currently experimental, and works only under some Unix and
110 #   Linux versions.
111 # -DMMAP_STACKS (for Solaris threads) Use mmap from /dev/zero rather than
112 #   GC_scratch_alloc() to get stack memory.
113 # -DPRINT_BLACK_LIST Whenever a black list entry is added, i.e. whenever
114 #   the garbage collector detects a value that looks almost, but not quite,
115 #   like a pointer, print both the address containing the value, and the
116 #   value of the near-bogus-pointer.  Can be used to identifiy regions of
117 #   memory that are likely to contribute misidentified pointers.
118 # -DKEEP_BACK_PTRS Add code to save back pointers in debugging headers
119 #   for objects allocated with the debugging allocator.  If all objects
120 #   through GC_MALLOC with GC_DEBUG defined, this allows the client
121 #   to determine how particular or randomly chosen objects are reachable
122 #   for debugging/profiling purposes.  The backptr.h interface is
123 #   implemented only if this is defined.
124 # -DGC_ASSERTIONS Enable some internal GC assertion checking.  Currently
125 #   this facility is only used in a few places.  It is intended primarily
126 #   for debugging of the garbage collector itself, but could also
127 #   occasionally be useful for debugging of client code.  Slows down the
128 #   collector somewhat, but not drastically.
129 # -DCHECKSUMS reports on erroneously clear dirty bits, and unexpectedly
130 #   altered stubborn objects, at substantial performance cost.
131 #   Use only for debugging of the incremental collector.
132 # -DGC_GCJ_SUPPORT includes support for gcj (and possibly other systems
133 #   that include a pointer to a type descriptor in each allocated object).
134 #   Building this way requires an ANSI C compiler.
135 # -DUSE_I686_PREFETCH causes the collector to issue Pentium III style
136 #   prefetch instructions.  No effect except on X86 Linux platforms.
137 #   Assumes a very recent gcc-compatible compiler and assembler.
138 #   (Gas prefetcht0 support was added around May 1999.)
139 #   Empirically the code appears to still run correctly on Pentium II
140 #   processors, though with no performance benefit.  May not run on other
141 #   X86 processors?  In some cases this improves performance by
142 #   15% or so.
143 # -DUSE_3DNOW_PREFETCH causes the collector to issue AMD 3DNow style
144 #   prefetch instructions.  Same restrictions as USE_I686_PREFETCH.
145 #   UNTESTED!!
146 # -DUSE_LD_WRAP in combination with the gld flags listed in README.linux
147 #   causes the collector some system and pthread calls in a more transparent
148 #   fashion than the usual macro-based approach.  Requires GNU ld, and
149 #   currently probably works only with Linux.
150 #
151
152
153 LIBGC_CFLAGS= -O -DNO_SIGNALS -DSILENT \
154     -DREDIRECT_MALLOC=GC_malloc_uncollectable \
155     -DDONT_ADD_BYTE_AT_END -DALL_INTERIOR_POINTERS
156 #   Flags for building libgc.a -- the last two are required.
157
158 CXXFLAGS= $(CFLAGS) 
159 AR= ar
160 RANLIB= ranlib
161
162
163 # Redefining srcdir allows object code for the nonPCR version of the collector
164 # to be generated in different directories.  In this case, the destination directory
165 # should contain a copy of the original include directory.
166 srcdir = .
167 VPATH = $(srcdir)
168
169 OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o dbg_mlc.o malloc.o stubborn.o checksums.o solaris_threads.o hpux_irix_threads.o linux_threads.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o gcj_mlc.o
170
171 CSRCS= reclaim.c allchblk.c misc.c alloc.c mach_dep.c os_dep.c mark_rts.c headers.c mark.c obj_map.c pcr_interface.c blacklst.c finalize.c new_hblk.c real_malloc.c dyn_load.c dbg_mlc.c malloc.c stubborn.c checksums.c solaris_threads.c hpux_irix_threads.c linux_threads.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c
172
173 CORD_SRCS=  cord/cordbscs.c cord/cordxtra.c cord/cordprnt.c cord/de.c cord/cordtest.c cord/cord.h cord/ec.h cord/private/cord_pos.h cord/de_win.c cord/de_win.h cord/de_cmds.h cord/de_win.ICO cord/de_win.RC cord/SCOPTIONS.amiga cord/SMakefile.amiga
174
175 CORD_OBJS=  cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o
176
177 SRCS= $(CSRCS) mips_sgi_mach_dep.s rs6000_mach_dep.s alpha_mach_dep.s \
178     sparc_mach_dep.s gc.h gc_typed.h gc_hdrs.h gc_priv.h gc_private.h \
179     gcconfig.h gc_mark.h include/gc_inl.h include/gc_inline.h gc.man \
180     threadlibs.c if_mach.c if_not_there.c gc_cpp.cc gc_cpp.h weakpointer.h \
181     gcc_support.c mips_ultrix_mach_dep.s include/gc_alloc.h gc_alloc.h \
182     include/new_gc_alloc.h include/javaxfc.h sparc_sunos4_mach_dep.s \
183     solaris_threads.h backptr.h hpux_test_and_clear.s include/gc_gcj.h \
184     dbg_mlc.h $(CORD_SRCS)
185
186 OTHER_FILES= Makefile PCR-Makefile OS2_MAKEFILE NT_MAKEFILE BCC_MAKEFILE \
187            README test.c test_cpp.cc setjmp_t.c SMakefile.amiga \
188            SCoptions.amiga README.amiga README.win32 cord/README \
189            cord/gc.h include/gc.h include/gc_typed.h include/cord.h \
190            include/ec.h include/private/cord_pos.h include/private/gcconfig.h \
191            include/private/gc_hdrs.h include/private/gc_priv.h \
192            include/gc_cpp.h README.rs6000 include/backptr.h \
193            include/weakpointer.h README.QUICK callprocs pc_excludes \
194            barrett_diagram README.OS2 README.Mac MacProjects.sit.hqx \
195            MacOS.c EMX_MAKEFILE makefile.depend README.debugging \
196            include/gc_cpp.h Mac_files/datastart.c Mac_files/dataend.c \
197            Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h \
198            add_gc_prefix.c README.solaris2 README.sgi README.hp README.uts \
199            win32_threads.c NT_THREADS_MAKEFILE gc.mak README.dj Makefile.dj \
200            README.alpha README.linux version.h Makefile.DLLs \
201            WCC_MAKEFILE nursery.c include/gc_nursery.h include/gc_copy_descr.h \
202            include/leak_detector.h
203
204 CORD_INCLUDE_FILES= $(srcdir)/gc.h $(srcdir)/cord/cord.h $(srcdir)/cord/ec.h \
205            $(srcdir)/cord/private/cord_pos.h
206
207 UTILS= if_mach if_not_there threadlibs
208
209 # Libraries needed for curses applications.  Only needed for de.
210 CURSES= -lcurses -ltermlib
211
212 # The following is irrelevant on most systems.  But a few
213 # versions of make otherwise fork the shell specified in
214 # the SHELL environment variable.
215 SHELL= /bin/sh
216
217 SPECIALCFLAGS = 
218 # Alternative flags to the C compiler for mach_dep.c.
219 # Mach_dep.c often doesn't like optimization, and it's
220 # not time-critical anyway.
221 # Set SPECIALCFLAGS to -q nodirect_code on Encore.
222
223 all: gc.a gctest
224
225 pcr: PCR-Makefile gc_private.h gc_hdrs.h gc.h gcconfig.h mach_dep.o $(SRCS)
226         make -f PCR-Makefile depend
227         make -f PCR-Makefile
228
229 $(OBJS) test.o dyn_load.o dyn_load_sunos53.o: $(srcdir)/gc_priv.h $(srcdir)/gc_hdrs.h $(srcdir)/gc.h \
230     $(srcdir)/gcconfig.h $(srcdir)/gc_typed.h Makefile
231 # The dependency on Makefile is needed.  Changing
232 # options such as -DSILENT affects the size of GC_arrays,
233 # invalidating all .o files that rely on gc_priv.h
234
235 mark.o typd_mlc.o finalize.o: $(srcdir)/gc_mark.h
236
237 base_lib gc.a: $(OBJS) dyn_load.o $(UTILS)
238         echo > base_lib
239         rm -f dont_ar_1
240         ./if_mach SPARC SUNOS5 touch dont_ar_1
241         ./if_mach SPARC SUNOS5 $(AR) rus gc.a $(OBJS) dyn_load.o
242         ./if_mach M68K AMIGA touch dont_ar_1
243         ./if_mach M68K AMIGA $(AR) -vrus gc.a $(OBJS) dyn_load.o
244         ./if_not_there dont_ar_1 $(AR) ru gc.a $(OBJS) dyn_load.o
245         ./if_not_there dont_ar_1 $(RANLIB) gc.a || cat /dev/null
246 #       ignore ranlib failure; that usually means it doesn't exist, and isn't needed
247
248 cords: $(CORD_OBJS) cord/cordtest $(UTILS)
249         rm -f dont_ar_3
250         ./if_mach SPARC SUNOS5 touch dont_ar_3
251         ./if_mach SPARC SUNOS5 $(AR) rus gc.a $(CORD_OBJS)
252         ./if_mach M68K AMIGA touch dont_ar_3
253         ./if_mach M68K AMIGA $(AR) -vrus gc.a $(CORD_OBJS)
254         ./if_not_there dont_ar_3 $(AR) ru gc.a $(CORD_OBJS)
255         ./if_not_there dont_ar_3 $(RANLIB) gc.a || cat /dev/null
256
257 gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/gc_cpp.h $(srcdir)/gc.h Makefile
258         $(CXX) -c $(CXXFLAGS) $(srcdir)/gc_cpp.cc
259
260 test_cpp: $(srcdir)/test_cpp.cc $(srcdir)/gc_cpp.h gc_cpp.o $(srcdir)/gc.h \
261 base_lib $(UTILS)
262         rm -f test_cpp
263         ./if_mach HP_PA HPUX $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/test_cpp.cc gc_cpp.o gc.a -ldld `./threadlibs`
264         ./if_not_there test_cpp $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/test_cpp.cc gc_cpp.o gc.a `./threadlibs`
265
266 c++: gc_cpp.o $(srcdir)/gc_cpp.h test_cpp
267         rm -f dont_ar_4
268         ./if_mach SPARC SUNOS5 touch dont_ar_4
269         ./if_mach SPARC SUNOS5 $(AR) rus gc.a gc_cpp.o
270         ./if_mach M68K AMIGA touch dont_ar_4
271         ./if_mach M68K AMIGA $(AR) -vrus gc.a gc_cpp.o
272         ./if_not_there dont_ar_4 $(AR) ru gc.a gc_cpp.o
273         ./if_not_there dont_ar_4 $(RANLIB) gc.a || cat /dev/null
274         ./test_cpp 1
275         echo > c++
276
277 dyn_load_sunos53.o: dyn_load.c
278         $(CC) $(CFLAGS) -DSUNOS53_SHARED_LIB -c $(srcdir)/dyn_load.c -o $@
279
280 # SunOS5 shared library version of the collector
281 sunos5gc.so: $(OBJS) dyn_load_sunos53.o
282         $(CC) -G -o sunos5gc.so $(OBJS) dyn_load_sunos53.o -ldl
283         ln sunos5gc.so libgc.so
284
285 # Alpha/OSF shared library version of the collector
286 libalphagc.so: $(OBJS)
287         ld -shared -o libalphagc.so $(OBJS) dyn_load.o -lc
288         ln libalphagc.so libgc.so
289
290 # IRIX shared library version of the collector
291 libirixgc.so: $(OBJS) dyn_load.o
292         ld -shared $(ABI_FLAG) -o libirixgc.so $(OBJS) dyn_load.o -lc
293         ln libirixgc.so libgc.so
294
295 # Linux shared library version of the collector
296 liblinuxgc.so: $(OBJS) dyn_load.o
297         gcc -shared -o liblinuxgc.so $(OBJS) dyn_load.o -lo
298         ln liblinuxgc.so libgc.so
299
300 # Alternative Linux rule.  This is preferable, but is likely to break the
301 # Makefile for some non-linux platforms.
302 # LIBOBJS= $(patsubst %.o, %.lo, $(OBJS))
303 #
304 #.SUFFIXES: .lo $(SUFFIXES)
305 #
306 #.c.lo:
307 #       $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c $< -o $@
308 #
309 # liblinuxgc.so: $(LIBOBJS) dyn_load.lo
310 #       gcc -shared -Wl,-soname=libgc.so.0 -o libgc.so.0 $(LIBOBJS) dyn_load.lo
311 #       touch liblinuxgc.so
312
313 mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/mips_sgi_mach_dep.s $(srcdir)/mips_ultrix_mach_dep.s $(srcdir)/rs6000_mach_dep.s $(UTILS)
314         rm -f mach_dep.o
315         ./if_mach MIPS IRIX5 $(AS) -o mach_dep.o $(srcdir)/mips_sgi_mach_dep.s
316         ./if_mach MIPS RISCOS $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s
317         ./if_mach MIPS ULTRIX $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s
318         ./if_mach RS6000 "" $(AS) -o mach_dep.o $(srcdir)/rs6000_mach_dep.s
319 #       ./if_mach ALPHA "" $(AS) -o mach_dep.o $(srcdir)/alpha_mach_dep.s
320 #       alpha_mach_dep.s assumes that pointers are not saved in fp registers.
321 #       Gcc on a 21264 can spill pointers to fp registers.  Oops.
322         ./if_mach SPARC SUNOS5 $(AS) -o mach_dep.o $(srcdir)/sparc_mach_dep.s
323         ./if_mach SPARC SUNOS4 $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s
324         ./if_mach SPARC OPENBSD $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s
325         ./if_mach HP_PA HPUX $(AS) -o hpux_test_and_clear.o $(srcdir)/hpux_test_and_clear.s
326         ./if_mach HP_PA HPUX $(CC) -c -o md_tmp.o $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
327         ./if_mach HP_PA HPUX ld -r -o mach_dep.o md_tmp.o hpux_test_and_clear.o
328         ./if_not_there mach_dep.o $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
329
330 mark_rts.o: $(srcdir)/mark_rts.c $(UTILS)
331         rm -f mark_rts.o
332         -./if_mach ALPHA OSF1 $(CC) -c $(CFLAGS) -Wo,-notail $(srcdir)/mark_rts.c
333         ./if_not_there mark_rts.o $(CC) -c $(CFLAGS) $(srcdir)/mark_rts.c
334 #       Work-around for DEC optimizer tail recursion elimination bug.
335 #  The ALPHA-specific line should be removed if gcc is used.
336
337 alloc.o: version.h
338
339 cord/cordbscs.o: $(srcdir)/cord/cordbscs.c $(CORD_INCLUDE_FILES)
340         $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordbscs.c
341         mv cordbscs.o cord/cordbscs.o
342 #  not all compilers understand -o filename
343
344 cord/cordxtra.o: $(srcdir)/cord/cordxtra.c $(CORD_INCLUDE_FILES)
345         $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordxtra.c
346         mv cordxtra.o cord/cordxtra.o
347
348 cord/cordprnt.o: $(srcdir)/cord/cordprnt.c $(CORD_INCLUDE_FILES)
349         $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordprnt.c
350         mv cordprnt.o cord/cordprnt.o
351
352 cord/cordtest: $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a $(UTILS)
353         rm -f cord/cordtest
354         ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a -lucb
355         ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a -ldld `./threadlibs`
356         ./if_not_there cord/cordtest $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a `./threadlibs`
357
358 cord/de: $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(UTILS)
359         rm -f cord/de
360         ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) -lucb `./threadlibs`
361         ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) -ldld `./threadlibs`
362         ./if_mach RS6000 "" $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses
363         ./if_mach I386 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs`
364         ./if_mach ALPHA LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs`
365         ./if_mach IA64 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs`
366         ./if_mach M68K AMIGA $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses
367         ./if_not_there cord/de $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) `./threadlibs`
368
369 if_mach: $(srcdir)/if_mach.c $(srcdir)/gcconfig.h
370         $(HOSTCC) $(CFLAGS) -o if_mach $(srcdir)/if_mach.c
371
372 threadlibs: $(srcdir)/threadlibs.c $(srcdir)/gcconfig.h Makefile
373         $(HOSTCC) $(CFLAGS) -o threadlibs $(srcdir)/threadlibs.c
374
375 if_not_there: $(srcdir)/if_not_there.c
376         $(HOSTCC) $(CFLAGS) -o if_not_there $(srcdir)/if_not_there.c
377
378 clean: 
379         rm -f gc.a *.o gctest gctest_dyn_link test_cpp \
380               setjmp_test  mon.out gmon.out a.out core if_not_there if_mach \
381               threadlibs $(CORD_OBJS) cord/cordtest cord/de
382         -rm -f *~
383
384 gctest: test.o gc.a $(UTILS)
385         rm -f gctest
386         ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o gctest  test.o gc.a -lucb
387         ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o gctest  test.o gc.a -ldld `./threadlibs`
388         ./if_not_there gctest $(CC) $(CFLAGS) -o gctest test.o gc.a `./threadlibs`
389
390 # If an optimized setjmp_test generates a segmentation fault,
391 # odds are your compiler is broken.  Gctest may still work.
392 # Try compiling setjmp_t.c unoptimized.
393 setjmp_test: $(srcdir)/setjmp_t.c $(srcdir)/gc.h $(UTILS)
394         $(CC) $(CFLAGS) -o setjmp_test $(srcdir)/setjmp_t.c
395
396 test:  KandRtest cord/cordtest
397         cord/cordtest
398
399 # Those tests that work even with a K&R C compiler:
400 KandRtest: setjmp_test gctest
401         ./setjmp_test
402         ./gctest
403
404 add_gc_prefix: add_gc_prefix.c
405         $(CC) -o add_gc_prefix $(srcdir)/add_gc_prefix.c
406
407 gc.tar: $(SRCS) $(OTHER_FILES) add_gc_prefix
408         ./add_gc_prefix $(SRCS) $(OTHER_FILES) > /tmp/gc.tar-files
409         tar cvfh gc.tar `cat /tmp/gc.tar-files`
410
411 pc_gc.tar: $(SRCS) $(OTHER_FILES)
412         tar cvfX pc_gc.tar pc_excludes $(SRCS) $(OTHER_FILES)
413
414 floppy: pc_gc.tar
415         -mmd a:/cord
416         -mmd a:/cord/private
417         -mmd a:/include
418         -mmd a:/include/private
419         mkdir /tmp/pc_gc
420         cat pc_gc.tar | (cd /tmp/pc_gc; tar xvf -)
421         -mcopy -tmn /tmp/pc_gc/* a:
422         -mcopy -tmn /tmp/pc_gc/cord/* a:/cord
423         -mcopy -mn /tmp/pc_gc/cord/de_win.ICO a:/cord
424         -mcopy -tmn /tmp/pc_gc/cord/private/* a:/cord/private
425         -mcopy -tmn /tmp/pc_gc/include/* a:/include
426         -mcopy -tmn /tmp/pc_gc/include/private/* a:/include/private
427         rm -r /tmp/pc_gc
428
429 gc.tar.Z: gc.tar
430         compress gc.tar
431
432 gc.tar.gz: gc.tar
433         gzip gc.tar
434
435 lint: $(CSRCS) test.c
436         lint -DLINT $(CSRCS) test.c | egrep -v "possible pointer alignment problem|abort|exit|sbrk|mprotect|syscall|change in ANSI|improper alignment"
437
438 # BTL: added to test shared library version of collector.
439 # Currently works only under SunOS5.  Requires GC_INIT call from statically
440 # loaded client code.
441 ABSDIR = `pwd`
442 gctest_dyn_link: test.o libgc.so
443         $(CC) -L$(ABSDIR) -R$(ABSDIR) -o gctest_dyn_link test.o -lgc -ldl -lthread
444
445 gctest_irix_dyn_link: test.o libirixgc.so
446         $(CC) -L$(ABSDIR) -o gctest_irix_dyn_link test.o -lirixgc
447
448 test_dll.o: test.c libgc_globals.h
449         $(CC) $(CFLAGS) -DGC_USE_DLL -c test.c -o test_dll.o
450
451 test_dll: test_dll.o libgc_dll.a libgc.dll
452         $(CC) test_dll.o -L$(ABSDIR) -lgc_dll -o test_dll
453
454 SYM_PREFIX-libgc=GC
455
456 # Uncomment the following line to build a GNU win32 DLL
457 # include Makefile.DLLs
458
459 reserved_namespace: $(SRCS)
460         for file in $(SRCS) test.c test_cpp.cc; do \
461                 sed s/GC_/_GC_/g < $$file > tmp; \
462                 cp tmp $$file; \
463                 done
464
465 user_namespace: $(SRCS)
466         for file in $(SRCS) test.c test_cpp.cc; do \
467                 sed s/_GC_/GC_/g < $$file > tmp; \
468                 cp tmp $$file; \
469                 done