summaryrefslogtreecommitdiff
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
parente9ca0738a4b18032151af42baca1f88629408d52 (diff)
downloadstage-00fb7e6f65faf72a85c72f3775e49345aeb7442f.tar.gz
stage-00fb7e6f65faf72a85c72f3775e49345aeb7442f.tar.bz2
stage-00fb7e6f65faf72a85c72f3775e49345aeb7442f.tar.xz
stage-00fb7e6f65faf72a85c72f3775e49345aeb7442f.zip
It now builds for windows, cool.
-rw-r--r--.gitignore2
-rw-r--r--mingw.bld121
-rw-r--r--test.stage12
3 files changed, 135 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e4e0594..28b0e0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,5 @@ stage
2.build_cache 2.build_cache
3.*.swp 3.*.swp
4*.o 4*.o
5*.win_o
6libbu++
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
diff --git a/test.stage b/test.stage
index 3fa32c0..516471d 100644
--- a/test.stage
+++ b/test.stage
@@ -32,16 +32,23 @@ function myGoto( txt )
32 goto( txt ); 32 goto( txt );
33} 33}
34 34
35function getThing()
36{
37 display( situation.thing );
38}
39
35situation <<start>> 40situation <<start>>
36{ 41{
37 setup 42 setup
38 { 43 {
44 situation.thing = 55;
39 player.name = "Bob"; 45 player.name = "Bob";
40 name = player.name + "o"; 46 name = player.name + "o";
41 name += " The Man"; 47 name += " The Man";
42 display("This is the setup phase for start, " + name); 48 display("This is the setup phase for start, " + name);
43 sillyDisplay( "Hello", name == player.name ); 49 sillyDisplay( "Hello", name == player.name );
44 50
51 getThing();
45 myGoto( <<stuff>> ); 52 myGoto( <<stuff>> );
46 display("You shouldn't see this."); 53 display("You shouldn't see this.");
47 } 54 }
@@ -54,8 +61,13 @@ situation <<start>>
54 61
55situation <<stuff>> 62situation <<stuff>>
56{ 63{
64 setup
65 {
66 situation.thing = "Just a thing";
67 }
57 enter 68 enter
58 { 69 {
70 getThing();
59 display('''Entered stuff''' + player.name); 71 display('''Entered stuff''' + player.name);
60 count = 0; 72 count = 0;
61 while count < 5 do 73 while count < 5 do