2 # OS/2 specific Makefile for the EMX environment
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.
7 # Rename this file "Makefile".
11 # gc.a - builds basic library
12 # c++ - adds C++ interface to library and include directory
13 # cords - adds cords (heavyweight strings) to library and include directory
14 # test - prints porting information, then builds basic version of gc.a, and runs
15 # some tests of collector and cords. Does not add cords or c++ interface to gc.a
16 # cord/de.exe - builds dumb editor based on cords.
19 # Needed only for "make c++", which adds the c++ interface
21 CFLAGS= -O -DALL_INTERIOR_POINTERS
22 # Setjmp_test may yield overly optimistic results when compiled
23 # without optimization.
28 # Redefining srcdir allows object code for the nonPCR version of the collector
29 # to be generated in different directories
33 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 fnlz_mlc.o malloc.o stubborn.o checksums.o typd_mlc.o ptr_chck.o mallocx.o
35 CORD_OBJS= cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o
37 CORD_INCLUDE_FILES= $(srcdir)/gc.h $(srcdir)/cord/cord.h $(srcdir)/cord/ec.h \
38 $(srcdir)/cord/cord_pos.h
40 # Libraries needed for curses applications. Only needed for de.
41 CURSES= -lcurses -ltermlib
43 # The following is irrelevant on most systems. But a few
44 # versions of make otherwise fork the shell specified in
45 # the SHELL environment variable.
49 # Alternative flags to the C compiler for mach_dep.c.
50 # Mach_dep.c often doesn't like optimization, and it's
51 # not time-critical anyway.
55 $(OBJS) test.o: $(srcdir)/gc_priv.h $(srcdir)/gc_hdrs.h $(srcdir)/gc.h \
56 $(srcdir)/gcconfig.h $(srcdir)/gc_typed.h
57 # The dependency on Makefile is needed. Changing
58 # options affects the size of GC_arrays,
59 # invalidating all .o files that rely on gc_priv.h
61 mark.o typd_mlc.o finalize.o: $(srcdir)/include/gc_mark.h $(srcdir)/include/private/gc_pmark.h
67 cords: $(CORD_OBJS) cord/cordtest.exe
68 $(AR) ru gc.a $(CORD_OBJS)
70 cp $(srcdir)/cord/cord.h include/cord.h
71 cp $(srcdir)/cord/ec.h include/ec.h
72 cp $(srcdir)/cord/cord_pos.h include/cord_pos.h
74 gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/gc_cpp.h
75 $(CXX) -c -O $(srcdir)/gc_cpp.cc
77 c++: gc_cpp.o $(srcdir)/gc_cpp.h
78 $(AR) ru gc.a gc_cpp.o
80 cp $(srcdir)/gc_cpp.h include/gc_cpp.h
82 mach_dep.o: $(srcdir)/mach_dep.c
83 $(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
88 cord/cordbscs.o: $(srcdir)/cord/cordbscs.c $(CORD_INCLUDE_FILES)
89 $(CC) $(CFLAGS) -c $(srcdir)/cord/cordbscs.c -o cord/cordbscs.o
91 cord/cordxtra.o: $(srcdir)/cord/cordxtra.c $(CORD_INCLUDE_FILES)
92 $(CC) $(CFLAGS) -c $(srcdir)/cord/cordxtra.c -o cord/cordxtra.o
94 cord/cordprnt.o: $(srcdir)/cord/cordprnt.c $(CORD_INCLUDE_FILES)
95 $(CC) $(CFLAGS) -c $(srcdir)/cord/cordprnt.c -o cord/cordprnt.o
97 cord/cordtest.exe: $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a
98 $(CC) $(CFLAGS) -o cord/cordtest.exe $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a
100 cord/de.exe: $(srcdir)/cord/tests/de.c $(srcdir)/cord/cordbscs.o $(srcdir)/cord/cordxtra.o gc.a
101 $(CC) $(CFLAGS) -o cord/de.exe $(srcdir)/cord/tests/de.c $(srcdir)/cord/cordbscs.o $(srcdir)/cord/cordxtra.o gc.a $(CURSES)
104 rm -f gc.a tests/test.o gctest.exe output-local output-diff $(OBJS) \
105 setjmp_test mon.out gmon.out a.out core \
106 $(CORD_OBJS) cord/cordtest.exe cord/de.exe
109 gctest.exe: tests/test.o gc.a
110 $(CC) $(CFLAGS) -o gctest.exe tests/test.o gc.a
112 # If an optimized setjmp_test generates a segmentation fault,
113 # odds are your compiler is broken. Gctest may still work.
114 # Try compiling setjmp_t.c unoptimized.
115 setjmp_test.exe: $(srcdir)/tools/setjmp_t.c $(srcdir)/gc.h
116 $(CC) $(CFLAGS) -o setjmp_test.exe $(srcdir)/tools/setjmp_t.c
118 test: setjmp_test.exe gctest.exe
121 make cord/cordtest.exe