File: EMX_MAKEFILE

package info (click to toggle)
libgc 1:7.6.4-0.4
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,956 kB
  • sloc: ansic: 35,613; sh: 4,193; cpp: 1,247; makefile: 163; asm: 99
file content (113 lines) | stat: -rw-r--r-- 4,081 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#
#  OS/2 specific Makefile for the EMX environment
#
#  You need GNU Make 3.71, gcc 2.5.7, emx 0.8h and GNU fileutils 3.9
#  or similar tools. C++ interface and de.exe weren't tested.
#

# Primary targets:
# gc.a - builds basic library
# c++ - adds C++ interface to library and include directory
# cords - adds cords (heavyweight strings) to library and include directory
# test - prints porting information, then builds basic version of gc.a, and runs
#        some tests of collector and cords.  Does not add cords or c++ interface to gc.a
# cord/de.exe - builds dumb editor based on cords.
CC= gcc
CXX=g++
# Needed only for "make c++", which adds the c++ interface

CFLAGS= -O -DALL_INTERIOR_POINTERS -I$(srcdir)/include
# Setjmp_test may yield overly optimistic results when compiled
# without optimization.

CXXFLAGS= $(CFLAGS)
AR= ar
RANLIB= ar s

# Redefining srcdir allows object code for the nonPCR version of the collector
# to be generated in different directories
srcdir = .
VPATH = $(srcdir)

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

CORD_OBJS= cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o

CORD_INCLUDE_FILES= $(srcdir)/include/gc.h $(srcdir)/include/cord.h \
    $(srcdir)/include/ec.h $(srcdir)/include/cord_pos.h

# Libraries needed for curses applications.  Only needed for de.
CURSES= -lcurses -ltermlib

SPECIALCFLAGS = -I$(srcdir)/include
# Alternative flags to the C compiler for mach_dep.c.
# Mach_dep.c often doesn't like optimization, and it's
# not time-critical anyway.

all: gc.a gctest.exe

$(OBJS) test.o: $(srcdir)/include/private/gc_priv.h \
    $(srcdir)/include/private/gc_hdrs.h $(srcdir)/include/gc.h \
    $(srcdir)/include/private/gcconfig.h $(srcdir)/include/gc_typed.h
# The dependency on Makefile is needed.  Changing
# options affects the size of GC_arrays,
# invalidating all .o files that rely on gc_priv.h

mark.o typd_mlc.o finalize.o: $(srcdir)/include/gc_mark.h $(srcdir)/include/private/gc_pmark.h

gc.a: $(OBJS)
	$(AR) ru gc.a $(OBJS)
	$(RANLIB) gc.a

cords: $(CORD_OBJS) cord/cordtest.exe
	$(AR) ru gc.a $(CORD_OBJS)
	$(RANLIB) gc.a

gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/include/gc_cpp.h
	$(CXX) -c $(CXXFLAGS) $(srcdir)/gc_cpp.cc

c++: gc_cpp.o $(srcdir)/include/gc_cpp.h
	$(AR) ru gc.a gc_cpp.o
	$(RANLIB) gc.a

mach_dep.o: $(srcdir)/mach_dep.c
	$(CC) -o mach_dep.o -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c

mark_rts.o: $(srcdir)/mark_rts.c
	$(CC) -o mark_rts.o -c $(CFLAGS) $(srcdir)/mark_rts.c

cord/cordbscs.o: $(srcdir)/cord/cordbscs.c $(CORD_INCLUDE_FILES)
	$(CC) $(CFLAGS) -c $(srcdir)/cord/cordbscs.c -o  cord/cordbscs.o

cord/cordxtra.o: $(srcdir)/cord/cordxtra.c $(CORD_INCLUDE_FILES)
	$(CC) $(CFLAGS) -c $(srcdir)/cord/cordxtra.c -o  cord/cordxtra.o

cord/cordprnt.o: $(srcdir)/cord/cordprnt.c $(CORD_INCLUDE_FILES)
	$(CC) $(CFLAGS) -c $(srcdir)/cord/cordprnt.c -o cord/cordprnt.o

cord/cordtest.exe: $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a
	$(CC) $(CFLAGS) -o cord/cordtest.exe $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a

cord/de.exe: $(srcdir)/cord/tests/de.c $(srcdir)/cord/cordbscs.o $(srcdir)/cord/cordxtra.o gc.a
	$(CC) $(CFLAGS) -o cord/de.exe $(srcdir)/cord/tests/de.c $(srcdir)/cord/cordbscs.o $(srcdir)/cord/cordxtra.o gc.a $(CURSES)

clean:
	rm -f gc.a tests/test.o gctest.exe output-local output-diff $(OBJS) \
	      setjmp_test  mon.out gmon.out a.out core \
	      $(CORD_OBJS) cord/cordtest.exe cord/de.exe
	-rm -f *~

gctest.exe: tests/test.o gc.a
	$(CC) $(CFLAGS) -o gctest.exe tests/test.o gc.a

# If an optimized setjmp_test generates a segmentation fault,
# odds are your compiler is broken.  Gctest may still work.
# Try compiling setjmp_t.c unoptimized.
setjmp_test.exe: $(srcdir)/tools/setjmp_t.c $(srcdir)/include/gc.h
	$(CC) $(CFLAGS) -o setjmp_test.exe $(srcdir)/tools/setjmp_t.c

test: setjmp_test.exe gctest.exe
	./setjmp_test
	./gctest
	make cord/cordtest.exe
	cord/cordtest