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
90 ######################################################
\r
93 core/bitmanip.html \
\r
94 core/exception.html \
\r
99 ######################################################
\r
103 ######################################################
\r
106 make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE) -unittest"
\r
109 make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE)"
\r
112 make -fposix.mak DC="$(DC)" LIB_BUILD="-d" DFLAGS="$(DFLAGS_DEBUG)"
\r
114 ######################################################
\r
116 core.lib : $(LIB_TARGET)
\r
118 $(LIB_TARGET) : $(ALL_OBJS)
\r
120 $(LC) $@ $(ALL_OBJS)
\r
122 core.doc : $(ALL_DOCS)
\r
123 echo Documentation generated.
\r
125 ######################################################
\r
129 core/bitmanip.o : core/bitmanip.d
\r
130 $(DC) -c $(DFLAGS) core/bitmanip.d -of$@
\r
134 core/memory_.o : core/memory.d
\r
135 $(DC) -c $(DFLAGS) -Hf$*.di $< -of$@
\r
139 core/thread.o : core/thread.d
\r
140 $(DC) -c $(DFLAGS) -d -Hf$*.di core/thread.d -of$@
\r
142 ######################################################
\r
145 find . -name "*.di" | xargs $(RM)
\r
148 find . -name "$(LIB_MASK)" | xargs $(RM)
\r
152 find . -name "*.di" -exec cp -f {} $(INC_DEST)/{} \;
\r
154 find . -name "*.html" -exec cp -f {} $(DOC_DEST)/{} \;
\r
156 find . -name "$(LIB_MASK)" -exec cp -f {} $(LIB_DEST)/{} \;
\r