summaryrefslogtreecommitdiff
path: root/mingw.bld
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-12-30 09:29:51 -0700
committerMike Buland <eichlan@xagasoft.com>2011-12-30 09:29:51 -0700
commit00fb7e6f65faf72a85c72f3775e49345aeb7442f (patch)
tree0e7e7e231809e08ad7751db55715aaaa7a91d825 /mingw.bld
parente9ca0738a4b18032151af42baca1f88629408d52 (diff)
downloadstage-00fb7e6f65faf72a85c72f3775e49345aeb7442f.tar.gz
stage-00fb7e6f65faf72a85c72f3775e49345aeb7442f.tar.bz2
stage-00fb7e6f65faf72a85c72f3775e49345aeb7442f.tar.xz
stage-00fb7e6f65faf72a85c72f3775e49345aeb7442f.zip
It now builds for windows, cool.
Diffstat (limited to 'mingw.bld')
-rw-r--r--mingw.bld121
1 files changed, 121 insertions, 0 deletions
diff --git a/mingw.bld b/mingw.bld
new file mode 100644
index 0000000..f224fa0
--- /dev/null
+++ b/mingw.bld
@@ -0,0 +1,121 @@
1#build-m3 file for fishtrax client
2
3action "default"
4{
5 warning "Use the 'release' target to strip debugging and build without deps.";
6 DEBUG = "true";
7 build: ["stage.exe"];
8}
9
10action "release"
11{
12 warning "Relesae will build without deps, and will strip debugging.";
13 DEBUG = "false";
14 build: ["stage.exe"];
15}
16
17action "clean"
18{
19 clean: targets();
20}
21
22CXXFLAGS += "-ggdb";
23
24target "stage.exe"
25{
26 input [
27 files("src/*.cpp")
28// files("src/*.c")
29 ];
30 rule "winexe";
31
32 CXXFLAGS += "-O2 -frtti -fexceptions -Wall -Ilibbu++/support/windows -Isrc";
33
34 LDFLAGS += "-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -lmingw32 -Llibbu++ -lbu++win -Llibbu++/support/windows -lbz2";
35
36 CXXFLAGS += "-Ilibbu++";
37}
38
39rule "winlib"
40{
41 input "*.win_o";
42 profile "build"
43 {
44 execute("wine C:/MinGW/bin/ar.exe cr ${OUTPUT} ${INPUT}");
45 }
46}
47
48rule "winexe"
49{
50 input "*.win_o";
51 profile "build"
52 {
53 if DEBUG != "true" then
54 {
55 LDFLAGS += "-Wl,-s";
56 }
57 execute("wine C:/MinGW/bin/mingw32-g++.exe -o ${OUTPUT} ${INPUT} ${LDFLAGS}");
58 }
59}
60
61function cppToWinObj()
62{
63 if OBJ_DIR == null then
64 {
65 DIR = INPUT.dirName();
66 }
67 else
68 {
69 DIR = OBJ_DIR;
70 }
71
72 return DIR + "/" + INPUT.fileName().replace(".cpp", ".win_o");
73}
74
75function cToWinObj()
76{
77 if OBJ_DIR == null then
78 {
79 DIR = INPUT.dirName();
80 }
81 else
82 {
83 DIR = OBJ_DIR;
84 }
85
86 return DIR + "/" + INPUT.fileName().replace(".c", ".win_o");
87}
88
89function winDeps( CMD )
90{
91 if DEBUG == "true" then
92 {
93 return getMakeDeps( CMD );
94 }
95 return [];
96}
97
98rule "wincpp"
99{
100 input "*.cpp";
101 output INPUT.cppToWinObj();
102 requires winDeps("wine C:/MinGW/bin/g++.exe ${CXXFLAGS} -M ${INPUT}");
103 profile "build"
104 {
105 //condition always;
106 execute("wine C:/MinGW/bin/mingw32-g++.exe ${CXXFLAGS} -c -o ${OUTPUT} ${INPUT}", "g++");
107 }
108}
109
110rule "winc"
111{
112 input "*.c";
113 output INPUT.cToWinObj();
114 requires winDeps("wine C:/MinGW/bin/g++.exe ${CXXFLAGS} -M ${INPUT}");
115 profile "build"
116 {
117 //condition always;
118 execute("wine C:/MinGW/bin/mingw32-g++.exe ${CXXFLAGS} -c -o ${OUTPUT} ${INPUT}", "g++");
119 }
120}
121