1 # Makefile to build the garbage collector D library for Posix
2 # Designed to work with GNU make
7 # Build the garbage collector library
9 # Generate documentation
11 # Delete unneeded files created by build process
13 LIB_BASE=libdruntime-gc-stub
15 LIB_TARGET=$(LIB_BASE)$(LIB_BUILD).a
16 LIB_MASK=$(LIB_BASE)*.a
25 CFLAGS_RELEASE=-O $(ADD_CFLAGS)
26 CFLAGS_DEBUG=-g $(ADD_CFLAGS)
27 CFLAGS=$(CFLAGS_RELEASE)
29 DFLAGS_RELEASE=-release -O -inline -w -nofloat $(ADD_DFLAGS)
30 DFLAGS_DEBUG=-g -w -nofloat $(ADD_DFLAGS)
31 DFLAGS=$(DFLAGS_RELEASE)
33 TFLAGS_RELEASE=-O -inline -w -nofloat $(ADD_DFLAGS)
34 TFLAGS_DEBUG=-g -w -nofloat $(ADD_DFLAGS)
35 TFLAGS=$(TFLAGS_RELEASE)
37 DOCFLAGS=-version=DDoc
45 .SUFFIXES: .s .S .c .cpp .d .html .o
48 $(CC) -c $(CFLAGS) $< -o$@
51 $(CC) -c $(CFLAGS) $< -o$@
54 $(CC) -c $(CFLAGS) $< -o$@
57 g++ -c $(CFLAGS) $< -o$@
60 $(DC) -c $(DFLAGS) $< -of$@
63 $(DC) -c -o- $(DOCFLAGS) -Df$*.html $<
64 # $(DC) -c -o- $(DOCFLAGS) -Df$*.html dmd.ddoc $<
71 ######################################################
76 ######################################################
80 ######################################################
83 make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE) -unittest"
86 make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE)"
89 make -fposix.mak DC="$(DC)" LIB_BUILD="-d" DFLAGS="$(DFLAGS_DEBUG)"
91 ######################################################
93 stub.lib : $(LIB_TARGET)
95 $(LIB_TARGET) : $(ALL_OBJS)
99 stub.doc : $(ALL_DOCS)
100 echo No documentation available.
102 ######################################################
105 find . -name "*.di" | xargs $(RM)
112 $(CP) $(LIB_MASK) $(LIB_DEST)/.