comparison runtime/internal/ldc.mak @ 665:d8a1481eaa0c

Renames.
author Christian Kamm <kamm incasoftware de>
date Mon, 06 Oct 2008 22:56:54 +0200
parents runtime/internal/llvmdc.mak@6aaa3d3c1183
children 299f53f2e6f2
comparison
equal deleted inserted replaced
664:eef8ac26c66c 665:d8a1481eaa0c
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.bc:
60 $(DC) -c $(DFLAGS) $< -of$@
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.lib ldc.bclib ldc.clib
68 sharedlib : ldc.sharedlib
69 doc : ldc.doc
70
71 ######################################################
72 OBJ_C= \
73 monitor.o \
74 critical.o
75
76 OBJ_BASE= \
77 aaA.bc \
78 aApply.bc \
79 aApplyR.bc \
80 adi.bc \
81 arrayInit.bc \
82 cast.bc \
83 dmain2.bc \
84 eh.bc \
85 genobj.bc \
86 lifetime.bc \
87 memory.bc \
88 qsort2.bc \
89 switch.bc \
90 invariant.bc
91
92 OBJ_UTIL= \
93 util/console.bc \
94 util/ctype.bc \
95 util/string.bc \
96 util/utf.bc
97
98 OBJ_LDC= \
99 ldc/bitmanip.bc \
100 ldc/vararg.bc
101
102 OBJ_TI= \
103 typeinfo/ti_AC.bc \
104 typeinfo/ti_Acdouble.bc \
105 typeinfo/ti_Acfloat.bc \
106 typeinfo/ti_Acreal.bc \
107 typeinfo/ti_Adouble.bc \
108 typeinfo/ti_Afloat.bc \
109 typeinfo/ti_Ag.bc \
110 typeinfo/ti_Aint.bc \
111 typeinfo/ti_Along.bc \
112 typeinfo/ti_Areal.bc \
113 typeinfo/ti_Ashort.bc \
114 typeinfo/ti_byte.bc \
115 typeinfo/ti_C.bc \
116 typeinfo/ti_cdouble.bc \
117 typeinfo/ti_cfloat.bc \
118 typeinfo/ti_char.bc \
119 typeinfo/ti_creal.bc \
120 typeinfo/ti_dchar.bc \
121 typeinfo/ti_delegate.bc \
122 typeinfo/ti_double.bc \
123 typeinfo/ti_float.bc \
124 typeinfo/ti_idouble.bc \
125 typeinfo/ti_ifloat.bc \
126 typeinfo/ti_int.bc \
127 typeinfo/ti_ireal.bc \
128 typeinfo/ti_long.bc \
129 typeinfo/ti_ptr.bc \
130 typeinfo/ti_real.bc \
131 typeinfo/ti_short.bc \
132 typeinfo/ti_ubyte.bc \
133 typeinfo/ti_uint.bc \
134 typeinfo/ti_ulong.bc \
135 typeinfo/ti_ushort.bc \
136 typeinfo/ti_void.bc \
137 typeinfo/ti_wchar.bc
138
139 ALL_OBJS= \
140 $(OBJ_BASE) \
141 $(OBJ_UTIL) \
142 $(OBJ_TI) \
143 $(OBJ_LDC)
144
145 ######################################################
146
147 ALL_DOCS=
148
149 ######################################################
150
151 ldc.bclib : $(LIB_TARGET_BC_ONLY)
152 ldc.clib : $(LIB_TARGET_C_ONLY)
153 ldc.lib : $(LIB_TARGET_FULL)
154 ldc.sharedlib : $(LIB_TARGET_SHARED)
155
156 $(LIB_TARGET_BC_ONLY) : $(ALL_OBJS)
157 $(RM) $@
158 $(LC) $@ $(ALL_OBJS)
159
160
161 $(LIB_TARGET_FULL) : $(ALL_OBJS) $(OBJ_C)
162 $(RM) $@ $@.bc $@.s $@.o
163 $(LLINK) -o=$@.bc $(ALL_OBJS)
164 $(LCC) -o=$@.s $@.bc
165 $(CC) -c -o $@.o $@.s
166 $(CLC) $@ $@.o $(OBJ_C)
167
168
169 $(LIB_TARGET_C_ONLY) : $(OBJ_C)
170 $(RM) $@
171 $(CLC) $@ $(OBJ_C)
172
173
174 $(LIB_TARGET_SHARED) : $(ALL_OBJS) $(OBJ_C)
175 $(RM) $@ $@.bc $@.s $@.o
176 $(LLINK) -o=$@.bc $(ALL_OBJS)
177 $(LCC) -relocation-model=pic -o=$@.s $@.bc
178 $(CC) -c -o $@.o $@.s
179 $(CC) -shared -o $@ $@.o $(OBJ_C)
180
181
182 ldc.doc : $(ALL_DOCS)
183 echo No documentation available.
184
185 ######################################################
186
187 clean :
188 find . -name "*.di" | xargs $(RM)
189 $(RM) $(ALL_OBJS)
190 $(RM) $(OBJ_C)
191 $(RM) $(ALL_DOCS)
192 $(RM) $(LIB_MASK)
193
194 install :
195 $(MD) $(LIB_DEST)
196 $(CP) $(LIB_MASK) $(LIB_DEST)/.