EMX_MAKEFILE 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #
  2. # OS/2 specific Makefile for the EMX environment
  3. #
  4. # You need GNU Make 3.71, gcc 2.5.7, emx 0.8h and GNU fileutils 3.9
  5. # or similar tools. C++ interface and de.exe weren't tested.
  6. #
  7. # Rename this file "Makefile".
  8. #
  9. # Primary targets:
  10. # gc.a - builds basic library
  11. # c++ - adds C++ interface to library and include directory
  12. # cords - adds cords (heavyweight strings) to library and include directory
  13. # test - prints porting information, then builds basic version of gc.a, and runs
  14. # some tests of collector and cords. Does not add cords or c++ interface to gc.a
  15. # cord/de.exe - builds dumb editor based on cords.
  16. CC= gcc
  17. CXX=g++
  18. # Needed only for "make c++", which adds the c++ interface
  19. CFLAGS= -O -DALL_INTERIOR_POINTERS -DSILENT
  20. # Setjmp_test may yield overly optimistic results when compiled
  21. # without optimization.
  22. # -DSILENT disables statistics printing, and improves performance.
  23. # -DCHECKSUMS reports on erroneously clear dirty bits, and unexpectedly
  24. # altered stubborn objects, at substantial performance cost.
  25. # -DFIND_LEAK causes the collector to assume that all inaccessible
  26. # objects should have been explicitly deallocated, and reports exceptions
  27. # -DSOLARIS_THREADS enables support for Solaris (thr_) threads.
  28. # (Clients should also define SOLARIS_THREADS and then include
  29. # gc.h before performing thr_ or GC_ operations.)
  30. # -DALL_INTERIOR_POINTERS allows all pointers to the interior
  31. # of objects to be recognized. (See gc_private.h for consequences.)
  32. # -DSMALL_CONFIG tries to tune the collector for small heap sizes,
  33. # usually causing it to use less space in such situations.
  34. # Incremental collection no longer works in this case.
  35. # -DDONT_ADD_BYTE_AT_END is meaningful only with
  36. # -DALL_INTERIOR_POINTERS. Normally -DALL_INTERIOR_POINTERS
  37. # causes all objects to be padded so that pointers just past the end of
  38. # an object can be recognized. This can be expensive. (The padding
  39. # is normally more than one byte due to alignment constraints.)
  40. # -DDONT_ADD_BYTE_AT_END disables the padding.
  41. AR= ar
  42. RANLIB= ar s
  43. # Redefining srcdir allows object code for the nonPCR version of the collector
  44. # to be generated in different directories
  45. srcdir = .
  46. VPATH = $(srcdir)
  47. 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 dyn_load.o dbg_mlc.o malloc.o stubborn.o checksums.o typd_mlc.o ptr_chck.o mallocx.o
  48. CORD_OBJS= cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o
  49. CORD_INCLUDE_FILES= $(srcdir)/gc.h $(srcdir)/cord/cord.h $(srcdir)/cord/ec.h \
  50. $(srcdir)/cord/cord_pos.h
  51. # Libraries needed for curses applications. Only needed for de.
  52. CURSES= -lcurses -ltermlib
  53. # The following is irrelevant on most systems. But a few
  54. # versions of make otherwise fork the shell specified in
  55. # the SHELL environment variable.
  56. SHELL= bash
  57. SPECIALCFLAGS =
  58. # Alternative flags to the C compiler for mach_dep.c.
  59. # Mach_dep.c often doesn't like optimization, and it's
  60. # not time-critical anyway.
  61. all: gc.a gctest.exe
  62. $(OBJS) test.o: $(srcdir)/gc_priv.h $(srcdir)/gc_hdrs.h $(srcdir)/gc.h \
  63. $(srcdir)/gcconfig.h $(srcdir)/gc_typed.h
  64. # The dependency on Makefile is needed. Changing
  65. # options such as -DSILENT affects the size of GC_arrays,
  66. # invalidating all .o files that rely on gc_priv.h
  67. mark.o typd_mlc.o finalize.o: $(srcdir)/include/gc_mark.h $(srcdir)/include/private/gc_pmark.h
  68. gc.a: $(OBJS)
  69. $(AR) ru gc.a $(OBJS)
  70. $(RANLIB) gc.a
  71. cords: $(CORD_OBJS) cord/cordtest.exe
  72. $(AR) ru gc.a $(CORD_OBJS)
  73. $(RANLIB) gc.a
  74. cp $(srcdir)/cord/cord.h include/cord.h
  75. cp $(srcdir)/cord/ec.h include/ec.h
  76. cp $(srcdir)/cord/cord_pos.h include/cord_pos.h
  77. gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/gc_cpp.h
  78. $(CXX) -c -O $(srcdir)/gc_cpp.cc
  79. c++: gc_cpp.o $(srcdir)/gc_cpp.h
  80. $(AR) ru gc.a gc_cpp.o
  81. $(RANLIB) gc.a
  82. cp $(srcdir)/gc_cpp.h include/gc_cpp.h
  83. mach_dep.o: $(srcdir)/mach_dep.c
  84. $(CC) -o mach_dep.o -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
  85. mark_rts.o: $(srcdir)/mark_rts.c
  86. $(CC) -o mark_rts.o -c $(CFLAGS) $(srcdir)/mark_rts.c
  87. cord/cordbscs.o: $(srcdir)/cord/cordbscs.c $(CORD_INCLUDE_FILES)
  88. $(CC) $(CFLAGS) -c $(srcdir)/cord/cordbscs.c -o cord/cordbscs.o
  89. cord/cordxtra.o: $(srcdir)/cord/cordxtra.c $(CORD_INCLUDE_FILES)
  90. $(CC) $(CFLAGS) -c $(srcdir)/cord/cordxtra.c -o cord/cordxtra.o
  91. cord/cordprnt.o: $(srcdir)/cord/cordprnt.c $(CORD_INCLUDE_FILES)
  92. $(CC) $(CFLAGS) -c $(srcdir)/cord/cordprnt.c -o cord/cordprnt.o
  93. cord/cordtest.exe: $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a
  94. $(CC) $(CFLAGS) -o cord/cordtest.exe $(srcdir)/cord/cordtest.c $(CORD_OBJS) gc.a
  95. cord/de.exe: $(srcdir)/cord/de.c $(srcdir)/cord/cordbscs.o $(srcdir)/cord/cordxtra.o gc.a
  96. $(CC) $(CFLAGS) -o cord/de.exe $(srcdir)/cord/de.c $(srcdir)/cord/cordbscs.o $(srcdir)/cord/cordxtra.o gc.a $(CURSES)
  97. clean:
  98. rm -f gc.a tests/test.o gctest.exe output-local output-diff $(OBJS) \
  99. setjmp_test mon.out gmon.out a.out core \
  100. $(CORD_OBJS) cord/cordtest.exe cord/de.exe
  101. -rm -f *~
  102. gctest.exe: tests/test.o gc.a
  103. $(CC) $(CFLAGS) -o gctest.exe tests/test.o gc.a
  104. # If an optimized setjmp_test generates a segmentation fault,
  105. # odds are your compiler is broken. Gctest may still work.
  106. # Try compiling setjmp_t.c unoptimized.
  107. setjmp_test.exe: $(srcdir)/setjmp_t.c $(srcdir)/gc.h
  108. $(CC) $(CFLAGS) -o setjmp_test.exe $(srcdir)/setjmp_t.c
  109. test: setjmp_test.exe gctest.exe
  110. ./setjmp_test
  111. ./gctest
  112. make cord/cordtest.exe
  113. cord/cordtest