-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-SiOO
executable file
·155 lines (134 loc) · 4.97 KB
/
make-SiOO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/bin/sh
#TODO we want to take some arguments specifying which targets to build
# targets are:
# # Present and working...
# [default: build all] no argument at all
# # targets that need to be written...
# install [local | prefix]
# build [agentball | agent | binary | tarball | all | cli | kernel | dox | demos ]
# (tarball target is a binary install wad with configure script)
# (binary is a kernel build without a built-in parser, this build
# can only load rete-nets it CANNOT load text productions)
# (agent is a binary build with a preloaded rete-net found in a
# directory named "AgentName" in the build root (make-SiO2) )
# (agentball is an agent in a tarball with an install script)
# echo "Assert: We should be in the root of the SiOO directory"
# pwd && sleep 2
#### R A T I O N A L E F O R bin/sh B U I L D S C R I P T ####
#
# /bin/sh is ubiquitous and should be POSIX (ish) everywhere.
# /bin/bash is a very popular shell, it runs this file just fine.
# Anyone familiar with *nix toolset can read this file just fine.
# This is meant to be naive, trivial, **clear** and _diagnosable_
# No tricks, just simple shell code with literate notation.
#
#####################################################################
echo "\n\n"
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo " * Cleaning up the previous build and old files... *"
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo ""
#echo "We should be in sioo/: "
#echo "We are in $PWD"
#sleep 1
echo "Cleaning the output directory of all files..."
cd out && pwd && rm *.a && rm *.h && rm sioo && rm SiOO && echo "Successful!"
cd ..
#echo "We should be in sioo/: "
#echo "We are in $PWD"
#sleep 1
echo "Cleaning the kernel build area..."
cd kernel && pwd && make distclean && echo "Successful!"
cd ..
#echo "We should be in sioo/: "
#echo "We are in $PWD"
#sleep 1
echo "Cleaning the command line interface build area..."
cd cli && pwd && make distclean && echo "Successful!"
cd ..
echo "\n\n"
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo " * Next we build the kernel and SiOO_api *"
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo ""
#echo "We should be in sioo/: "
#echo "We are in $PWD"
#sleep 1
#First (second) we build the kernel
cd kernel && chmod u+x ./configure \
&& ./configure && make && echo "Succesful!"
echo "\n"
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo " * Next lets move our finished output to the ../out *"
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo ""
#echo "We should still be in sioo/kernel:"
#echo "We are in $PWD"
#sleep 1
# HEADERS: kernel commands API, core SiOO API, and Extended APIs
# TODO Headers to ../out/include
# LIBRARIES: The entire kernel in one static chunk.
# 1.79MB and shrinking...
# TODO Libraries to ../out/lib
#
cp libsoarkernel.a ../out \
&& cp soarkernel.h ../out \
&& cp soarapi.h ../out \
&& cp soar_core_api.h ../out \
&& cp soar_core_utils.h ../out \
&& cp soar_ecore_api.h ../out \
&& cp soar_ecore_utils.h ../out \
&& echo "Successful!"
cd ..
#echo "We should be in sioo/: "
#echo "We are in $PWD"
#sleep 1
echo "\n\n"
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo " * Next we build the SiOO CLI (sioo) *"
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo ""
#echo "We should be in sioo/: "
#echo "We are in $PWD"
#sleep 1
# TODO setup the cli as an autotools project
# chmod u+x ./configure
# ./configure --prefix=../.. --with-kernel=../kernel
cd cli && make && ln SiOO sioo \
&& chmod u+x SiOO && cp SiOO ../out \
&& chmod u+x sioo && cp sioo ../out \
&& cp libSiOO.a ../out && echo "Successful!"
cd ..
echo "\n\n"
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo " * Next we build the SiOO tools (siooc, gsioo, soar2sioo) *"
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo ""
#echo "We should be in sioo/: "
#echo "We are in $PWD"
#sleep 1
cd tools
make \
&& chmod u+x siooc && cp siooc ../out \
&& chmod u+x gsioo && cp gsioo ../out \
&& chmod u+x soar2sioo && cp soar2sioo ../out \
&& echo "Successful!"
cd ..
#echo "We should be in sioo/: "
#echo "We are in $PWD"
#sleep 1
# Make Documentation and move to -/out/ [man | share]
#TODO Make man pages, mv catman to -/out/man
#TODO Make API reference pdf and move to sioo/
#TODO mv LOG.01.BUILD, LOG.02.TEST, LOG.03.INSTALL, LOG.04.README
# to -/out/share A-F-T-E-R the entire processes is complete
# and then install them as well... (In the share directory)
#TODO Point out explicitly in the README that we do it this way...
echo "\n\n"
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo " * B U I L D O F SiOO I S C O M P L E T E : *"
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo ""
echo " Version: "
cat VERSION
echo "\n\n"