1 # Makefile to build the D runtime library core components for Posix
2 # Designed to work with GNU make
7 # Build the common library
9 # Generate documentation
11 # Delete unneeded files created by build process
13 LIB_BASE=libdruntime-core
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
47 .SUFFIXES: .s .S .c .cpp .d .html .o
50 $(CC) -c $(CFLAGS) $< -o$@
53 $(CC) -c $(CFLAGS) $< -o$@
56 $(CC) -c $(CFLAGS) $< -o$@
59 g++ -c $(CFLAGS) $< -o$@
62 $(DC) -c $(DFLAGS) -Hf$*.di $< -of$@
63 # $(DC) -c $(DFLAGS) $< -of$@
66 $(DC) -c -o- $(DOCFLAGS) -Df$*.html $<
74 ######################################################
91 ######################################################
101 ######################################################
105 ######################################################
108 make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE) -unittest"
111 make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE)"
114 make -fposix.mak DC="$(DC)" LIB_BUILD="-d" DFLAGS="$(DFLAGS_DEBUG)"
116 ######################################################
118 core.lib : $(LIB_TARGET)
120 $(LIB_TARGET) : $(ALL_OBJS)
124 core.doc : $(ALL_DOCS)
125 echo Documentation generated.
127 ######################################################
131 core/bitmanip.o : core/bitmanip.d
132 $(DC) -c $(DFLAGS) core/bitmanip.d -of$@
136 core/memory_.o : core/memory.d
137 $(DC) -c $(DFLAGS) -Hf$*.di $< -of$@
141 core/thread.o : core/thread.d
142 $(DC) -c $(DFLAGS) -d -Hf$*.di core/thread.d -of$@
146 core/vararg.o : core/vararg.d
147 $(DC) -c $(TFLAGS) -Hf$*.di core/vararg.d -of$@
149 ######################################################
152 find . -name "*.di" | xargs $(RM)
155 find . -name "$(LIB_MASK)" | xargs $(RM)
159 find . -name "*.di" -exec cp -f {} $(INC_DEST)/{} \;
161 find . -name "*.html" -exec cp -f {} $(DOC_DEST)/{} \;
163 find . -name "$(LIB_MASK)" -exec cp -f {} $(LIB_DEST)/{} \;