1 # Makefile to build the D runtime library core components for Posix
\r
2 # Designed to work with GNU make
\r
7 # Build the common library
\r
9 # Generate documentation
\r
11 # Delete unneeded files created by build process
\r
13 LIB_BASE=libdruntime-core
\r
15 LIB_TARGET=$(LIB_BASE)$(LIB_BUILD).a
\r
16 LIB_MASK=$(LIB_BASE)*.a
\r
25 CFLAGS_RELEASE=-O $(ADD_CFLAGS)
\r
26 CFLAGS_DEBUG=-g $(ADD_CFLAGS)
\r
27 CFLAGS=$(CFLAGS_RELEASE)
\r
29 DFLAGS_RELEASE=-release -O -inline -w -nofloat $(ADD_DFLAGS)
\r
30 DFLAGS_DEBUG=-g -w -nofloat $(ADD_DFLAGS)
\r
31 DFLAGS=$(DFLAGS_RELEASE)
\r
33 TFLAGS_RELEASE=-O -inline -w -nofloat $(ADD_DFLAGS)
\r
34 TFLAGS_DEBUG=-g -w -nofloat $(ADD_DFLAGS)
\r
35 TFLAGS=$(TFLAGS_RELEASE)
\r
37 DOCFLAGS=-version=DDoc
\r
43 INC_DEST=../../import
\r
47 .SUFFIXES: .s .S .c .cpp .d .html .o
\r
50 $(CC) -c $(CFLAGS) $< -o$@
\r
53 $(CC) -c $(CFLAGS) $< -o$@
\r
56 $(CC) -c $(CFLAGS) $< -o$@
\r
59 g++ -c $(CFLAGS) $< -o$@
\r
62 $(DC) -c $(DFLAGS) -Hf$*.di $< -of$@
\r
63 # $(DC) -c $(DFLAGS) $< -of$@
\r
66 $(DC) -c -o- $(DOCFLAGS) -Df$*.html $<
\r
74 ######################################################
\r
91 ######################################################
\r
94 core/bitmanip.html \
\r
95 core/exception.html \
\r
101 ######################################################
\r
105 ######################################################
\r
108 make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE) -unittest"
\r
111 make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE)"
\r
114 make -fposix.mak DC="$(DC)" LIB_BUILD="-d" DFLAGS="$(DFLAGS_DEBUG)"
\r
116 ######################################################
\r
118 core.lib : $(LIB_TARGET)
\r
120 $(LIB_TARGET) : $(ALL_OBJS)
\r
122 $(LC) $@ $(ALL_OBJS)
\r
124 core.doc : $(ALL_DOCS)
\r
125 echo Documentation generated.
\r
127 ######################################################
\r
131 core/bitmanip.o : core/bitmanip.d
\r
132 $(DC) -c $(DFLAGS) core/bitmanip.d -of$@
\r
136 core/memory_.o : core/memory.d
\r
137 $(DC) -c $(DFLAGS) -Hf$*.di $< -of$@
\r
141 core/thread.o : core/thread.d
\r
142 $(DC) -c $(DFLAGS) -d -Hf$*.di core/thread.d -of$@
\r
146 core/vararg.o : core/vararg.d
\r
147 $(DC) -c $(TFLAGS) -Hf$*.di core/vararg.d -of$@
\r
149 ######################################################
\r
152 find . -name "*.di" | xargs $(RM)
\r
155 find . -name "$(LIB_MASK)" | xargs $(RM)
\r
159 find . -name "*.di" -exec cp -f {} $(INC_DEST)/{} \;
\r
161 find . -name "*.html" -exec cp -f {} $(DOC_DEST)/{} \;
\r
163 find . -name "$(LIB_MASK)" -exec cp -f {} $(LIB_DEST)/{} \;
\r