1 # Makefile to build the compiler runtime D library for Linux
2 # Designed to work with GNU make
7 # Build the compiler runtime library
9 # Generate documentation
11 # Delete unneeded files created by build process
13 LIB_BASE=libdruntime-rt-dmd
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 dmd.ddoc $<
70 ######################################################
106 # NOTE: trace.obj and cover.obj are not necessary for a successful build
107 # as both are used for debugging features (profiling and coverage)
108 # NOTE: a pre-compiled minit.obj has been provided in dmd for Win32 and
109 # minit.asm is not used by dmd for linux
110 # NOTE: deh.o is only needed for Win32, linux uses deh2.o
121 typeinfo/ti_Acdouble.o \
122 typeinfo/ti_Acfloat.o \
123 typeinfo/ti_Acreal.o \
124 typeinfo/ti_Adouble.o \
125 typeinfo/ti_Afloat.o \
128 typeinfo/ti_Along.o \
129 typeinfo/ti_Areal.o \
130 typeinfo/ti_Ashort.o \
133 typeinfo/ti_cdouble.o \
134 typeinfo/ti_cfloat.o \
136 typeinfo/ti_creal.o \
137 typeinfo/ti_dchar.o \
138 typeinfo/ti_delegate.o \
139 typeinfo/ti_double.o \
140 typeinfo/ti_float.o \
141 typeinfo/ti_idouble.o \
142 typeinfo/ti_ifloat.o \
144 typeinfo/ti_ireal.o \
148 typeinfo/ti_short.o \
149 typeinfo/ti_ubyte.o \
151 typeinfo/ti_ulong.o \
152 typeinfo/ti_ushort.o \
161 ######################################################
165 ######################################################
168 make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE) -unittest"
171 make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE)"
174 make -fposix.mak DC="$(DC)" LIB_BUILD="-d" DFLAGS="$(DFLAGS_DEBUG)"
176 ######################################################
178 dmd.lib : $(LIB_TARGET)
180 $(LIB_TARGET) : $(ALL_OBJS)
184 dmd.doc : $(ALL_DOCS)
185 echo No documentation available.
187 ######################################################
190 find . -name "*.di" | xargs $(RM)
197 $(CP) $(LIB_MASK) $(LIB_DEST)/.