diff options
-rw-r--r-- | build.conf | 35 | ||||
-rwxr-xr-x | build.sh | 60 | ||||
-rw-r--r-- | default.bld | 56 | ||||
-rw-r--r-- | version | 1 |
4 files changed, 87 insertions, 65 deletions
diff --git a/build.conf b/build.conf deleted file mode 100644 index cab11a8..0000000 --- a/build.conf +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | # build.conf for build, kind of whacky, eh? | ||
2 | |||
3 | default action: check targets() | ||
4 | |||
5 | set "CXXFLAGS" += "-ggdb -W -Wall" | ||
6 | |||
7 | "build": | ||
8 | rule "exe", | ||
9 | target file, | ||
10 | requires "libbu++/libbu++.a", | ||
11 | set "LDFLAGS" += "-Llibbu++ -lbu++ -ldl", | ||
12 | set "CXXFLAGS" += "-Ilibbu++", | ||
13 | input filesIn("src") filter regexp(".*\\.(cpp|y|l)$") | ||
14 | |||
15 | rule "exe": | ||
16 | matches regexp("(.*)\\.o$"), | ||
17 | aggregate toString(" "), | ||
18 | perform command("g++ -o {target} {match} {LDFLAGS}") | ||
19 | |||
20 | rule "cpp": | ||
21 | matches regexp("(.*)\\.(cpp|c)$"), | ||
22 | produces "{re:1}.o", | ||
23 | requires commandToList("g++ -M {CXXFLAGS} {match}", "make"), | ||
24 | perform command("g++ {CXXFLAGS} -c -o {target} {match}") | ||
25 | |||
26 | rule "bison": | ||
27 | matches regexp("(.*)\\.y$"), | ||
28 | produces ["{re:1}.tab.c", "{re:1}.tab.h", "{re:1}.output"], | ||
29 | perform command("bison -v -b{re:1} {match}") | ||
30 | |||
31 | rule "flex": | ||
32 | matches regexp("(.*)\\.l$"), | ||
33 | produces ["{re:1}.yy.c","{re:1}.yy.h"], | ||
34 | perform command("flex {FLEXFLAGS} {match}") | ||
35 | |||
@@ -33,12 +33,46 @@ function gpp() | |||
33 | bld "$1" "$2" || cmd CXX "$1" g++ -ggdb -fPIC -W -Wall -Iminibu -c -o "$1" "$2" | 33 | bld "$1" "$2" || cmd CXX "$1" g++ -ggdb -fPIC -W -Wall -Iminibu -c -o "$1" "$2" |
34 | } | 34 | } |
35 | 35 | ||
36 | function presetup() | ||
37 | { | ||
38 | for dir in minibu/src minibu/bu minibu/bu/compat; do | ||
39 | cmd MKDIR ${dir} mkdir -p ${dir} | ||
40 | done | ||
41 | cmd FAKE minibu/bu/autoconfig.h touch minibu/bu/autoconfig.h | ||
42 | for file in $(cd bootstrap; ls); do | ||
43 | cmd BOOTSTRAP minibu/bu/${file} cp bootstrap/${file} minibu/bu | ||
44 | done | ||
45 | for F in $BUSRC; do | ||
46 | bld minibu/src/$F || cmd WGET minibu/src/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/stable/$F -O minibu/src/$F | ||
47 | done | ||
48 | for F in $BUHDR; do | ||
49 | bld minibu/bu/$F || cmd WGET minibu/bu/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/stable/$F -O minibu/bu/$F | ||
50 | done | ||
51 | for F in $BUEXPSRC; do | ||
52 | bld minibu/src/$F || cmd WGET minibu/src/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/experimental/$F -O minibu/src/$F | ||
53 | done | ||
54 | for F in $BUEXPHDR; do | ||
55 | bld minibu/bu/$F || cmd WGET minibu/bu/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/experimental/$F -O minibu/bu/$F | ||
56 | done | ||
57 | for F in $BUCOMPAT; do | ||
58 | bld minibu/bu/$F || cmd WGET minibu/bu/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/$F -O minibu/bu/$F | ||
59 | done | ||
60 | |||
61 | bld src/build.tab.c src/build.y || cmd BISON src/build.tab.c bison -bsrc/build src/build.y | ||
62 | bld src/build.yy.c src/build.l || cmd FLEX src/build.yy.c flex src/build.l | ||
63 | } | ||
64 | |||
36 | if [ ! -z "$1" ]; then | 65 | if [ ! -z "$1" ]; then |
37 | if [ "$1" == "clean" -o "$1" == "-c" ]; then | 66 | if [ "$1" == "clean" -o "$1" == "-c" ]; then |
38 | echo "Cleaning up, deleting all object code and downloaded source code..." | 67 | echo "Cleaning up, deleting all object code and downloaded source code..." |
39 | echo | 68 | echo |
40 | rm -Rf minibu src/*.o | 69 | rm -Rf minibu src/*.o |
41 | exit | 70 | exit |
71 | elif [ "$1" == "setup" -o "$1" == "-s" ]; then | ||
72 | echo "Only preforming download / setup" | ||
73 | echo | ||
74 | presetup | ||
75 | exit | ||
42 | else | 76 | else |
43 | echo "The only option supported is \"clean\", otherwise run $0" | 77 | echo "The only option supported is \"clean\", otherwise run $0" |
44 | echo "with no parameters to compile build." | 78 | echo "with no parameters to compile build." |
@@ -47,31 +81,7 @@ if [ ! -z "$1" ]; then | |||
47 | fi | 81 | fi |
48 | fi | 82 | fi |
49 | 83 | ||
50 | for dir in minibu/src minibu/bu minibu/bu/compat; do | 84 | presetup |
51 | cmd MKDIR ${dir} mkdir -p ${dir} | ||
52 | done | ||
53 | cmd FAKE minibu/bu/autoconfig.h touch minibu/bu/autoconfig.h | ||
54 | for file in $(cd bootstrap; ls); do | ||
55 | cmd BOOTSTRAP minibu/bu/${file} cp bootstrap/${file} minibu/bu | ||
56 | done | ||
57 | for F in $BUSRC; do | ||
58 | bld minibu/src/$F || cmd WGET minibu/src/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/stable/$F -O minibu/src/$F | ||
59 | done | ||
60 | for F in $BUHDR; do | ||
61 | bld minibu/bu/$F || cmd WGET minibu/bu/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/stable/$F -O minibu/bu/$F | ||
62 | done | ||
63 | for F in $BUEXPSRC; do | ||
64 | bld minibu/src/$F || cmd WGET minibu/src/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/experimental/$F -O minibu/src/$F | ||
65 | done | ||
66 | for F in $BUEXPHDR; do | ||
67 | bld minibu/bu/$F || cmd WGET minibu/bu/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/experimental/$F -O minibu/bu/$F | ||
68 | done | ||
69 | for F in $BUCOMPAT; do | ||
70 | bld minibu/bu/$F || cmd WGET minibu/bu/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/$F -O minibu/bu/$F | ||
71 | done | ||
72 | |||
73 | bld src/build.tab.c src/build.y || cmd BISON src/build.tab.c bison -bsrc/build src/build.y | ||
74 | bld src/build.yy.c src/build.l || cmd FLEX src/build.yy.c flex src/build.l | ||
75 | 85 | ||
76 | for F in $BUSRC $BUEXPSRC; do | 86 | for F in $BUSRC $BUEXPSRC; do |
77 | OUTPUT=${F%.*}.o | 87 | OUTPUT=${F%.*}.o |
diff --git a/default.bld b/default.bld index 6309518..fbf33df 100644 --- a/default.bld +++ b/default.bld | |||
@@ -70,10 +70,20 @@ for IN in files("src/plugins/*.cpp") do | |||
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | target "build-r$(svnversion "-n").tar.bz2" | 73 | target "minibu" |
74 | { | ||
75 | profile "build" | ||
76 | { | ||
77 | condition always; | ||
78 | execute("./build.sh setup"); | ||
79 | } | ||
80 | } | ||
81 | |||
82 | PKG_BASE = "build-$(cat version)-r$(svnversion "-n").tar"; | ||
83 | |||
84 | target PKG_BASE | ||
74 | { | 85 | { |
75 | input [ | 86 | input [ |
76 | "build.conf", | ||
77 | "Doxyfile", | 87 | "Doxyfile", |
78 | "default.bld", | 88 | "default.bld", |
79 | "docs/build.1", | 89 | "docs/build.1", |
@@ -83,15 +93,52 @@ target "build-r$(svnversion "-n").tar.bz2" | |||
83 | "support/vim/ftplugin/build.vim", | 93 | "support/vim/ftplugin/build.vim", |
84 | files("src/*.y"), | 94 | files("src/*.y"), |
85 | files("src/*.l"), | 95 | files("src/*.l"), |
96 | files("src/*.c"), | ||
86 | files("src/*.cpp"), | 97 | files("src/*.cpp"), |
87 | files("src/*.h"), | 98 | files("src/*.h"), |
88 | files("share/autoinclude/*"), | 99 | files("share/autoinclude/*"), |
89 | files("share/include/*") | 100 | files("share/include/*"), |
101 | "minibu", | ||
102 | files("minibu/bu/*"), | ||
103 | files("minibu/src/*") | ||
90 | ]; | 104 | ]; |
91 | rule "tarball"; | 105 | rule "tarball"; |
92 | tag "pkg"; | 106 | tag "pkg"; |
93 | } | 107 | } |
94 | 108 | ||
109 | target PKG_BASE + ".gz" | ||
110 | { | ||
111 | input PKG_BASE; | ||
112 | tag "pkg"; | ||
113 | display "gzip"; | ||
114 | profile "build" | ||
115 | { | ||
116 | execute("gzip -9 < ${INPUT} > ${OUTPUT}"); | ||
117 | } | ||
118 | } | ||
119 | |||
120 | target PKG_BASE + ".bz2" | ||
121 | { | ||
122 | input PKG_BASE; | ||
123 | tag "pkg"; | ||
124 | display "bzip2"; | ||
125 | profile "build" | ||
126 | { | ||
127 | execute("bzip2 -9 < ${INPUT} > ${OUTPUT}"); | ||
128 | } | ||
129 | } | ||
130 | |||
131 | target PKG_BASE + ".xz" | ||
132 | { | ||
133 | input PKG_BASE; | ||
134 | tag "pkg"; | ||
135 | display "xz"; | ||
136 | profile "build" | ||
137 | { | ||
138 | execute("xz -9vv < ${INPUT} > ${OUTPUT}"); | ||
139 | } | ||
140 | } | ||
141 | |||
95 | rule "tarball" | 142 | rule "tarball" |
96 | { | 143 | { |
97 | input matches("*.cpp", "*.h", "*.c", "*.y", "*.l", "*.conf", "Doxyfile", | 144 | input matches("*.cpp", "*.h", "*.c", "*.y", "*.l", "*.conf", "Doxyfile", |
@@ -99,8 +146,7 @@ rule "tarball" | |||
99 | profile "build" | 146 | profile "build" |
100 | { | 147 | { |
101 | OUTDIR = OUTPUT.replace(".tar.bz2",""); | 148 | OUTDIR = OUTPUT.replace(".tar.bz2",""); |
102 | execute("tar --transform=\"s@^@${OUTDIR}/@\" -c ${INPUT} |" | 149 | execute("tar -f ./${OUTPUT} --transform=\"s@^@${OUTDIR}/@\" -c ${INPUT}"); |
103 | " bzip2 -9 > ${OUTPUT}"); | ||
104 | } | 150 | } |
105 | } | 151 | } |
106 | 152 | ||
@@ -0,0 +1 @@ | |||
0.01 | |||