Mercurial > projects > ldc
annotate tango/lib/llvmdc-posix.mak @ 325:3c8c58c24aa8 trunk
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
Made runtime to compile to native by default. Changed linker.cpp to link in native runtime library.
This change requires a runtime rebuild as well as a new symbolic link in lib/ to tango/lib/libtango-base-llvmdc-native.a.
author | ChristianK |
---|---|
date | Thu, 10 Jul 2008 19:38:34 +0200 |
parents | 4c2689d57ba4 |
children |
rev | line source |
---|---|
132 | 1 # Makefile to build the composite D runtime 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 runtime library | |
8 # make doc | |
9 # Generate documentation | |
10 # make clean | |
11 # Delete unneeded files created by build process | |
12 | |
13 LIB_TARGET=libtango-base-llvmdc.a | |
14 LIB_MASK=libtango-base-llvmdc*.a | |
133
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
132
diff
changeset
|
15 LIB_TARGET_C=libtango-base-c-llvmdc.a |
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
132
diff
changeset
|
16 LIB_MASK_C=libtango-base-c-llvmdc*.a |
325
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
17 LIB_NAME_NATIVE=libtango-base-llvmdc-native |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
18 LIB_TARGET_NATIVE=$(LIB_NAME_NATIVE).a |
132 | 19 |
20 DIR_CC=./common/tango | |
21 DIR_RT=./compiler/llvmdc | |
212
4c2689d57ba4
[svn r228] Fixed: when new'ing basic types, the storage was not default initialized.
lindquist
parents:
203
diff
changeset
|
22 DIR_GC=./gc/basic |
4c2689d57ba4
[svn r228] Fixed: when new'ing basic types, the storage was not default initialized.
lindquist
parents:
203
diff
changeset
|
23 #DIR_GC=./gc/stub |
132 | 24 |
25 CP=cp -f | |
26 RM=rm -f | |
27 MD=mkdir -p | |
28 | |
29 CC=gcc | |
30 LC=llvm-ar rsv | |
133
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
132
diff
changeset
|
31 CLC=ar rsv |
132 | 32 DC=llvmdc |
325
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
33 LLVMLINK=llvm-link |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
34 LLC=llc |
132 | 35 |
36 ADD_CFLAGS= | |
37 ADD_DFLAGS= | |
38 | |
325
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
39 targets : nativelib doc |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
40 all : nativelib lib doc |
132 | 41 |
42 ###################################################### | |
43 | |
44 ALL_OBJS= | |
45 | |
46 ###################################################### | |
47 | |
48 ALL_DOCS= | |
49 | |
50 ###################################################### | |
51 | |
52 lib : $(ALL_OBJS) | |
53 make -C $(DIR_CC) -fllvmdc.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" | |
54 make -C $(DIR_RT) -fllvmdc.mak lib | |
55 make -C $(DIR_GC) -fllvmdc.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" | |
56 find . -name $(LIB_MASK) | xargs $(RM) | |
57 $(LC) $(LIB_TARGET) `find $(DIR_CC) -name "*.bc" | xargs echo` | |
58 $(LC) $(LIB_TARGET) `find $(DIR_RT) -name "*.bc" | xargs echo` | |
59 $(LC) $(LIB_TARGET) `find $(DIR_GC) -name "*.bc" | xargs echo` | |
133
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
132
diff
changeset
|
60 $(CLC) $(LIB_TARGET_C) `find $(DIR_CC) -name "*.o" | xargs echo` |
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
132
diff
changeset
|
61 $(CLC) $(LIB_TARGET_C) `find $(DIR_RT) -name "*.o" | xargs echo` |
132 | 62 |
325
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
63 nativelib: $(ALL_OBJS) |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
64 make -C $(DIR_CC) -fllvmdc.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
65 make -C $(DIR_RT) -fllvmdc.mak lib |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
66 make -C $(DIR_GC) -fllvmdc.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
67 |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
68 $(RM) $(LIB_NAME_NATIVE)* |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
69 |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
70 # first link all bcs together to a single bitcode file |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
71 $(LLVMLINK) -o=$(LIB_NAME_NATIVE)-llvm.bc `find $(DIR_CC) $(DIR_RT) $(DIR_GC) -name "*.bc"` |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
72 # then compile to assembler |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
73 $(LLC) -o=$(LIB_NAME_NATIVE)-llvm.s $(LIB_NAME_NATIVE)-llvm.bc |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
74 # assemble native code |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
75 $(CC) -c -o $(LIB_NAME_NATIVE)-llvm.o $(LIB_NAME_NATIVE)-llvm.s |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
76 # make an archive containing it and the other native object files |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
77 $(CLC) $(LIB_TARGET_NATIVE) $(LIB_NAME_NATIVE)-llvm.o `find $(DIR_CC) $(DIR_RT) -name "*.o"` |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
78 |
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
79 |
132 | 80 doc : $(ALL_DOCS) |
81 make -C $(DIR_CC) -fllvmdc.mak doc | |
82 make -C $(DIR_RT) -fllvmdc.mak doc | |
83 make -C $(DIR_GC) -fllvmdc.mak doc | |
84 | |
85 ###################################################### | |
86 | |
87 clean : | |
88 find . -name "*.di" | xargs $(RM) | |
89 $(RM) $(ALL_OBJS) | |
90 $(RM) $(ALL_DOCS) | |
91 make -C $(DIR_CC) -fllvmdc.mak clean | |
92 make -C $(DIR_RT) -fllvmdc.mak clean | |
93 make -C $(DIR_GC) -fllvmdc.mak clean | |
94 $(RM) $(LIB_MASK) | |
133
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
132
diff
changeset
|
95 $(RM) $(LIB_MASK_C) |
325
3c8c58c24aa8
[svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
ChristianK
parents:
212
diff
changeset
|
96 $(RM) $(LIB_NAME_NATIVE)* |
132 | 97 |
98 install : | |
99 make -C $(DIR_CC) -fllvmdc.mak install | |
100 make -C $(DIR_RT) -fllvmdc.mak install | |
101 make -C $(DIR_GC) -fllvmdc.mak install | |
133
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
132
diff
changeset
|
102 $(CP) $(LIB_MASK) $(LIB_DEST)/. |
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
132
diff
changeset
|
103 $(CP) $(LIB_MASK_C) $(LIB_DEST)/. |