-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
#!/bin/bash -v | ||
#!/bin/bash | ||
# Packages MPack up for amalgamation release. You can run tools/amalgamate.sh | ||
# instead of this script if you just want to generate mpack.h/mpack.c. | ||
# instead of this script if you just want to generate mpack.h and mpack.c. | ||
|
||
set -v | ||
set -e | ||
|
||
[[ -z $(git status --porcelain) ]] || { git status --porcelain; echo "Tree is not clean!" ; exit 1; } | ||
"`dirname $0`"/clean.sh | ||
|
||
# generate package contents | ||
. "`dirname $0`"/amalgamate.sh | ||
. "`dirname $0`"/gendocs.sh | ||
cp -ar build/docs/html build/amalgamation/docs | ||
cp -ar .build/docs/html .build/amalgamation/docs | ||
sed -i '/#define MPACK_AMALGAMATED 1/a\ | ||
#define MPACK_RELEASE_VERSION 1' build/amalgamation/src/mpack/mpack.h | ||
#define MPACK_RELEASE_VERSION 1' .build/amalgamation/src/mpack/mpack.h | ||
|
||
# create package | ||
NAME=mpack-amalgamation-$VERSION | ||
tar -C build/amalgamation --transform "s@^@$NAME/@" -czf build/$NAME.UNTESTED.tar.gz `ls build/amalgamation` || exit $? | ||
tar -C .build/amalgamation --transform "s@^@$NAME/@" -czf .build/$NAME.UNTESTED.tar.gz `ls .build/amalgamation` || exit $? | ||
|
||
# build and run all unit tests | ||
pushd build/amalgamation | ||
scons -j4 all=1 || exit $? | ||
pushd .build/amalgamation | ||
tools/unit.sh all || exit $? | ||
popd | ||
|
||
# done! | ||
mv build/$NAME.UNTESTED.tar.gz $NAME.tar.gz | ||
mv .build/$NAME.UNTESTED.tar.gz $NAME.tar.gz | ||
echo Created $NAME.tar.gz | ||
|