-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sources/ham: Cleanup build scripts ;
- Loading branch information
Showing
27 changed files
with
195 additions
and
173 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
if [ "$1" == "force" ]; then | ||
shift | ||
if [ "$1" == "silent" ]; then | ||
shift | ||
else | ||
ALREADY_IMPORTED=`ni-hget HAM_IMPORTS_TOOLSETS $1` | ||
if [[ "$ALREADY_IMPORTED" = "1" ]]; then | ||
echo "W/Toolset already imported '$1', force reimported." | ||
fi | ||
fi | ||
else | ||
ALREADY_IMPORTED=`ni-hget HAM_IMPORTS_TOOLSETS $1` | ||
if [[ "$ALREADY_IMPORTED" = "1" ]]; then | ||
echo "E/Toolset already imported '$1'." | ||
return 1 | ||
fi | ||
fi | ||
|
||
FOUND_SETUP_SCRIPT=no | ||
if [ "$FOUND_SETUP_SCRIPT" == "no" ]; then | ||
export DIR="${HAM_HOME}/specs/toolsets/$1" | ||
export SETUP_SCRIPT="$DIR/setup-toolset.sh" | ||
if [ -f "$SETUP_SCRIPT" ]; then | ||
FOUND_SETUP_SCRIPT="from GLOBAL." | ||
fi | ||
fi | ||
|
||
if [ "$FOUND_SETUP_SCRIPT" == "no" ]; then | ||
echo "E/Can't find the toolset '$1'" | ||
return 1 | ||
fi | ||
|
||
export PATH=$PATH | ||
HAM_DIE_SHOULD_RETURN=yes source "$SETUP_SCRIPT" | ||
if [ $? != 0 ]; then | ||
echo "E/Toolset '$1' import failed !" | ||
return 1 | ||
else | ||
if [[ -z $HAM_IMPORTED_TOOLSETS ]]; then | ||
export HAM_IMPORTED_TOOLSETS="$1" | ||
else | ||
export HAM_IMPORTED_TOOLSETS="$HAM_IMPORTED_TOOLSETS $1" | ||
fi | ||
ni-hput HAM_IMPORTS_TOOLSETS $1 1 | ||
echo -e "I/Imported toolset '$1' ${FOUND_SETUP_SCRIPT}" | ||
fi |
This file was deleted.
Oops, something went wrong.
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,30 +1,40 @@ | ||
#!/bin/bash | ||
. ham-bash-lib.sh | ||
. ham-toolset default | ||
#!/bin/bash -e | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
HAM_NO_VER_CHECK=1 . "$SCRIPT_DIR/../../_env.sh" | ||
HAM_NO_VER_CHECK=1 . ham-toolset default | ||
errcheck $? build-ham-lin-x64 "Can't setup toolset" | ||
|
||
cd src | ||
|
||
echo == Configure | ||
if [[ ! -e ./Makefile ]]; then | ||
chmod +x ./configure | ||
./configure | ||
if [[ -e "./Makefile" ]]; then | ||
echo "I/Already configured" | ||
else | ||
echo "I/Configure" | ||
(set -x ; | ||
chmod +x ./configure ; | ||
./configure) | ||
fi | ||
|
||
echo == Create output unix folder | ||
mkdir -p bin.unix | ||
echo "I/Create output unix folder" | ||
(set -x ; | ||
mkdir -p bin.unix) | ||
|
||
echo == Building jambase.c... | ||
gcc -o bin.unix/mkjambase mkjambase.c | ||
./bin.unix/mkjambase jambase.c jambase | ||
echo "I/Building jambase.c..." | ||
(set -x ; | ||
gcc -o bin.unix/mkjambase mkjambase.c ; | ||
./bin.unix/mkjambase jambase.c Jambase) | ||
|
||
echo == Building Ham | ||
make clean | ||
make | ||
mkdir -p "$HAM_HOME/bin/lin-x64/" | ||
cp -f ./bin.unix/ham.x64 "$HAM_HOME/bin/lin-x64/ham" | ||
echo "I/Building Ham" | ||
(set -x ; | ||
make ; | ||
mkdir -p "$HAM_HOME/bin/lin-x64" ; | ||
cp -f "./bin.unix/ham.x64" "$HAM_HOME/bin/lin-x64/ham") | ||
|
||
echo == Cleaning up temporary build files | ||
rm -f ham0 | ||
rm -Rf bin.unix/ | ||
rm -Rf ham0.dSYM/ | ||
echo "I/Cleaning up temporary build files" | ||
(set -x ; | ||
make clean ; | ||
rm -f ham0 ; | ||
rm -Rf bin.unix/ ; | ||
rm -Rf ham0.dSYM/) | ||
|
||
echo "I/Done." |
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,23 +1,30 @@ | ||
#!/bin/bash | ||
. ham-bash-lib.sh | ||
. ham-toolset msvc_19_x86 | ||
#!/bin/bash -e | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
HAM_NO_VER_CHECK=1 . "$SCRIPT_DIR/../../_env.sh" | ||
HAM_NO_VER_CHECK=1 . ham-toolset msvc_19_x86 | ||
errcheck $? build-ham-nt-x86 "Can't setup msvc_19_x86 toolset" | ||
|
||
cd src | ||
echo == Requires the VC DevEnv | ||
mkdir -p bin.ntx86 | ||
echo == Building jambase.c... | ||
cl -nologo mkjambase.c | ||
|
||
echo == Building Ham | ||
rm -f ham0 # Make sure any unix ham0 is cleaned up | ||
./mkjambase.exe jambase.c jambase | ||
nmake -f builds/win32-visualc.mk | ||
errcheck $? build-ham-nt-x86 "Ham build failed" | ||
echo "I/Create output ntx86 folder" | ||
(set -x ; | ||
mkdir -p bin.ntx86) | ||
|
||
cp bin.ntx86/ham.exe "${HAM_HOME}/bin/nt-x86/ham.exe" | ||
errcheck $? build-ham-nt-x86 "Ham copy failed" | ||
echo "I/Building jambase.c..." | ||
(set -x ; | ||
"${MSVCDIR_BIN}/cl.exe" -nologo mkjambase.c ; | ||
./mkjambase.exe jambase.c Jambase) | ||
|
||
echo == Cleaning up temporary build files | ||
rm -f *.obj *.lib *.exe ham ham0 *.pdb | ||
rm -Rf bin.ntx86/ | ||
echo "I/Building Ham" | ||
(set -x ; | ||
# Make sure any unix ham0 is cleaned up | ||
rm -f ham0 ; | ||
nmake -f builds/win32-visualc.mk ; | ||
cp bin.ntx86/ham.exe "${HAM_HOME}/bin/nt-x86/ham.exe") | ||
|
||
echo "I/Cleaning up temporary build files" | ||
(set -x ; | ||
rm -f *.obj *.lib *.exe ham ham0 *.pdb ; | ||
rm -Rf bin.ntx86/) | ||
|
||
echo "I/Done." |
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,42 +1,48 @@ | ||
#!/bin/bash -e | ||
. ham-bash-lib.sh | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
HAM_NO_VER_CHECK=1 . "$SCRIPT_DIR/../../_env.sh" | ||
|
||
BIN_LOA=${HAM_TARGET_BIN_LOA:-$HAM_BIN_LOA} | ||
case $BIN_LOA in | ||
osx-arm64) | ||
. ham-toolset macos_arm64 || return 1 | ||
HAM_NO_VER_CHECK=1 . ham-toolset macos_arm64 || exit 1 | ||
;; | ||
osx-x64) | ||
. ham-toolset macos_x64 || return 1 | ||
HAM_NO_VER_CHECK=1 . ham-toolset macos_x64 || exit 1 | ||
;; | ||
*) | ||
echo "E/Toolset: Unsupported target '$BIN_LOA'." | ||
return 1 | ||
exit 1 | ||
;; | ||
esac | ||
errcheck $? build-ham-osx "Can't setup toolset" | ||
|
||
cd src | ||
|
||
echo == Create output unix folder | ||
mkdir -p bin.unix | ||
|
||
echo == Building jambase.c... | ||
gcc -o bin.unix/mkjambase mkjambase.c | ||
./bin.unix/mkjambase jambase.c Jambase | ||
errcheck $? build-ham-osx "Can't build jambase" | ||
|
||
echo == Building Ham | ||
make -f builds/Makefile.osx clean | ||
make -f builds/Makefile.osx | ||
errcheck $? build-ham-osx "Can't build ham" | ||
|
||
mkdir -p "$HAM_HOME/bin/$BIN_LOA" | ||
echo == Copying output to "$HAM_HOME/bin/$BIN_LOA/ham" | ||
# Explicitly remove the file first otherwise macOS will quarantine the file | ||
rm -f "$HAM_HOME/bin/$BIN_LOA/ham" | ||
cp -f ./bin.unix/ham "$HAM_HOME/bin/$BIN_LOA/ham" | ||
errcheck $? build-ham-osx "Can't output ham to final directory" | ||
|
||
echo == Cleaning up temporary build files | ||
rm -f ham0 | ||
rm -Rf bin.unix/ | ||
rm -Rf ham0.dSYM/ | ||
echo "I/Create output unix folder" | ||
(set -x ; | ||
mkdir -p bin.unix) | ||
|
||
echo "I/Building jambase.c..." | ||
(set -x ; | ||
gcc -o bin.unix/mkjambase mkjambase.c ; | ||
./bin.unix/mkjambase jambase.c Jambase) | ||
|
||
echo "I/Building Ham" | ||
(set -x ; | ||
make -f builds/Makefile.osx clean ; | ||
make -f builds/Makefile.osx) | ||
|
||
echo "I/Copying output to '$HAM_HOME/bin/$BIN_LOA/ham'" | ||
(set -x ; | ||
mkdir -p "$HAM_HOME/bin/$BIN_LOA" ; | ||
# Explicitly remove the file first otherwise macOS will quarantine the file | ||
rm -f "$HAM_HOME/bin/$BIN_LOA/ham" ; | ||
cp -f ./bin.unix/ham "$HAM_HOME/bin/$BIN_LOA/ham") | ||
|
||
echo "I/Cleaning up temporary build files" | ||
(set -x ; | ||
rm -f ham0 ; | ||
rm -Rf bin.unix/ ; | ||
rm -Rf ham0.dSYM/) | ||
|
||
echo "I/Done." |
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
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
Oops, something went wrong.