| 1 |
# Makefile to build the LDC compiler runtime D library for Linux |
|---|
| 2 |
# Designed to work with GNU make |
|---|
| 3 |
# Targets: |
|---|
| 4 |
# make |
|---|
| 5 |
# Same as make all |
|---|
| 6 |
# make lib |
|---|
| 7 |
# Build the compiler runtime library |
|---|
| 8 |
# make doc |
|---|
| 9 |
# Generate documentation |
|---|
| 10 |
# make clean |
|---|
| 11 |
# Delete unneeded files created by build process |
|---|
| 12 |
|
|---|
| 13 |
LIB_TARGET_FULL=libldc-runtime.a |
|---|
| 14 |
LIB_TARGET_BC_ONLY=libldc-runtime-bc-only.a |
|---|
| 15 |
LIB_TARGET_C_ONLY=libldc-runtime-c-only.a |
|---|
| 16 |
LIB_TARGET_SHARED=libldc-runtime-shared.so |
|---|
| 17 |
LIB_MASK=libldc-runtime*.* |
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
CP=cp -f |
|---|
| 21 |
RM=rm -f |
|---|
| 22 |
MD=mkdir -p |
|---|
| 23 |
|
|---|
| 24 |
#CFLAGS=-O3 $(ADD_CFLAGS) |
|---|
| 25 |
CFLAGS=$(ADD_CFLAGS) |
|---|
| 26 |
|
|---|
| 27 |
#DFLAGS=-release -O3 -inline -w $(ADD_DFLAGS) |
|---|
| 28 |
DFLAGS=-w $(ADD_DFLAGS) |
|---|
| 29 |
|
|---|
| 30 |
#TFLAGS=-O3 -inline -w $(ADD_DFLAGS) |
|---|
| 31 |
TFLAGS=-w $(ADD_DFLAGS) |
|---|
| 32 |
|
|---|
| 33 |
DOCFLAGS=-version=DDoc |
|---|
| 34 |
|
|---|
| 35 |
CC=gcc |
|---|
| 36 |
LC=llvm-ar rsv |
|---|
| 37 |
LLINK=llvm-link |
|---|
| 38 |
LCC=llc |
|---|
| 39 |
CLC=ar rsv |
|---|
| 40 |
DC=ldc |
|---|
| 41 |
LLC=llvm-as |
|---|
| 42 |
|
|---|
| 43 |
LIB_DEST=.. |
|---|
| 44 |
|
|---|
| 45 |
.SUFFIXES: .s .S .c .cpp .d .ll .html .o .bc |
|---|
| 46 |
|
|---|
| 47 |
.s.o: |
|---|
| 48 |
$(CC) -c $(CFLAGS) $< -o$@ |
|---|
| 49 |
|
|---|
| 50 |
.S.o: |
|---|
| 51 |
$(CC) -c $(CFLAGS) $< -o$@ |
|---|
| 52 |
|
|---|
| 53 |
.c.o: |
|---|
| 54 |
$(CC) -c $(CFLAGS) $< -o$@ |
|---|
| 55 |
|
|---|
| 56 |
.cpp.o: |
|---|
| 57 |
g++ -c $(CFLAGS) $< -o$@ |
|---|
| 58 |
|
|---|
| 59 |
.d.o: |
|---|
| 60 |
$(DC) -c $(DFLAGS) $< -of$@ -output-bc |
|---|
| 61 |
|
|---|
| 62 |
.d.html: |
|---|
| 63 |
$(DC) -c -o- $(DOCFLAGS) -Df$*.html ldc.ddoc $< |
|---|
| 64 |
|
|---|
| 65 |
targets : lib sharedlib doc |
|---|
| 66 |
all : lib sharedlib doc |
|---|
| 67 |
#lib : ldc.bclib ldc.clib ldc.lib |
|---|
| 68 |
lib : ldc.clib ldc.lib |
|---|
| 69 |
sharedlib : ldc.sharedlib |
|---|
| 70 |
doc : ldc.doc |
|---|
| 71 |
|
|---|
| 72 |
###################################################### |
|---|
| 73 |
OBJ_C= \ |
|---|
| 74 |
monitor.o \ |
|---|
| 75 |
critical.o |
|---|
| 76 |
|
|---|
| 77 |
OBJ_BASE_BC= \ |
|---|
| 78 |
aaA.bc \ |
|---|
| 79 |
aApply.bc \ |
|---|
| 80 |
aApplyR.bc \ |
|---|
| 81 |
adi.bc \ |
|---|
| 82 |
arrayInit.bc \ |
|---|
| 83 |
cast.bc \ |
|---|
| 84 |
dmain2.bc \ |
|---|
| 85 |
eh.bc \ |
|---|
| 86 |
genobj.bc \ |
|---|
| 87 |
lifetime.bc \ |
|---|
| 88 |
memory.bc \ |
|---|
| 89 |
qsort2.bc \ |
|---|
| 90 |
switch.bc \ |
|---|
| 91 |
invariant.bc |
|---|
| 92 |
|
|---|
| 93 |
OBJ_UTIL_BC= \ |
|---|
| 94 |
util/console.bc \ |
|---|
| 95 |
util/ctype.bc \ |
|---|
| 96 |
util/string.bc \ |
|---|
| 97 |
util/utf.bc |
|---|
| 98 |
|
|---|
| 99 |
OBJ_LDC_BC= \ |
|---|
| 100 |
ldc/bitmanip.bc \ |
|---|
| 101 |
ldc/vararg.bc |
|---|
| 102 |
|
|---|
| 103 |
OBJ_TI_BC= \ |
|---|
| 104 |
typeinfo/ti_AC.bc \ |
|---|
| 105 |
typeinfo/ti_Acdouble.bc \ |
|---|
| 106 |
typeinfo/ti_Acfloat.bc \ |
|---|
| 107 |
typeinfo/ti_Acreal.bc \ |
|---|
| 108 |
typeinfo/ti_Adouble.bc \ |
|---|
| 109 |
typeinfo/ti_Afloat.bc \ |
|---|
| 110 |
typeinfo/ti_Ag.bc \ |
|---|
| 111 |
typeinfo/ti_Aint.bc \ |
|---|
| 112 |
typeinfo/ti_Along.bc \ |
|---|
| 113 |
typeinfo/ti_Areal.bc \ |
|---|
| 114 |
typeinfo/ti_Ashort.bc \ |
|---|
| 115 |
typeinfo/ti_byte.bc \ |
|---|
| 116 |
typeinfo/ti_C.bc \ |
|---|
| 117 |
typeinfo/ti_cdouble.bc \ |
|---|
| 118 |
typeinfo/ti_cfloat.bc \ |
|---|
| 119 |
typeinfo/ti_char.bc \ |
|---|
| 120 |
typeinfo/ti_creal.bc \ |
|---|
| 121 |
typeinfo/ti_dchar.bc \ |
|---|
| 122 |
typeinfo/ti_delegate.bc \ |
|---|
| 123 |
typeinfo/ti_double.bc \ |
|---|
| 124 |
typeinfo/ti_float.bc \ |
|---|
| 125 |
typeinfo/ti_idouble.bc \ |
|---|
| 126 |
typeinfo/ti_ifloat.bc \ |
|---|
| 127 |
typeinfo/ti_int.bc \ |
|---|
| 128 |
typeinfo/ti_ireal.bc \ |
|---|
| 129 |
typeinfo/ti_long.bc \ |
|---|
| 130 |
typeinfo/ti_ptr.bc \ |
|---|
| 131 |
typeinfo/ti_real.bc \ |
|---|
| 132 |
typeinfo/ti_short.bc \ |
|---|
| 133 |
typeinfo/ti_ubyte.bc \ |
|---|
| 134 |
typeinfo/ti_uint.bc \ |
|---|
| 135 |
typeinfo/ti_ulong.bc \ |
|---|
| 136 |
typeinfo/ti_ushort.bc \ |
|---|
| 137 |
typeinfo/ti_void.bc \ |
|---|
| 138 |
typeinfo/ti_wchar.bc |
|---|
| 139 |
|
|---|
| 140 |
OBJ_BASE_O= \ |
|---|
| 141 |
aaA.o \ |
|---|
| 142 |
aApply.o \ |
|---|
| 143 |
aApplyR.o \ |
|---|
| 144 |
adi.o \ |
|---|
| 145 |
arrayInit.o \ |
|---|
| 146 |
cast.o \ |
|---|
| 147 |
dmain2.o \ |
|---|
| 148 |
eh.o \ |
|---|
| 149 |
genobj.o \ |
|---|
| 150 |
lifetime.o \ |
|---|
| 151 |
memory.o \ |
|---|
| 152 |
qsort2.o \ |
|---|
| 153 |
switch.o \ |
|---|
| 154 |
invariant.o |
|---|
| 155 |
|
|---|
| 156 |
OBJ_UTIL_O= \ |
|---|
| 157 |
util/console.o \ |
|---|
| 158 |
util/ctype.o \ |
|---|
| 159 |
util/string.o \ |
|---|
| 160 |
util/utf.o |
|---|
| 161 |
|
|---|
| 162 |
OBJ_LDC_O= \ |
|---|
| 163 |
ldc/bitmanip.o \ |
|---|
| 164 |
ldc/vararg.o |
|---|
| 165 |
|
|---|
| 166 |
OBJ_TI_O= \ |
|---|
| 167 |
typeinfo/ti_AC.o \ |
|---|
| 168 |
typeinfo/ti_Acdouble.o \ |
|---|
| 169 |
typeinfo/ti_Acfloat.o \ |
|---|
| 170 |
typeinfo/ti_Acreal.o \ |
|---|
| 171 |
typeinfo/ti_Adouble.o \ |
|---|
| 172 |
typeinfo/ti_Afloat.o \ |
|---|
| 173 |
typeinfo/ti_Ag.o \ |
|---|
| 174 |
typeinfo/ti_Aint.o \ |
|---|
| 175 |
typeinfo/ti_Along.o \ |
|---|
| 176 |
typeinfo/ti_Areal.o \ |
|---|
| 177 |
typeinfo/ti_Ashort.o \ |
|---|
| 178 |
typeinfo/ti_byte.o \ |
|---|
| 179 |
typeinfo/ti_C.o \ |
|---|
| 180 |
typeinfo/ti_cdouble.o \ |
|---|
| 181 |
typeinfo/ti_cfloat.o \ |
|---|
| 182 |
typeinfo/ti_char.o \ |
|---|
| 183 |
typeinfo/ti_creal.o \ |
|---|
| 184 |
typeinfo/ti_dchar.o \ |
|---|
| 185 |
typeinfo/ti_delegate.o \ |
|---|
| 186 |
typeinfo/ti_double.o \ |
|---|
| 187 |
typeinfo/ti_float.o \ |
|---|
| 188 |
typeinfo/ti_idouble.o \ |
|---|
| 189 |
typeinfo/ti_ifloat.o \ |
|---|
| 190 |
typeinfo/ti_int.o \ |
|---|
| 191 |
typeinfo/ti_ireal.o \ |
|---|
| 192 |
typeinfo/ti_long.o \ |
|---|
| 193 |
typeinfo/ti_ptr.o \ |
|---|
| 194 |
typeinfo/ti_real.o \ |
|---|
| 195 |
typeinfo/ti_short.o \ |
|---|
| 196 |
typeinfo/ti_ubyte.o \ |
|---|
| 197 |
typeinfo/ti_uint.o \ |
|---|
| 198 |
typeinfo/ti_ulong.o \ |
|---|
| 199 |
typeinfo/ti_ushort.o \ |
|---|
| 200 |
typeinfo/ti_void.o \ |
|---|
| 201 |
typeinfo/ti_wchar.o |
|---|
| 202 |
|
|---|
| 203 |
ALL_OBJS_BC= \ |
|---|
| 204 |
$(OBJ_BASE_BC) \ |
|---|
| 205 |
$(OBJ_UTIL_BC) \ |
|---|
| 206 |
$(OBJ_TI_BC) \ |
|---|
| 207 |
$(OBJ_LDC_BC) |
|---|
| 208 |
|
|---|
| 209 |
ALL_OBJS_O= \ |
|---|
| 210 |
$(OBJ_BASE_O) \ |
|---|
| 211 |
$(OBJ_UTIL_O) \ |
|---|
| 212 |
$(OBJ_TI_O) \ |
|---|
| 213 |
$(OBJ_LDC_O) \ |
|---|
| 214 |
$(OBJ_C) |
|---|
| 215 |
|
|---|
| 216 |
###################################################### |
|---|
| 217 |
|
|---|
| 218 |
ALL_DOCS= |
|---|
| 219 |
|
|---|
| 220 |
###################################################### |
|---|
| 221 |
|
|---|
| 222 |
#ldc.bclib : $(LIB_TARGET_BC_ONLY) |
|---|
| 223 |
ldc.clib : $(LIB_TARGET_C_ONLY) |
|---|
| 224 |
ldc.lib : $(LIB_TARGET_FULL) |
|---|
| 225 |
ldc.sharedlib : $(LIB_TARGET_SHARED) |
|---|
| 226 |
|
|---|
| 227 |
#$(LIB_TARGET_BC_ONLY) : $(ALL_OBJS_O) |
|---|
| 228 |
# $(RM) $@ |
|---|
| 229 |
# $(LC) $@ $(ALL_OBJS_BC) |
|---|
| 230 |
|
|---|
| 231 |
|
|---|
| 232 |
$(LIB_TARGET_FULL) : $(ALL_OBJS_O) |
|---|
| 233 |
$(RM) $@ |
|---|
| 234 |
$(CLC) $@ $(ALL_OBJS_O) |
|---|
| 235 |
|
|---|
| 236 |
|
|---|
| 237 |
$(LIB_TARGET_C_ONLY) : $(OBJ_C) |
|---|
| 238 |
$(RM) $@ |
|---|
| 239 |
$(CLC) $@ $(OBJ_C) |
|---|
| 240 |
|
|---|
| 241 |
|
|---|
| 242 |
$(LIB_TARGET_SHARED) : $(ALL_OBJS_O) |
|---|
| 243 |
$(RM) $@ |
|---|
| 244 |
$(CC) -shared -o $@ $(ALL_OBJS_O) |
|---|
| 245 |
|
|---|
| 246 |
|
|---|
| 247 |
ldc.doc : $(ALL_DOCS) |
|---|
| 248 |
echo No documentation available. |
|---|
| 249 |
|
|---|
| 250 |
###################################################### |
|---|
| 251 |
|
|---|
| 252 |
clean : |
|---|
| 253 |
find . -name "*.di" | xargs $(RM) |
|---|
| 254 |
# $(RM) $(ALL_OBJS_BC) |
|---|
| 255 |
$(RM) $(ALL_OBJS_O) |
|---|
| 256 |
$(RM) $(ALL_DOCS) |
|---|
| 257 |
$(RM) $(LIB_MASK) |
|---|
| 258 |
|
|---|
| 259 |
install : |
|---|
| 260 |
$(MD) $(LIB_DEST) |
|---|
| 261 |
$(CP) $(LIB_MASK) $(LIB_DEST)/. |
|---|