Makefile.dj 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. # This Makefile is intended only for DJGPP use.
  2. # It is mainly a copy of the main Makefile, but tends to get out of sync
  3. # with it. A merge would probably be appropriate.
  4. # Primary targets:
  5. # gc.a - builds basic library
  6. # libgc.a - builds library for use with g++ "-fgc-keyword" extension
  7. # -fgc-keyword was never really available. Historical
  8. # interest only.
  9. # c++ - adds C++ interface to library
  10. # cords - adds cords (heavyweight strings) to library
  11. # test - prints porting information, then builds basic version of gc.a,
  12. # and runs some tests of collector and cords. Does not add cords or
  13. # c++ interface to gc.a
  14. # cord/de$(EXE_SUFFIX) - builds dumb editor based on cords.
  15. ABI_FLAG=
  16. CC=gcc $(ABI_FLAG)
  17. CXX=gxx $(ABI_FLAG)
  18. AS=gcc -c -x assembler-with-cpp $(ABI_FLAG)
  19. # The above doesn't work with gas, which doesn't run cpp.
  20. # Define AS as `gcc -c -x assembler-with-cpp' instead.
  21. # Under Irix 6, you will have to specify the ABI (-o32, -n32, or -64)
  22. # if you use something other than the default ABI on your machine.
  23. # special defines for DJGPP
  24. CXXLD=gxx $(ABI_FLAG)
  25. EXE_SUFFIX=.exe
  26. srcdir= .
  27. VPATH= $(srcdir)
  28. CFLAGS= -gstabs+ -O2 -I$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DALL_INTERIOR_POINTERS -DNO_EXECUTE_PERMISSION -DSILENT
  29. # Setjmp_test may yield overly optimistic results when compiled
  30. # without optimization.
  31. # -DSILENT disables statistics printing, and improves performance.
  32. # -DFIND_LEAK causes GC_find_leak to be initially set.
  33. # This causes the collector to assume that all inaccessible
  34. # objects should have been explicitly deallocated, and reports exceptions.
  35. # Finalization and the test program are not usable in this mode.
  36. # -DALL_INTERIOR_POINTERS allows all pointers to the interior
  37. # of objects to be recognized. (See gc_priv.h for consequences.)
  38. # -DSMALL_CONFIG tries to tune the collector for small heap sizes,
  39. # usually causing it to use less space in such situations.
  40. # Incremental collection no longer works in this case.
  41. # -DLARGE_CONFIG tunes the collector for unusually large heaps.
  42. # Necessary for heaps larger than about 500 MB on most machines.
  43. # Recommended for heaps larger than about 64 MB.
  44. # -DDONT_ADD_BYTE_AT_END is meaningful only with
  45. # -DALL_INTERIOR_POINTERS. Normally -DALL_INTERIOR_POINTERS
  46. # causes all objects to be padded so that pointers just past the end of
  47. # an object can be recognized. This can be expensive. (The padding
  48. # is normally more than one byte due to alignment constraints.)
  49. # -DDONT_ADD_BYTE_AT_END disables the padding.
  50. # -DNO_SIGNALS does not disable signals during critical parts of
  51. # the GC process. This is no less correct than many malloc
  52. # implementations, and it sometimes has a significant performance
  53. # impact. However, it is dangerous for many not-quite-ANSI C
  54. # programs that call things like printf in asynchronous signal handlers.
  55. # This is on by default. Turning it off has not been extensively tested with
  56. # compilers that reorder stores. It should have been.
  57. # -DNO_EXECUTE_PERMISSION may cause some or all of the heap to not
  58. # have execute permission, i.e. it may be impossible to execute
  59. # code from the heap. Currently this only affects the incremental
  60. # collector on UNIX machines. It may greatly improve its performance,
  61. # since this may avoid some expensive cache synchronization.
  62. # -DGC_NO_OPERATOR_NEW_ARRAY declares that the C++ compiler does not support
  63. # the new syntax "operator new[]" for allocating and deleting arrays.
  64. # See gc_cpp.h for details. No effect on the C part of the collector.
  65. # This is defined implicitly in a few environments. Must also be defined
  66. # by clients that use gc_cpp.h.
  67. # -DREDIRECT_MALLOC=X causes malloc, realloc, and free to be defined
  68. # as aliases for X, GC_realloc, and GC_free, respectively.
  69. # Calloc is redefined in terms of the new malloc. X should
  70. # be either GC_malloc or GC_malloc_uncollectable.
  71. # The former is occasionally useful for working around leaks in code
  72. # you don't want to (or can't) look at. It may not work for
  73. # existing code, but it often does. Neither works on all platforms,
  74. # since some ports use malloc or calloc to obtain system memory.
  75. # (Probably works for UNIX, and win32.)
  76. # -DIGNORE_FREE turns calls to free into a noop. Only useful with
  77. # -DREDIRECT_MALLOC.
  78. # -DNO_DEBUGGING removes GC_dump and the debugging routines it calls.
  79. # Reduces code size slightly at the expense of debuggability.
  80. # -DJAVA_FINALIZATION makes it somewhat safer to finalize objects out of
  81. # order by specifying a nonstandard finalization mark procedure (see
  82. # finalize.c). Objects reachable from finalizable objects will be marked
  83. # in a sepearte postpass, and hence their memory won't be reclaimed.
  84. # Not recommended unless you are implementing a language that specifies
  85. # these semantics. Since 5.0, determines only only the initial value
  86. # of GC_java_finalization variable.
  87. # -DFINALIZE_ON_DEMAND causes finalizers to be run only in response
  88. # to explicit GC_invoke_finalizers() calls.
  89. # In 5.0 this became runtime adjustable, and this only determines the
  90. # initial value of GC_finalize_on_demand.
  91. # -DATOMIC_UNCOLLECTABLE includes code for GC_malloc_atomic_uncollectable.
  92. # This is useful if either the vendor malloc implementation is poor,
  93. # or if REDIRECT_MALLOC is used.
  94. # -DHBLKSIZE=ddd, where ddd is a power of 2 between 512 and 16384, explicitly
  95. # sets the heap block size. Each heap block is devoted to a single size and
  96. # kind of object. For the incremental collector it makes sense to match
  97. # the most likely page size. Otherwise large values result in more
  98. # fragmentation, but generally better performance for large heaps.
  99. # -DPRINT_BLACK_LIST Whenever a black list entry is added, i.e. whenever
  100. # the garbage collector detects a value that looks almost, but not quite,
  101. # like a pointer, print both the address containing the value, and the
  102. # value of the near-bogus-pointer. Can be used to identifiy regions of
  103. # memory that are likely to contribute misidentified pointers.
  104. # -DKEEP_BACK_PTRS Add code to save back pointers in debugging headers
  105. # for objects allocated with the debugging allocator. If all objects
  106. # through GC_MALLOC with GC_DEBUG defined, this allows the client
  107. # to determine how particular or randomly chosen objects are reachable
  108. # for debugging/profiling purposes. The gc_backptr.h interface is
  109. # implemented only if this is defined.
  110. # -DGC_ASSERTIONS Enable some internal GC assertion checking. Currently
  111. # this facility is only used in a few places. It is intended primarily
  112. # for debugging of the garbage collector itself, but could also
  113. # -DDBG_HDRS_ALL Make sure that all objects have debug headers. Increases
  114. # the reliability (from 99.9999% to 100%) of some of the debugging
  115. # code (especially KEEP_BACK_PTRS). Makes -DSHORT_DBG_HDRS possible.
  116. # Assumes that all client allocation is done through debugging
  117. # allocators.
  118. # -DSHORT_DBG_HDRS Assume that all objects have debug headers. Shorten
  119. # the headers to minimize object size, at the expense of checking for
  120. # writes past the end of an object. This is intended for environments
  121. # in which most client code is written in a "safe" language, such as
  122. # Scheme or Java. Assumes that all client allocation is done using
  123. # the GC_debug_ functions (or through the macros that expand to these.
  124. # (Also eliminates the field for the requested object size.)
  125. # occasionally be useful for debugging of client code. Slows down the
  126. # collector somewhat, but not drastically.
  127. # -DCHECKSUMS reports on erroneously clear dirty bits, and unexpectedly
  128. # altered stubborn objects, at substantial performance cost.
  129. # Use only for debugging of the incremental collector.
  130. # -DGC_GCJ_SUPPORT includes support for gcj (and possibly other systems
  131. # that include a pointer to a type descriptor in each allocated object).
  132. # Building this way requires an ANSI C compiler.
  133. # -DUSE_I686_PREFETCH causes the collector to issue Pentium III style
  134. # prefetch instructions. No effect except on X86 Linux platforms.
  135. # Assumes a very recent gcc-compatible compiler and assembler.
  136. # (Gas prefetcht0 support was added around May 1999.)
  137. # Empirically the code appears to still run correctly on Pentium II
  138. # processors, though with no performance benefit. May not run on other
  139. # X86 processors? In some cases this improves performance by
  140. # 15% or so.
  141. # -DUSE_3DNOW_PREFETCH causes the collector to issue AMD 3DNow style
  142. # prefetch instructions. Same restrictions as USE_I686_PREFETCH.
  143. # UNTESTED!!
  144. # -DGC_USE_LD_WRAP in combination with the gld flags listed in README.linux
  145. # causes the collector some system and pthread calls in a more transparent
  146. # fashion than the usual macro-based approach. Requires GNU ld, and
  147. # currently probably works only with Linux.
  148. CXXFLAGS= $(CFLAGS) -DGC_OPERATOR_NEW_ARRAY
  149. AR= ar
  150. RANLIB= ranlib
  151. 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 typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o gcj_mlc.o specific.o
  152. 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 typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c specific.c
  153. CORD_SRCS= cord/cordbscs.c cord/cordxtra.c cord/cordprnt.c cord/de.c cord/cordtest.c include/cord.h include/ec.h include/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
  154. CORD_OBJS= cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o
  155. SRCS= $(CSRCS) mips_sgi_mach_dep.S rs6000_mach_dep.s alpha_mach_dep.S \
  156. sparc_mach_dep.S include/gc.h include/gc_typed.h \
  157. include/private/gc_hdrs.h include/private/gc_priv.h \
  158. include/private/gcconfig.h include/private/gc_mark.h \
  159. include/gc_inl.h include/gc_inline.h gc.man \
  160. threadlibs.c if_mach.c if_not_there.c gc_cpp.cc include/gc_cpp.h \
  161. include/weakpointer.h include/private/gc_locks.h \
  162. gcc_support.c mips_ultrix_mach_dep.s include/gc_alloc.h \
  163. include/new_gc_alloc.h include/javaxfc.h sparc_sunos4_mach_dep.s \
  164. include/private/solaris_threads.h include/gc_backptr.h \
  165. hpux_test_and_clear.s include/gc_gcj.h \
  166. include/gc_local_alloc.h include/private/dbg_mlc.h \
  167. include/private/specific.h powerpc_darwin_mach_dep.s \
  168. include/leak_detector.h $(CORD_SRCS)
  169. OTHER_FILES= Makefile PCR-Makefile OS2_MAKEFILE NT_MAKEFILE BCC_MAKEFILE \
  170. README tests/test.c test_cpp.cc setjmp_t.c SMakefile.amiga \
  171. SCoptions.amiga README.amiga README.win32 cord/README \
  172. README.rs6000 README.QUICK callprocs pc_excludes \
  173. barrett_diagram README.OS2 README.Mac MacProjects.sit.hqx \
  174. MacOS.c EMX_MAKEFILE README.debugging \
  175. Mac_files/datastart.c Mac_files/dataend.c \
  176. Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h \
  177. add_gc_prefix.c README.solaris2 README.sgi README.hp README.uts \
  178. win32_threads.c NT_THREADS_MAKEFILE gc.mak README.dj Makefile.dj \
  179. README.alpha README.linux README.MacOSX version.h Makefile.DLLs \
  180. WCC_MAKEFILE nursery.c include/gc_nursery.h include/gc_copy_descr.h
  181. CORD_INCLUDE_FILES= $(srcdir)/include/gc.h $(srcdir)/include/cord.h \
  182. $(srcdir)/include/ec.h $(srcdir)/include/private/cord_pos.h
  183. UTILS= if_mach$(EXE_SUFFIX) if_not_there$(EXE_SUFFIX)
  184. # Libraries needed for curses applications. Only needed for de.
  185. CURSES= -lcurses -ltermlib
  186. # The following is irrelevant on most systems. But a few
  187. # versions of make otherwise fork the shell specified in
  188. # the SHELL environment variable.
  189. SHELL= /bin/sh
  190. SPECIALCFLAGS = -I$(srcdir)/include
  191. # Alternative flags to the C compiler for mach_dep.c.
  192. # Mach_dep.c often doesn't like optimization, and it's
  193. # not time-critical anyway.
  194. # Set SPECIALCFLAGS to -q nodirect_code on Encore.
  195. all: gc.a gctest$(EXE_SUFFIX)
  196. $(OBJS) test.o dyn_load.o dyn_load_sunos53.o: \
  197. $(srcdir)/include/private/gc_priv.h \
  198. $(srcdir)/include/private/gc_hdrs.h $(srcdir)/include/private/gc_locks.h \
  199. $(srcdir)/include/gc.h \
  200. $(srcdir)/include/private/gcconfig.h $(srcdir)/include/gc_typed.h \
  201. Makefile
  202. # The dependency on Makefile is needed. Changing
  203. # options such as -DSILENT affects the size of GC_arrays,
  204. # invalidating all .o files that rely on gc_priv.h
  205. mark.o typd_mlc.o finalize.o: $(srcdir)/include/gc_mark.h
  206. base_lib gc.a: $(OBJS) dyn_load.o $(UTILS)
  207. echo > base_lib
  208. rm -f on_sparc_sunos5_1
  209. ./if_mach SPARC SUNOS5 touch on_sparc_sunos5_1
  210. ./if_mach SPARC SUNOS5 $(AR) rus gc.a $(OBJS) dyn_load.o
  211. ./if_not_there on_sparc_sunos5_1 $(AR) ru gc.a $(OBJS) dyn_load.o
  212. -./if_not_there on_sparc_sunos5_1 $(RANLIB) gc.a
  213. # ignore ranlib failure; that usually means it doesn't exist, and isn't needed
  214. cords: $(CORD_OBJS) cord/cordtest$(EXE_SUFFIX) $(UTILS)
  215. rm -f on_sparc_sunos5_3
  216. ./if_mach SPARC SUNOS5 touch on_sparc_sunos5_3
  217. ./if_mach SPARC SUNOS5 $(AR) rus gc.a $(CORD_OBJS)
  218. ./if_not_there on_sparc_sunos5_3 $(AR) ru gc.a $(CORD_OBJS)
  219. -./if_not_there on_sparc_sunos5_3 $(RANLIB) gc.a
  220. gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/include/gc_cpp.h $(srcdir)/include/gc.h Makefile
  221. $(CXX) -c $(CXXFLAGS) $(srcdir)/gc_cpp.cc
  222. test_cpp$(EXE_SUFFIX): $(srcdir)/test_cpp.cc $(srcdir)/include/gc_cpp.h gc_cpp.o $(srcdir)/include/gc.h \
  223. base_lib $(UTILS)
  224. rm -f test_cpp test_cpp$(EXE_SUFFIX)
  225. ./if_mach HP_PA "" $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/test_cpp.cc gc_cpp.o gc.a -ldld
  226. ./if_not_there test_cpp$(EXE_SUFFIX) $(CXXLD) $(CXXFLAGS) -o test_cpp$(EXE_SUFFIX) $(srcdir)/test_cpp.cc gc_cpp.o gc.a
  227. rm -f test_cpp
  228. c++: gc_cpp.o $(srcdir)/include/gc_cpp.h test_cpp$(EXE_SUFFIX)
  229. rm -f on_sparc_sunos5_4
  230. ./if_mach SPARC SUNOS5 touch on_sparc_sunos5_4
  231. ./if_mach SPARC SUNOS5 $(AR) rus gc.a gc_cpp.o
  232. ./if_not_there on_sparc_sunos5_4 $(AR) ru gc.a gc_cpp.o
  233. -./if_not_there on_sparc_sunos5_4 $(RANLIB) gc.a
  234. ./test_cpp$(EXE_SUFFIX) 1
  235. echo > c++
  236. dyn_load_sunos53.o: dyn_load.c
  237. $(CC) $(CFLAGS) -DSUNOS53_SHARED_LIB -c $(srcdir)/dyn_load.c -o $@
  238. # SunOS5 shared library version of the collector
  239. sunos5gc.so: $(OBJS) dyn_load_sunos53.o
  240. $(CC) -G -o sunos5gc.so $(OBJS) dyn_load_sunos53.o -ldl
  241. ln sunos5gc.so libgc.so
  242. # Alpha/OSF shared library version of the collector
  243. libalphagc.so: $(OBJS)
  244. ld -shared -o libalphagc.so $(OBJS) dyn_load.o -lc
  245. ln libalphagc.so libgc.so
  246. # IRIX shared library version of the collector
  247. libirixgc.so: $(OBJS) dyn_load.o
  248. ld -shared $(ABI_FLAG) -o libirixgc.so $(OBJS) dyn_load.o -lc
  249. ln libirixgc.so libgc.so
  250. # Linux shared library version of the collector
  251. liblinuxgc.so: $(OBJS) dyn_load.o
  252. gcc -shared -o liblinuxgc.so $(OBJS) dyn_load.o -lo
  253. ln liblinuxgc.so libgc.so
  254. mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/mips_sgi_mach_dep.S $(srcdir)/mips_ultrix_mach_dep.s \
  255. $(srcdir)/rs6000_mach_dep.s $(srcdir)/powerpc_darwin_mach_dep.s $(UTILS)
  256. rm -f mach_dep.o
  257. ./if_mach MIPS IRIX5 $(AS) -o mach_dep.o $(srcdir)/mips_sgi_mach_dep.S
  258. ./if_mach MIPS RISCOS $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s
  259. ./if_mach MIPS ULTRIX $(AS) -o mach_dep.o $(srcdir)/mips_ultrix_mach_dep.s
  260. ./if_mach RS6000 "" $(AS) -o mach_dep.o $(srcdir)/rs6000_mach_dep.s
  261. ./if_mach POWERPC MACOSX $(AS) -o mach_dep.o $(srcdir)/powerpc_darwin_mach_dep.s
  262. ./if_mach ALPHA "" $(AS) -o mach_dep.o $(srcdir)/alpha_mach_dep.S
  263. ./if_mach SPARC SUNOS5 $(AS) -o mach_dep.o $(srcdir)/sparc_mach_dep.S
  264. ./if_mach SPARC SUNOS4 $(AS) -o mach_dep.o $(srcdir)/sparc_sunos4_mach_dep.s
  265. ./if_not_there mach_dep.o $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
  266. mark_rts.o: $(srcdir)/mark_rts.c if_mach if_not_there $(UTILS)
  267. rm -f mark_rts.o
  268. -./if_mach ALPHA OSF1 $(CC) -c $(CFLAGS) -Wo,-notail $(srcdir)/mark_rts.c
  269. ./if_not_there mark_rts.o $(CC) -c $(CFLAGS) $(srcdir)/mark_rts.c
  270. # Work-around for DEC optimizer tail recursion elimination bug.
  271. # The ALPHA-specific line should be removed if gcc is used.
  272. alloc.o: version.h
  273. cord/cordbscs.o: $(srcdir)/cord/cordbscs.c $(CORD_INCLUDE_FILES)
  274. $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordbscs.c
  275. mv cordbscs.o cord/cordbscs.o
  276. # not all compilers understand -o filename
  277. cord/cordxtra.o: $(srcdir)/cord/cordxtra.c $(CORD_INCLUDE_FILES)
  278. $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordxtra.c
  279. mv cordxtra.o cord/cordxtra.o
  280. cord/cordprnt.o: $(srcdir)/cord/cordprnt.c $(CORD_INCLUDE_FILES)
  281. $(CC) $(CFLAGS) -c -I$(srcdir) $(srcdir)/cord/cordprnt.c
  282. mv cordprnt.o cord/cordprnt.o
  283. cord/cordtest$(EXE_SUFFIX): $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a $(UTILS) /tmp
  284. rm -f cord/cordtest$(EXE_SUFFIX)
  285. ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/cordtest$(EXE_SUFFIX) $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a -lucb
  286. ./if_mach HP_PA "" $(CC) $(CFLAGS) -o cord/cordtest$(EXE_SUFFIX) $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a -ldld
  287. ./if_not_there cord/cordtest$(EXE_SUFFIX) $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a
  288. rm -f cord/cordtest cordtest
  289. -mv cordtest$(EXE_SUFFIX) cord/
  290. /tmp: $(UTILS)
  291. ./if_not_there /tmp mkdir /tmp
  292. cord/de$(EXE_SUFFIX): $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(UTILS)
  293. rm -f cord/de cord/de$(EXE_SUFFIX)
  294. ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) -lucb `./threadlibs`
  295. ./if_mach HP_PA "" $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) -ldld
  296. ./if_mach RS6000 "" $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses
  297. ./if_mach I386 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs`
  298. ./if_mach ALPHA LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses
  299. ./if_not_there cord/de$(EXE_SUFFIX) $(CC) $(CFLAGS) -o cord/de$(EXE_SUFFIX) $(srcdir)/cord/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES)
  300. if_mach$(EXE_SUFFIX): $(srcdir)/if_mach.c $(srcdir)/include/private/gcconfig.h
  301. rm -f if_mach if_mach$(EXE_SUFFIX)
  302. $(CC) $(CFLAGS) -o if_mach $(srcdir)/if_mach.c
  303. threadlibs$(EXE_SUFFIX): $(srcdir)/threadlibs.c $(srcdir)include/private/gcconfig.h Makefile
  304. rm -f threadlibs threadlibs$(EXE_SUFFIX)
  305. $(CC) $(CFLAGS) -o threadlibs $(srcdir)/threadlibs.c
  306. if_not_there$(EXE_SUFFIX): $(srcdir)/if_not_there.c
  307. rm -f if_not_there if_not_there$(EXE_SUFFIX)
  308. $(CC) $(CFLAGS) -o if_not_there $(srcdir)/if_not_there.c
  309. # Clean removes *.o several times,
  310. # because as the first one doesn't seem to get them all!
  311. clean:
  312. rm -f gc.a *.o
  313. rm -f *.o
  314. rm -f *.o
  315. rm -f cord/*.o
  316. rm -f gctest gctest_dyn_link test_cpp
  317. rm -f setjmp_test mon.out gmon.out a.out core if_not_there if_mach
  318. rm -f threadlibs $(CORD_OBJS) cordtest cord/cordtest de cord/de
  319. rm -f gctest$(EXE_SUFFIX) gctest_dyn_link$(EXE_SUFFIX) test_cpp$(EXE_SUFFIX)
  320. rm -f setjmp_test$(EXE_SUFFIX) if_not_there$(EXE_SUFFIX) if_mach$(EXE_SUFFIX)
  321. rm -f threadlibs$(EXE_SUFFIX) cord/cordtest$(EXE_SUFFIX)
  322. -rm -f *~
  323. gctest$(EXE_SUFFIX): tests/test.o gc.a if_mach$(EXE_SUFFIX) if_not_there$(EXE_SUFFIX)
  324. rm -f gctest gctest$(EXE_SUFFIX)
  325. ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o gctest tests/test.o gc.a -lucb
  326. ./if_mach HP_PA "" $(CC) $(CFLAGS) -o gctest tests/test.o gc.a -ldld
  327. ./if_not_there gctest$(EXE_SUFFIX) $(CC) $(CFLAGS) -o gctest$(EXE_SUFFIX) tests/test.o gc.a
  328. rm -f gctest
  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$(EXE_SUFFIX): $(srcdir)/setjmp_t.c $(srcdir)/include/gc.h \
  333. if_mach$(EXE_SUFFIX) if_not_there$(EXE_SUFFIX)
  334. rm -f setjmp_test$(EXE_SUFFIX)
  335. $(CC) $(CFLAGS) -o setjmp_test $(srcdir)/setjmp_t.c
  336. rm -f setjmp_test
  337. test: KandRtest cord/cordtest$(EXE_SUFFIX)
  338. ./cord/cordtest$(EXE_SUFFIX)
  339. # Those tests that work even with a K&R C compiler:
  340. KandRtest: setjmp_test$(EXE_SUFFIX) gctest$(EXE_SUFFIX)
  341. ./setjmp_test$(EXE_SUFFIX)
  342. ./gctest$(EXE_SUFFIX)
  343. add_gc_prefix$(EXE_SUFFIX): add_gc_prefix.c
  344. $(CC) -o add_gc_prefix$(EXE_SUFFIX) $(srcdir)/add_gc_prefix.c
  345. rm -f add_gc_prefix
  346. gc.tar: $(SRCS) $(OTHER_FILES) add_gc_prefix
  347. ./add_gc_prefix$(EXE_SUFFIX) $(SRCS) $(OTHER_FILES) > /tmp/gc.tar-files
  348. (cd $(srcdir)/.. ; tar cvfh - `cat /tmp/gc.tar-files`) > gc.tar
  349. pc_gc.tar: $(SRCS) $(OTHER_FILES)
  350. tar cvfX pc_gc.tar pc_excludes $(SRCS) $(OTHER_FILES)
  351. gc.tar.Z: gc.tar
  352. compress gc.tar
  353. gc.tar.gz: gc.tar
  354. gzip gc.tar
  355. lint: $(CSRCS) tests/test.c
  356. lint -DLINT $(CSRCS) tests/test.c | egrep -v "possible pointer alignment problem|abort|exit|sbrk|mprotect|syscall"
  357. # BTL: added to test shared library version of collector.
  358. # Currently works only under SunOS5. Requires GC_INIT call from statically
  359. # loaded client code.
  360. ABSDIR = `pwd`
  361. gctest_dyn_link: test.o libgc.so
  362. $(CC) -L$(ABSDIR) -R$(ABSDIR) -o gctest_dyn_link test.o -lgc -ldl -lthread
  363. test_dll.o: tests/test.c libgc_globals.h
  364. $(CC) $(CFLAGS) -DGC_USE_DLL -c tests/test.c -o test_dll.o
  365. test_dll: test_dll.o libgc_dll.a libgc.dll
  366. $(CC) test_dll.o -L$(ABSDIR) -lgc_dll -o test_dll
  367. SYM_PREFIX-libgc=GC
  368. # Uncomment the following line to build a GNU win32 DLL
  369. # include Makefile.DLLs