Initial revision
[fw/sdcc] / support / gc / Makefile.in
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 CXX             = @CXX@ $(ABI_FLAG)
13 AS              = @AS@ $(ABI_FLAG)
14 PRJDIR          = ../..
15 srcdir          = @srcdir@
16 #  The above doesn't work with gas, which doesn't run cpp.
17 #  Define AS as `gcc -c -x assembler-with-cpp' instead.
18 #  Under Irix 6, you will have to specify the ABI for as if you specify
19 #  it for the C compiler.
20
21 CFLAGS= -O2 -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DALL_INTERIOR_POINTERS -DNO_EXECUTE_PERMISSION -DSILENT -I /usr/local/include
22
23 # For dynamic library builds, it may be necessary to add flags to generate
24 # PIC code, e.g. -fPIC on Linux.
25
26 # Setjmp_test may yield overly optimistic results when compiled
27 # without optimization.
28 # -DSILENT disables statistics printing, and improves performance.
29 # -DCHECKSUMS reports on erroneously clear dirty bits, and unexpectedly
30 #   altered stubborn objects, at substantial performance cost.
31 #   Use only for incremental collector debugging.
32 # -DFIND_LEAK causes the collector to assume that all inaccessible
33 #   objects should have been explicitly deallocated, and reports exceptions.
34 #   Finalization and the test program are not usable in this mode.
35 # -DSOLARIS_THREADS enables support for Solaris (thr_) threads.
36 #   (Clients should also define SOLARIS_THREADS and then include
37 #   gc.h before performing thr_ or dl* or GC_ operations.)
38 #   Must also define -D_REENTRANT.
39 # -D_SOLARIS_PTHREADS enables support for Solaris pthreads.
40 #   Define SOLARIS_THREADS as well.
41 # -DIRIX_THREADS enables support for Irix pthreads.  See README.irix.
42 # _DLINUX_THREADS enables support for Xavier Leroy's Linux threads.
43 #   see README.linux.  -D_REENTRANT may also be required.
44 # -DALL_INTERIOR_POINTERS allows all pointers to the interior
45 #   of objects to be recognized.  (See gc_priv.h for consequences.)
46 # -DSMALL_CONFIG tries to tune the collector for small heap sizes,
47 #   usually causing it to use less space in such situations.
48 #   Incremental collection no longer works in this case.
49 # -DLARGE_CONFIG tunes the collector for unusually large heaps.
50 #   Necessary for heaps larger than about 500 MB on most machines.
51 #   Recommended for heaps larger than about 64 MB.
52 # -DDONT_ADD_BYTE_AT_END is meaningful only with
53 #   -DALL_INTERIOR_POINTERS.  Normally -DALL_INTERIOR_POINTERS
54 #   causes all objects to be padded so that pointers just past the end of
55 #   an object can be recognized.  This can be expensive.  (The padding
56 #   is normally more than one byte due to alignment constraints.)
57 #   -DDONT_ADD_BYTE_AT_END disables the padding.
58 # -DNO_SIGNALS does not disable signals during critical parts of
59 #   the GC process.  This is no less correct than many malloc 
60 #   implementations, and it sometimes has a significant performance
61 #   impact.  However, it is dangerous for many not-quite-ANSI C
62 #   programs that call things like printf in asynchronous signal handlers.
63 # -DNO_EXECUTE_PERMISSION may cause some or all of the heap to not
64 #   have execute permission, i.e. it may be impossible to execute
65 #   code from the heap.  Currently this only affects the incremental
66 #   collector on UNIX machines.  It may greatly improve its performance,
67 #   since this may avoid some expensive cache synchronization.
68 # -DOPERATOR_NEW_ARRAY declares that the C++ compiler supports the
69 #   new syntax "operator new[]" for allocating and deleting arrays.
70 #   See gc_cpp.h for details.  No effect on the C part of the collector.
71 #   This is defined implicitly in a few environments.
72 # -DREDIRECT_MALLOC=X causes malloc, realloc, and free to be defined
73 #   as aliases for X, GC_realloc, and GC_free, respectively.
74 #   Calloc is redefined in terms of the new malloc.  X should
75 #   be either GC_malloc or GC_malloc_uncollectable.
76 #   The former is occasionally useful for working around leaks in code
77 #   you don't want to (or can't) look at.  It may not work for
78 #   existing code, but it often does.  Neither works on all platforms,
79 #   since some ports use malloc or calloc to obtain system memory.
80 #   (Probably works for UNIX, and win32.)
81 # -DIGNORE_FREE turns calls to free into a noop.  Only useful with
82 #   -DREDIRECT_MALLOC.
83 # -DNO_DEBUGGING removes GC_dump and the debugging routines it calls.
84 #   Reduces code size slightly at the expense of debuggability.
85 # -DJAVA_FINALIZATION makes it somewhat safer to finalize objects out of
86 #   order by specifying a nonstandard finalization mark procedure  (see
87 #   finalize.c).  Objects reachable from finalizable objects will be marked
88 #   in a sepearte postpass, and hence their memory won't be reclaimed.
89 #   Not recommended unless you are implementing a language that specifies
90 #   these semantics.
91 # -DFINALIZE_ON_DEMAND causes finalizers to be run only in response
92 #   to explicit GC_invoke_finalizers() calls.
93 # -DATOMIC_UNCOLLECTABLE includes code for GC_malloc_atomic_uncollectable.
94 #   This is useful if either the vendor malloc implementation is poor,
95 #   or if REDIRECT_MALLOC is used.
96 # -DHBLKSIZE=ddd, where ddd is a power of 2 between 512 and 16384, explicitly
97 #   sets the heap block size.  Each heap block is devoted to a single size and
98 #   kind of object.  For the incremental collector it makes sense to match
99 #   the most likely page size.  Otherwise large values result in more
100 #   fragmentation, but generally better performance for large heaps.
101 # -DUSE_MMAP use MMAP instead of sbrk to get new memory.
102 #   Works for Solaris and Irix.
103 # -DMMAP_STACKS (for Solaris threads) Use mmap from /dev/zero rather than
104 #   GC_scratch_alloc() to get stack memory.
105 # -DPRINT_BLACK_LIST Whenever a black list entry is added, i.e. whenever
106 #   the garbage collector detects a value that looks almost, but not quite,
107 #   like a pointer, print both the address containing the value, and the
108 #   value of the near-bogus-pointer.  Can be used to identifiy regions of
109 #   memory that are likely to contribute misidentified pointers.
110 # -DOLD_BLOCK_ALLOC Use the old, possibly faster, large block
111 #   allocation strategy.  The new strategy tries harder to minimize
112 #   fragmentation, sometimes at the expense of spending more time in the
113 #   large block allocator and/or collecting more frequently.
114 #   If you expect the allocator to promtly use an explicitly expanded
115 #   heap, this is highly recommended.
116 #
117
118
119
120 LIBGC_CFLAGS= -O -DNO_SIGNALS -DSILENT \
121     -DREDIRECT_MALLOC=GC_malloc_uncollectable \
122     -DDONT_ADD_BYTE_AT_END -DALL_INTERIOR_POINTERS
123 #   Flags for building libgc.a -- the last two are required.
124
125 CXXFLAGS= $(CFLAGS) 
126 AR= ar
127 RANLIB= ranlib
128
129
130 # Redefining srcdir allows object code for the nonPCR version of the collector
131 # to be generated in different directories.  In this case, the destination directory
132 # should contain a copy of the original include directory.
133 srcdir = .
134 VPATH = $(srcdir)
135
136 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 irix_threads.o linux_threads.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o
137
138 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 irix_threads.c linux_threads.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c
139
140 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
141
142 CORD_OBJS=  cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o
143
144 SRCS= $(CSRCS) mips_sgi_mach_dep.s rs6000_mach_dep.s alpha_mach_dep.s \
145     sparc_mach_dep.s gc.h gc_typed.h gc_hdrs.h gc_priv.h gc_private.h \
146     gcconfig.h gc_mark.h include/gc_inl.h include/gc_inline.h gc.man \
147     threadlibs.c if_mach.c if_not_there.c gc_cpp.cc gc_cpp.h weakpointer.h \
148     gcc_support.c mips_ultrix_mach_dep.s include/gc_alloc.h gc_alloc.h \
149     include/new_gc_alloc.h include/javaxfc.h sparc_sunos4_mach_dep.s \
150     solaris_threads.h $(CORD_SRCS)
151
152 OTHER_FILES= Makefile PCR-Makefile OS2_MAKEFILE NT_MAKEFILE BCC_MAKEFILE \
153            README test.c test_cpp.cc setjmp_t.c SMakefile.amiga \
154            SCoptions.amiga README.amiga README.win32 cord/README \
155            cord/gc.h include/gc.h include/gc_typed.h include/cord.h \
156            include/ec.h include/private/cord_pos.h include/private/gcconfig.h \
157            include/private/gc_hdrs.h include/private/gc_priv.h \
158            include/gc_cpp.h README.rs6000 \
159            include/weakpointer.h README.QUICK callprocs pc_excludes \
160            barrett_diagram README.OS2 README.Mac MacProjects.sit.hqx \
161            MacOS.c EMX_MAKEFILE makefile.depend README.debugging \
162            include/gc_cpp.h Mac_files/datastart.c Mac_files/dataend.c \
163            Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h \
164            add_gc_prefix.c README.solaris2 README.sgi README.hp README.uts \
165            win32_threads.c NT_THREADS_MAKEFILE gc.mak README.dj Makefile.dj \
166            README.alpha README.linux version.h Makefile.DLLs gc_watcom.asm \
167            WCC_MAKEFILE
168
169 CORD_INCLUDE_FILES= $(srcdir)/gc.h $(srcdir)/cord/cord.h $(srcdir)/cord/ec.h \
170            $(srcdir)/cord/private/cord_pos.h
171
172 UTILS= if_mach if_not_there threadlibs
173
174 # Libraries needed for curses applications.  Only needed for de.
175 CURSES= -lcurses -ltermlib
176
177 # The following is irrelevant on most systems.  But a few
178 # versions of make otherwise fork the shell specified in
179 # the SHELL environment variable.
180 SHELL= /bin/sh
181
182 SPECIALCFLAGS = 
183 # Alternative flags to the C compiler for mach_dep.c.
184 # Mach_dep.c often doesn't like optimization, and it's
185 # not time-critical anyway.
186 # Set SPECIALCFLAGS to -q nodirect_code on Encore.
187
188 #all: checkconf libgc.a gctest
189 all: checkconf libgc.a
190
191 pcr: PCR-Makefile gc_private.h gc_hdrs.h gc.h gcconfig.h mach_dep.o $(SRCS)
192         make -f PCR-Makefile depend
193         make -f PCR-Makefile
194
195 $(OBJS) test.o dyn_load.o dyn_load_sunos53.o: $(srcdir)/gc_priv.h $(srcdir)/gc_hdrs.h $(srcdir)/gc.h \
196     $(srcdir)/gcconfig.h $(srcdir)/gc_typed.h Makefile
197 # The dependency on Makefile is needed.  Changing
198 # options such as -DSILENT affects the size of GC_arrays,
199 # invalidating all .o files that rely on gc_priv.h
200
201 mark.o typd_mlc.o finalize.o: $(srcdir)/gc_mark.h
202
203 base_lib libgc.a: $(OBJS) dyn_load.o $(UTILS)
204         echo > base_lib
205         rm -f on_sparc_sunos5_1
206         ./if_mach SPARC SUNOS5 touch on_sparc_sunos5_1
207         ./if_mach SPARC SUNOS5 $(AR) rus libgc.a $(OBJS) dyn_load.o
208         ./if_not_there on_sparc_sunos5_1 $(AR) ru libgc.a $(OBJS) dyn_load.o
209         ./if_not_there on_sparc_sunos5_1 $(RANLIB) libgc.a || cat /dev/null
210 #       ignore ranlib failure; that usually means it doesn't exist, and isn't needed
211
212 cords: $(CORD_OBJS) cord/cordtest $(UTILS)
213         rm -f on_sparc_sunos5_3
214         ./if_mach SPARC SUNOS5 touch on_sparc_sunos5_3
215         ./if_mach SPARC SUNOS5 $(AR) rus libgc.a $(CORD_OBJS)
216         ./if_not_there on_sparc_sunos5_3 $(AR) ru libgc.a $(CORD_OBJS)
217         ./if_not_there on_sparc_sunos5_3 $(RANLIB) libgc.a || cat /dev/null
218
219 gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/gc_cpp.h $(srcdir)/gc.h Makefile
220         $(CXX) -c $(CXXFLAGS) $(srcdir)/gc_cpp.cc
221
222 test_cpp: $(srcdir)/test_cpp.cc $(srcdir)/gc_cpp.h gc_cpp.o $(srcdir)/gc.h \
223 base_lib $(UTILS)
224         rm -f test_cpp
225         ./if_mach HP_PA "" $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/test_cpp.cc gc_cpp.o libgc.a -ldld
226         ./if_not_there test_cpp $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/test_cpp.cc gc_cpp.o libgc.a `./threadlibs`
227
228 c++: gc_cpp.o $(srcdir)/gc_cpp.h test_cpp
229         rm -f on_sparc_sunos5_4
230         ./if_mach SPARC SUNOS5 touch on_sparc_sunos5_4
231         ./if_mach SPARC SUNOS5 $(AR) rus libgc.a gc_cpp.o
232         ./if_not_there on_sparc_sunos5_4 $(AR) ru libgc.a gc_cpp.o
233         ./if_not_there on_sparc_sunos5_4 $(RANLIB) libgc.a || cat /dev/null
234         ./test_cpp 1
235         echo > c++
236
237 dyn_load_sunos53.o: dyn_load.c
238         $(CC) $(CFLAGS) -DSUNOS53_SHARED_LIB -c $(srcdir)/dyn_load.c -o $@
239
240 # SunOS5 shared library version of the collector
241 sunos5gc.so: $(OBJS) dyn_load_sunos53.o
242         $(CC) -G -o sunos5gc.so $(OBJS) dyn_load_sunos53.o -ldl
243         ln sunos5gc.so libgc.so
244
245 # Alpha/OSF shared library version of the collector
246 libalphagc.so: $(OBJS)
247         ld -shared -o libalphagc.so $(OBJS) dyn_load.o -lc
248         ln libalphagc.so libgc.so
249
250 # IRIX shared library version of the collector
251 libirixgc.so: $(OBJS) dyn_load.o
252         ld -shared $(ABI_FLAG) -o libirixgc.so $(OBJS) dyn_load.o -lc
253         ln libirixgc.so libgc.so
254
255 # Linux shared library version of the collector
256 liblinuxgc.so: $(OBJS) dyn_load.o
257         gcc -shared -o liblinuxgc.so $(OBJS) dyn_load.o -lo
258         ln liblinuxgc.so libgc.so
259
260 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)
261         rm -f mach_dep.o
262         ./if_mach MIPS IRIX5 $(AS) -o mach_dep.o $(srcdir)/mips_sgi_mach_dep.s
263         ./if_mach MIPS RISCOS $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s
264         ./if_mach MIPS ULTRIX $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s
265         ./if_mach RS6000 "" $(AS) -o mach_dep.o $(srcdir)/rs6000_mach_dep.s
266         ./if_mach ALPHA "" $(AS) -o mach_dep.o $(srcdir)/alpha_mach_dep.s
267         ./if_mach SPARC SUNOS5 $(AS) -o mach_dep.o $(srcdir)/sparc_mach_dep.s
268         ./if_mach SPARC SUNOS4 $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s
269         ./if_not_there mach_dep.o $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
270
271 mark_rts.o: $(srcdir)/mark_rts.c if_mach if_not_there $(UTILS)
272         rm -f mark_rts.o
273         -./if_mach ALPHA OSF1 $(CC) -c $(CFLAGS) -Wo,-notail $(srcdir)/mark_rts.c
274         ./if_not_there mark_rts.o $(CC) -c $(CFLAGS) $(srcdir)/mark_rts.c
275 #       Work-around for DEC optimizer tail recursion elimination bug.
276 #  The ALPHA-specific line should be removed if gcc is used.
277
278 alloc.o: version.h
279
280 cord/cordbscs.o: $(srcdir)/cord/cordbscs.c $(CORD_INCLUDE_FILES)
281         $(CC) $(CFLAGS) -c $(srcdir)/cord/cordbscs.c
282         mv cordbscs.o cord/cordbscs.o
283 #  not all compilers understand -o filename
284
285 cord/cordxtra.o: $(srcdir)/cord/cordxtra.c $(CORD_INCLUDE_FILES)
286         $(CC) $(CFLAGS) -c $(srcdir)/cord/cordxtra.c
287         mv cordxtra.o cord/cordxtra.o
288
289 cord/cordprnt.o: $(srcdir)/cord/cordprnt.c $(CORD_INCLUDE_FILES)
290         $(CC) $(CFLAGS) -c $(srcdir)/cord/cordprnt.c
291         mv cordprnt.o cord/cordprnt.o
292
293 cord/cordtest: $(srcdir)/cord/cordtest.c $(CORD_OBJS) libgc.a $(UTILS)
294         rm -f cord/cordtest
295         ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) libgc.a -lucb
296         ./if_mach HP_PA "" $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) libgc.a -ldld
297         ./if_not_there cord/cordtest $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) libgc.a `./threadlibs`
298
299 cord/de: $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o libgc.a $(UTILS)
300         rm -f cord/de
301         ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o libgc.a $(CURSES) -lucb `./threadlibs`
302         ./if_mach HP_PA "" $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o libgc.a $(CURSES) -ldld
303         ./if_mach RS6000 "" $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o libgc.a -lcurses
304         ./if_mach I386 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o libgc.a -lcurses `./threadlibs`
305         ./if_mach ALPHA LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o libgc.a -lcurses
306         ./if_not_there cord/de $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o libgc.a $(CURSES) `./threadlibs`
307
308 if_mach: $(srcdir)/if_mach.c $(srcdir)/gcconfig.h
309         $(CC) $(CFLAGS) -o if_mach $(srcdir)/if_mach.c
310
311 threadlibs: $(srcdir)/threadlibs.c $(srcdir)/gcconfig.h Makefile
312         $(CC) $(CFLAGS) -o threadlibs $(srcdir)/threadlibs.c
313
314 if_not_there: $(srcdir)/if_not_there.c
315         $(CC) $(CFLAGS) -o if_not_there $(srcdir)/if_not_there.c
316
317 clean: 
318         rm -f libgc.a *.o gctest gctest_dyn_link test_cpp \
319               setjmp_test  mon.out gmon.out a.out core if_not_there if_mach \
320               threadlibs $(CORD_OBJS) cord/cordtest cord/de
321         -rm -f *~
322
323 gctest: test.o libgc.a if_mach if_not_there
324         rm -f gctest
325         ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o gctest  test.o libgc.a -lucb
326         ./if_mach HP_PA "" $(CC) $(CFLAGS) -o gctest  test.o libgc.a -ldld
327         ./if_not_there gctest $(CC) $(CFLAGS) -o gctest test.o libgc.a `./threadlibs`
328
329 # If an optimized setjmp_test generates a segmentation fault,
330 # odds are your compiler is broken.  Gctest may still work.
331 # Try compiling setjmp_t.c unoptimized.
332 setjmp_test: $(srcdir)/setjmp_t.c $(srcdir)/gc.h if_mach if_not_there
333         $(CC) $(CFLAGS) -o setjmp_test $(srcdir)/setjmp_t.c
334
335 test:  KandRtest cord/cordtest
336         cord/cordtest
337
338 # Those tests that work even with a K&R C compiler:
339 KandRtest: setjmp_test gctest
340         ./setjmp_test
341         ./gctest
342
343 add_gc_prefix: add_gc_prefix.c
344         $(CC) -o add_gc_prefix $(srcdir)/add_gc_prefix.c
345
346 gc.tar: $(SRCS) $(OTHER_FILES) add_gc_prefix
347         ./add_gc_prefix $(SRCS) $(OTHER_FILES) > /tmp/gc.tar-files
348         (cd $(srcdir)/.. ; tar cvfh - `cat /tmp/gc.tar-files`) > gc.tar
349
350 pc_gc.tar: $(SRCS) $(OTHER_FILES)
351         tar cvfX pc_gc.tar pc_excludes $(SRCS) $(OTHER_FILES)
352
353 floppy: pc_gc.tar
354         -mmd a:/cord
355         -mmd a:/cord/private
356         -mmd a:/include
357         -mmd a:/include/private
358         mkdir /tmp/pc_gc
359         cat pc_gc.tar | (cd /tmp/pc_gc; tar xvf -)
360         -mcopy -tmn /tmp/pc_gc/* a:
361         -mcopy -tmn /tmp/pc_gc/cord/* a:/cord
362         -mcopy -mn /tmp/pc_gc/cord/de_win.ICO a:/cord
363         -mcopy -tmn /tmp/pc_gc/cord/private/* a:/cord/private
364         -mcopy -tmn /tmp/pc_gc/include/* a:/include
365         -mcopy -tmn /tmp/pc_gc/include/private/* a:/include/private
366         rm -r /tmp/pc_gc
367
368 gc.tar.Z: gc.tar
369         compress gc.tar
370
371 gc.tar.gz: gc.tar
372         gzip gc.tar
373
374 lint: $(CSRCS) test.c
375         lint -DLINT $(CSRCS) test.c | egrep -v "possible pointer alignment problem|abort|exit|sbrk|mprotect|syscall"
376
377 # BTL: added to test shared library version of collector.
378 # Currently works only under SunOS5.  Requires GC_INIT call from statically
379 # loaded client code.
380 ABSDIR = `pwd`
381 gctest_dyn_link: test.o libgc.so
382         $(CC) -L$(ABSDIR) -R$(ABSDIR) -o gctest_dyn_link test.o -lgc -ldl -lthread
383
384 gctest_irix_dyn_link: test.o libirixgc.so
385         $(CC) -L$(ABSDIR) -o gctest_irix_dyn_link test.o -lirixgc
386
387 test_dll.o: test.c libgc_globals.h
388         $(CC) $(CFLAGS) -DGC_USE_DLL -c test.c -o test_dll.o
389
390 test_dll: test_dll.o libgc_dll.a libgc.dll
391         $(CC) test_dll.o -L$(ABSDIR) -lgc_dll -o test_dll
392
393 SYM_PREFIX-libgc=GC
394
395 # Uncomment the following line to build a GNU win32 DLL
396 # include Makefile.DLLs
397
398 reserved_namespace: $(SRCS)
399         for file in $(SRCS) test.c test_cpp.cc; do \
400                 sed s/GC_/_GC_/g < $$file > tmp; \
401                 cp tmp $$file; \
402                 done
403
404 user_namespace: $(SRCS)
405         for file in $(SRCS) test.c test_cpp.cc; do \
406                 sed s/_GC_/GC_/g < $$file > tmp; \
407                 cp tmp $$file; \
408                 done
409
410 # Remake configuration
411 checkconf:
412         @if [ -f $(srcdir)/../devel ]; then \
413           $(MAKE) -f $(srcdir)/conf.mk freshconf \
414           srcdir="$(srcdir)" PRJDIR="$(PRJDIR)"; \
415         fi
416
417 # End of Makefile