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=libtango-gc-naive
15 LIB_TARGET=$(LIB_BASE)$(LIB_BUILD).a
16 LIB_MASK=$(LIB_BASE)*.a
26 CFLAGS_RELEASE=-O $(ADD_CFLAGS)
27 CFLAGS_DEBUG=-g $(ADD_CFLAGS)
28 DFLAGS_RELEASE=-release -version=Tango -O -inline -w -nofloat $(SYSTEM_VERSION) $(ADD_DFLAGS) -I../../common -I../../..
29 DFLAGS_DEBUG=-g -w -nofloat -version=Tango$(SYSTEM_VERSION) $(ADD_DFLAGS) -I../../common -I../../..
30 TFLAGS_RELEASE=-O -inline -w -nofloat $(SYSTEM_VERSION) $(ADD_DFLAGS)
31 TFLAGS_DEBUG=-g -w -nofloat $(SYSTEM_VERSION) $(ADD_DFLAGS)
32 DOCFLAGS=-version=DDoc $(SYSTEM_VERSION)
34 ifeq ($(VERSION),debug)
35 CFLAGS=$(CFLAGS_DEBUG)
36 DFLAGS=$(DFLAGS_DEBUG)
37 TFLAGS=$(TFLAGS_DEBUG)
39 CFLAGS=$(CFLAGS_RELEASE)
40 DFLAGS=$(DFLAGS_RELEASE)
41 TFLAGS=$(TFLAGS_RELEASE)
50 .SUFFIXES: .s .S .c .cpp .d .html .o
51 .PHONY : lib lib-release lib-debug unittest all doc clean install clean-all
54 $(CC) -c $(CFLAGS) $< -o$@
57 $(CC) -c $(CFLAGS) $< -o$@
60 $(CC) -c $(CFLAGS) $< -o$@
63 g++ -c $(CFLAGS) $< -o$@
66 $(DC) -c $(DFLAGS) $< -of$@
69 $(DC) -c -o- $(DOCFLAGS) -Df$*.html $<
70 # $(DC) -c -o- $(DOCFLAGS) -Df$*.html dmd.ddoc $<
73 all : lib-release lib-debug doc
75 ######################################################
85 ######################################################
89 ######################################################
91 make -fposix.mak clean DC="$(DC)" LIB_BUILD="" VERSION="$(VERSION)"
92 make -fposix.mak lib DC="$(DC)" LIB_BUILD="" VERSION="$(VERSION)" \
93 ADD_CFLAGS="$(ADD_CFLAGS)" ADD_DFLAGS="$(ADD_DFLAGS) -unittest -debug=UnitTest" \
94 SYSTEM_VERSION="$(SYSTEM_VERSION)"
96 make -fposix.mak clean DC="$(DC)" LIB_BUILD="" VERSION="$(VERSION)"
97 make -fposix.mak DC="$(DC)" LIB_BUILD="" VERSION=release lib \
98 ADD_CFLAGS="$(ADD_CFLAGS)" ADD_DFLAGS="$(ADD_DFLAGS)" SYSTEM_VERSION="$(SYSTEM_VERSION)"
100 make -fposix.mak clean DC="$(DC)" LIB_BUILD="" VERSION="$(VERSION)"
101 make -fposix.mak DC="$(DC)" LIB_BUILD="-d" VERSION=debug lib \
102 ADD_CFLAGS="$(ADD_CFLAGS)" ADD_DFLAGS="$(ADD_DFLAGS)" SYSTEM_VERSION="$(SYSTEM_VERSION)"
104 ######################################################
108 $(LIB_TARGET) : $(ALL_OBJS)
113 echo No documentation available.
115 ######################################################
118 find . -name "*.di" | xargs $(RM)
127 $(CP) $(LIB_MASK) $(LIB_DEST)/.