Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #857: Makefile.so

File Makefile.so, 13.7 kB (added by llucax, 2 years ago)

Makefile used to compile tango as a shared library using dmd

Line 
1
2 DC ?= dmd
3 CFLAGS ?= -g
4 DFLAGS ?= -gc
5
6 d_src := \
7     tango/time/Time.d \
8     tango/time/StopWatch.d \
9     tango/time/Clock.d \
10     tango/time/ISO8601.d \
11     tango/time/WallClock.d \
12     tango/time/chrono/GregorianBased.d \
13     tango/time/chrono/Hijri.d \
14     tango/time/chrono/Korean.d \
15     tango/time/chrono/Hebrew.d \
16     tango/time/chrono/ThaiBuddhist.d \
17     tango/time/chrono/Gregorian.d \
18     tango/time/chrono/Taiwan.d \
19     tango/time/chrono/Calendar.d \
20     tango/time/chrono/Japanese.d \
21     tango/util/PathUtil.d \
22     tango/util/digest/MerkleDamgard.d \
23     tango/util/digest/Ripemd128.d \
24     tango/util/digest/Ripemd160.d \
25     tango/util/digest/Sha0.d \
26     tango/util/digest/Sha01.d \
27     tango/util/digest/Md2.d \
28     tango/util/digest/Sha512.d \
29     tango/util/digest/Crc32.d \
30     tango/util/digest/Ripemd320.d \
31     tango/util/digest/Digest.d \
32     tango/util/digest/Ripemd256.d \
33     tango/util/digest/Whirlpool.d \
34     tango/util/digest/Tiger.d \
35     tango/util/digest/Sha256.d \
36     tango/util/digest/Md4.d \
37     tango/util/digest/Sha1.d \
38     tango/util/digest/Md5.d \
39     tango/util/Convert.d \
40     tango/util/encode/Base64.d \
41     tango/util/log/Trace.d \
42     tango/util/log/model/ILogger.d \
43     tango/util/log/AppendFiles.d \
44     tango/util/log/ConfigProps.d \
45     tango/util/log/LayoutDate.d \
46     tango/util/log/LayoutChainsaw.d \
47     tango/util/log/Config.d \
48     tango/util/log/AppendSocket.d \
49     tango/util/log/AppendMail.d \
50     tango/util/log/AppendConsole.d \
51     tango/util/log/Log.d \
52     tango/util/log/AppendFile.d \
53     tango/util/MinMax.d \
54     tango/util/container/model/IContainer.d \
55     tango/util/container/RedBlack.d \
56     tango/util/container/Container.d \
57     tango/util/container/SortedMap.d \
58     tango/util/container/HashMap.d \
59     tango/util/container/HashSet.d \
60     tango/util/container/Slink.d \
61     tango/util/container/CircularList.d \
62     tango/util/container/Clink.d \
63     tango/util/container/LinkedList.d \
64     tango/util/container/more/CacheMap.d \
65     tango/util/container/more/Stack.d \
66     tango/util/container/more/Vector.d \
67     tango/util/container/more/StackMap.d \
68     tango/util/container/more/HashFile.d \
69     tango/util/container/more/Heap.d \
70     tango/util/container/more/BitSet.d \
71     tango/util/ArgParser.d \
72     tango/math/ErrorFunction.d \
73     tango/math/Math.d \
74     tango/math/GammaFunction.d \
75     tango/math/internal/BiguintCore.d \
76     tango/math/internal/BignumX86.d \
77     tango/math/internal/BignumNoAsm.d \
78     tango/math/IEEE.d \
79     tango/math/Probability.d \
80     tango/math/BigInt.d \
81     tango/math/Elliptic.d \
82     tango/math/Bracket.d \
83     tango/math/Bessel.d \
84     tango/math/random/engines/ArraySource.d \
85     tango/math/random/engines/Twister.d \
86     tango/math/random/engines/KissCmwc.d \
87     tango/math/random/engines/URandom.d \
88     tango/math/random/engines/CMWC.d \
89     tango/math/random/engines/KISS.d \
90     tango/math/random/engines/Sync.d \
91     tango/math/random/Twister.d \
92     tango/math/random/Kiss.d \
93     tango/math/random/Ziggurat.d \
94     tango/math/random/Random.d \
95     tango/math/random/NormalSource.d \
96     tango/math/random/ExpSource.d \
97     tango/io/model/IBuffer.d \
98     tango/io/model/IConduit.d \
99     tango/io/model/IFile.d \
100     tango/io/Path.d \
101     tango/io/stream/Format.d \
102     tango/io/stream/Delimiters.d \
103     tango/io/stream/Endian.d \
104     tango/io/stream/Snoop.d \
105     tango/io/stream/Iterator.d \
106     tango/io/stream/Quotes.d \
107     tango/io/stream/Data.d \
108     tango/io/stream/Greedy.d \
109     tango/io/stream/Digester.d \
110     tango/io/stream/Buffered.d \
111     tango/io/stream/DataFile.d \
112     tango/io/stream/Text.d \
113     tango/io/stream/Lines.d \
114     tango/io/stream/Map.d \
115     tango/io/stream/Typed.d \
116     tango/io/stream/TextFile.d \
117     tango/io/stream/Utf.d \
118     tango/io/stream/Patterns.d \
119     tango/io/FilePath.d \
120     tango/io/vfs/model/Vfs.d \
121     tango/io/vfs/LinkedFolder.d \
122     tango/io/vfs/ZipFolder.d \
123     tango/io/vfs/FtpFolder.d \
124     tango/io/vfs/VirtualFolder.d \
125     tango/io/vfs/FileFolder.d \
126     tango/io/compress/BzipStream.d \
127     tango/io/compress/Zip.d \
128     tango/io/compress/ZlibStream.d \
129     tango/io/compress/c/zlib.d \
130     tango/io/compress/c/bzlib.d \
131     tango/io/UnicodeFile.d \
132     tango/io/Console.d \
133     tango/io/Stdout.d \
134     tango/io/device/FileMap.d \
135     tango/io/device/Device.d \
136     tango/io/device/SerialPort.d \
137     tango/io/device/BitBucket.d \
138     tango/io/device/ThreadPipe.d \
139     tango/io/device/TempFile.d \
140     tango/io/device/Conduit.d \
141     tango/io/device/File.d \
142     tango/io/device/Array.d \
143     tango/io/Buffer.d \
144     tango/io/FileScan.d \
145     tango/io/selector/model/ISelector.d \
146     tango/io/selector/PollSelector.d \
147     tango/io/selector/SelectorException.d \
148     tango/io/selector/SelectSelector.d \
149     tango/io/selector/EpollSelector.d \
150     tango/io/selector/Selector.d \
151     tango/io/selector/AbstractSelector.d \
152     tango/io/FileSystem.d \
153     tango/net/model/UriView.d \
154     tango/net/SocketListener.d \
155     tango/net/SSLSocketConduit.d \
156     tango/net/DatagramConduit.d \
157     tango/net/PKI.d \
158     tango/net/SSLServerSocket.d \
159     tango/net/util/PKI.d \
160     tango/net/util/MemCache.d \
161     tango/net/util/c/OpenSSL.d \
162     tango/net/ServerSocket.d \
163     tango/net/SocketConduit.d \
164     tango/net/Socket.d \
165     tango/net/InternetAddress.d \
166     tango/net/http/HttpGet.d \
167     tango/net/http/model/HttpParamsView.d \
168     tango/net/http/HttpTokens.d \
169     tango/net/http/HttpParams.d \
170     tango/net/http/HttpPost.d \
171     tango/net/http/HttpStack.d \
172     tango/net/http/HttpClient.d \
173     tango/net/http/HttpTriplet.d \
174     tango/net/http/HttpConst.d \
175     tango/net/http/HttpHeaders.d \
176     tango/net/http/ChunkStream.d \
177     tango/net/http/HttpCookies.d \
178     tango/net/device/Berkeley.d \
179     tango/net/device/Socket.d \
180     tango/net/device/Multicast.d \
181     tango/net/device/Datagram.d \
182     tango/net/device/LocalSocket.d \
183     tango/net/device/SSLSocket.d \
184     tango/net/MulticastConduit.d \
185     tango/net/Uri.d \
186     tango/net/ftp/FtpClient.d \
187     tango/net/ftp/Telnet.d \
188     tango/text/locale/Core.d \
189     tango/text/locale/Convert.d \
190     tango/text/locale/Data.d \
191     tango/text/locale/Collation.d \
192     tango/text/locale/Locale.d \
193     tango/text/locale/Posix.d \
194     tango/text/locale/Parse.d \
195     tango/text/Ascii.d \
196     tango/text/Regex.d \
197     tango/text/Unicode.d \
198     tango/text/Arguments.d \
199     tango/text/Util.d \
200     tango/text/Text.d \
201     tango/text/json/Json.d \
202     tango/text/json/JsonEscape.d \
203     tango/text/json/JsonParser.d \
204     tango/text/convert/Integer.d \
205     tango/text/convert/Format.d \
206     tango/text/convert/TimeStamp.d \
207     tango/text/convert/Float.d \
208     tango/text/convert/UnicodeBom.d \
209     tango/text/convert/DateTime.d \
210     tango/text/convert/Layout.d \
211     tango/text/convert/Utf.d \
212     tango/text/UnicodeData.d \
213     tango/text/xml/DocEntity.d \
214     tango/text/xml/Document.d \
215     tango/text/xml/DocPrinter.d \
216     tango/text/xml/DocTester.d \
217     tango/text/xml/PullParser.d \
218     tango/text/xml/SaxParser.d \
219     tango/text/Search.d \
220     tango/sys/Environment.d \
221     tango/sys/consts/sysctl.d \
222     tango/sys/consts/fcntl.d \
223     tango/sys/consts/unistd.d \
224     tango/sys/consts/errno.d \
225     tango/sys/consts/socket.d \
226     tango/sys/HomeFolder.d \
227     tango/sys/Process.d \
228     tango/sys/SharedLib.d \
229     tango/sys/Pipe.d \
230     tango/sys/Common.d \
231     tango/sys/linux/linux.d \
232     tango/sys/linux/consts/sysctl.d \
233     tango/sys/linux/consts/fcntl.d \
234     tango/sys/linux/consts/unistd.d \
235     tango/sys/linux/consts/errno.d \
236     tango/sys/linux/consts/socket.d \
237     tango/sys/linux/inotify.d \
238     tango/sys/linux/epoll.d \
239     tango/sys/linux/tipc.d \
240     tango/stdc/stddef.d \
241     tango/stdc/stdarg.d \
242     tango/stdc/wctype.d \
243     tango/stdc/tgmath.d \
244     tango/stdc/string.d \
245     tango/stdc/stringz.d \
246     tango/stdc/signal.d \
247     tango/stdc/stdint.d \
248     tango/stdc/time.d \
249     tango/stdc/inttypes.d \
250     tango/stdc/stdlib.d \
251     tango/stdc/math.d \
252     tango/stdc/posix/ucontext.d \
253     tango/stdc/posix/arpa/inet.d \
254     tango/stdc/posix/utime.d \
255     tango/stdc/posix/fcntl.d \
256     tango/stdc/posix/dirent.d \
257     tango/stdc/posix/setjmp.d \
258     tango/stdc/posix/signal.d \
259     tango/stdc/posix/pthread.d \
260     tango/stdc/posix/time.d \
261     tango/stdc/posix/inttypes.d \
262     tango/stdc/posix/netinet/tcp.d \
263     tango/stdc/posix/netinet/in_.d \
264     tango/stdc/posix/stdlib.d \
265     tango/stdc/posix/unistd.d \
266     tango/stdc/posix/config.d \
267     tango/stdc/posix/net/if_.d \
268     tango/stdc/posix/poll.d \
269     tango/stdc/posix/dlfcn.d \
270     tango/stdc/posix/sys/types.d \
271     tango/stdc/posix/sys/stat.d \
272     tango/stdc/posix/sys/select.d \
273     tango/stdc/posix/sys/uio.d \
274     tango/stdc/posix/sys/wait.d \
275     tango/stdc/posix/sys/time.d \
276     tango/stdc/posix/sys/ipc.d \
277     tango/stdc/posix/sys/utsname.d \
278     tango/stdc/posix/sys/socket.d \
279     tango/stdc/posix/sys/mman.d \
280     tango/stdc/posix/sys/shm.d \
281     tango/stdc/posix/sys/statvfs.d \
282     tango/stdc/posix/stdio.d \
283     tango/stdc/posix/langinfo.d \
284     tango/stdc/posix/pwd.d \
285     tango/stdc/posix/semaphore.d \
286     tango/stdc/posix/sched.d \
287     tango/stdc/posix/termios.d \
288     tango/stdc/ctype.d \
289     tango/stdc/errno.d \
290     tango/stdc/complex.d \
291     tango/stdc/config.d \
292     tango/stdc/limits.d \
293     tango/stdc/stdio.d \
294     tango/stdc/locale.d \
295     tango/stdc/fenv.d \
296     tango/core/Runtime.d \
297     tango/core/BitManip.d \
298     tango/core/BitArray.d \
299     tango/core/Signal.d \
300     tango/core/ThreadPool.d \
301     tango/core/Traits.d \
302     tango/core/Exception.d \
303     tango/core/Memory.d \
304     tango/core/Variant.d \
305     tango/core/Atomic.d \
306     tango/core/Vararg.d \
307     tango/core/Tuple.d \
308     tango/core/ByteSwap.d \
309     tango/core/Thread.d \
310     tango/core/sync/Mutex.d \
311     tango/core/sync/Condition.d \
312     tango/core/sync/Semaphore.d \
313     tango/core/sync/Config.d \
314     tango/core/sync/ReadWriteMutex.d \
315     tango/core/sync/Barrier.d \
316     tango/core/Version.d \
317     tango/core/WeakRef.d \
318     tango/core/RuntimeTraits.d \
319     tango/core/tools/LinuxStackTrace.d \
320     tango/core/tools/StackTrace.d \
321     tango/core/tools/Demangler.d \
322     tango/core/tools/TraceExceptions.d \
323     tango/core/tools/Cpuid.d \
324     tango/core/tools/WinStackTrace.d \
325     tango/core/rt/compiler/util/hash.d \
326     tango/core/rt/compiler/util/string.d \
327     tango/core/rt/compiler/util/console.d \
328     tango/core/rt/compiler/util/ctype.d \
329     tango/core/rt/compiler/util/utf.d \
330     tango/core/rt/compiler/util/cpuid.d \
331     tango/core/rt/compiler/dmd/invariant.d \
332     tango/core/rt/compiler/dmd/posix/deh.d \
333     tango/core/rt/compiler/dmd/posix/llmath.d \
334     tango/core/rt/compiler/dmd/typeinfo/ti_float.d \
335     tango/core/rt/compiler/dmd/typeinfo/ti_ubyte.d \
336     tango/core/rt/compiler/dmd/typeinfo/ti_C.d \
337     tango/core/rt/compiler/dmd/typeinfo/ti_short.d \
338     tango/core/rt/compiler/dmd/typeinfo/ti_AC.d \
339     tango/core/rt/compiler/dmd/typeinfo/ti_creal.d \
340     tango/core/rt/compiler/dmd/typeinfo/ti_cdouble.d \
341     tango/core/rt/compiler/dmd/typeinfo/ti_Areal.d \
342     tango/core/rt/compiler/dmd/typeinfo/ti_ushort.d \
343     tango/core/rt/compiler/dmd/typeinfo/ti_void.d \
344     tango/core/rt/compiler/dmd/typeinfo/ti_Along.d \
345     tango/core/rt/compiler/dmd/typeinfo/ti_Adouble.d \
346     tango/core/rt/compiler/dmd/typeinfo/ti_Afloat.d \
347     tango/core/rt/compiler/dmd/typeinfo/ti_dchar.d \
348     tango/core/rt/compiler/dmd/typeinfo/ti_Acreal.d \
349     tango/core/rt/compiler/dmd/typeinfo/ti_Aint.d \
350     tango/core/rt/compiler/dmd/typeinfo/ti_wchar.d \
351     tango/core/rt/compiler/dmd/typeinfo/ti_ulong.d \
352     tango/core/rt/compiler/dmd/typeinfo/ti_Acfloat.d \
353     tango/core/rt/compiler/dmd/typeinfo/ti_Acdouble.d \
354     tango/core/rt/compiler/dmd/typeinfo/ti_idouble.d \
355     tango/core/rt/compiler/dmd/typeinfo/ti_ptr.d \
356     tango/core/rt/compiler/dmd/typeinfo/ti_int.d \
357     tango/core/rt/compiler/dmd/typeinfo/ti_Ashort.d \
358     tango/core/rt/compiler/dmd/typeinfo/ti_delegate.d \
359     tango/core/rt/compiler/dmd/typeinfo/ti_long.d \
360     tango/core/rt/compiler/dmd/typeinfo/ti_Ag.d \
361     tango/core/rt/compiler/dmd/typeinfo/ti_ireal.d \
362     tango/core/rt/compiler/dmd/typeinfo/ti_double.d \
363     tango/core/rt/compiler/dmd/typeinfo/ti_uint.d \
364     tango/core/rt/compiler/dmd/typeinfo/ti_cfloat.d \
365     tango/core/rt/compiler/dmd/typeinfo/ti_real.d \
366     tango/core/rt/compiler/dmd/typeinfo/ti_char.d \
367     tango/core/rt/compiler/dmd/typeinfo/ti_byte.d \
368     tango/core/rt/compiler/dmd/typeinfo/ti_ifloat.d \
369     tango/core/rt/compiler/dmd/object_.d \
370     tango/core/rt/compiler/dmd/rt/aaA.d \
371     tango/core/rt/compiler/dmd/rt/adi.d \
372     tango/core/rt/compiler/dmd/rt/arrayint.d \
373     tango/core/rt/compiler/dmd/rt/cInterface.d \
374     tango/core/rt/compiler/dmd/rt/arraybyte.d \
375     tango/core/rt/compiler/dmd/rt/qsort.d \
376     tango/core/rt/compiler/dmd/rt/trace.d \
377     tango/core/rt/compiler/dmd/rt/cmath2.d \
378     tango/core/rt/compiler/dmd/rt/aApply.d \
379     tango/core/rt/compiler/dmd/rt/invariant_.d \
380     tango/core/rt/compiler/dmd/rt/switch_.d \
381     tango/core/rt/compiler/dmd/rt/cast_.d \
382     tango/core/rt/compiler/dmd/rt/memory.d \
383     tango/core/rt/compiler/dmd/rt/compiler.d \
384     tango/core/rt/compiler/dmd/rt/arraycast.d \
385     tango/core/rt/compiler/dmd/rt/memset.d \
386     tango/core/rt/compiler/dmd/rt/arraydouble.d \
387     tango/core/rt/compiler/dmd/rt/obj.d \
388     tango/core/rt/compiler/dmd/rt/alloca.d \
389     tango/core/rt/compiler/dmd/rt/lifetime.d \
390     tango/core/rt/compiler/dmd/rt/arrayshort.d \
391     tango/core/rt/compiler/dmd/rt/dmain2.d \
392     tango/core/rt/compiler/dmd/rt/aApplyR.d \
393     tango/core/rt/compiler/dmd/rt/arrayfloat.d \
394     tango/core/rt/compiler/dmd/rt/cover.d \
395     tango/core/rt/compiler/dmd/rt/arraycat.d \
396     tango/core/rt/compiler/dmd/rt/arrayreal.d \
397     tango/core/rt/gc/basic/gcstats.d \
398     tango/core/rt/gc/basic/gcx.d \
399     tango/core/rt/gc/basic/gc.d \
400     tango/core/rt/gc/basic/gcalloc.d \
401     tango/core/rt/gc/basic/gcbits.d \
402     tango/core/Array.d
403
404 c_src := \
405     tango/core/rt/compiler/util/wrap.c \
406     tango/core/rt/compiler/dmd/gcosx.c \
407     tango/core/rt/compiler/dmd/complex.c \
408     tango/core/rt/compiler/dmd/cConst.c \
409     tango/core/rt/compiler/dmd/monitor.c \
410     tango/core/rt/compiler/dmd/critical.c
411
412 a_src := \
413     tango/core/rt/compiler/util/ThreadASM.S
414
415 objs := $(addsuffix .o,$(addprefix obj/,$(d_src) $(c_src) $(a_src)))
416
417 override V := $(if $V,,@)
418
419 .PHONY: all
420 all: obj/libtango.so obj/libtango.a
421
422 obj/%.d.o: %.d
423     @mkdir -p obj/$(<D)
424     $(if $V,@echo $(DC) $@)
425     $V $(DC) $(DFLAGS) -I./tango/core -I. -I./tango/core/vendor \
426             -c -fPIC -of$@ $<
427
428 obj/%.c.o: %.c
429     @mkdir -p obj/$(<D)
430     $(if $V,@echo $(CC) $@)
431     $V $(CC) -c -m32 $(CFLAGS) $(CPPFLAGS) -fPIC -o$@ $<
432
433 obj/%.S.o: %.S
434     @mkdir -p obj/$(<D)
435     $(if $V,@echo $(CC) $@)
436     $V $(CC) -c -m32 $(CFLAGS) $(CPPFLAGS) -fPIC -o$@ $<
437
438 obj/libtango.so: $(objs)
439     $(if $V,@echo $(CC) $@)
440     $V $(CC) -o$@ $(LDFLAGS) -m32 -shared -Wl,-soname,libtango.so -Wall \
441             -L/lib32 -lz -lbz2 -lpthread -ldl -lm $^
442
443 obj/libtango.a: $(objs)
444     $(if $V,@echo $(AR) $@)
445     $V $(AR) -r $@ $^
446
447 .PHONY: clean
448 clean:
449     $V $(RM) -r obj
450