Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Lecrapouille committed Aug 14, 2023
1 parent 835456b commit c3d4fae
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 57 deletions.
35 changes: 6 additions & 29 deletions external/compile-external-libs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash -ex

#!/bin/bash -e
###############################################################################
### This script is called by (cd .. && make compile-external-libs). It will
### compile thirdparts cloned previously with make download-external-libs.
Expand All @@ -22,38 +21,16 @@
### find them when you'll start your application.
###############################################################################

### $1 is given by ../Makefile and refers to the current architecture.
if [ "$1" == "" ]; then
echo "Expected one argument. Select the architecture: Linux, Darwin or Windows"
exit 1
fi

ARCHI="$1"
TARGET="$2"
CC="$3"
CXX="$4"

function print-compile
{
echo -e "\033[35m*** Compiling:\033[00m \033[36m$TARGET\033[00m <= \033[33m$1\033[00m"
}

### Number of CPU cores
NPROC=-j1
if [[ "$ARCHI" == "Darwin" ]]; then
NPROC=-j`sysctl -n hw.logicalcpu`
elif [[ "$ARCHI" == "Linux" ]]; then
NPROC=-j`nproc --all`
fi
source ../.makefile/compile-external-libs.sh

### Library zlib-ng
print-compile zlib-ng
if [ -e zlib-ng ];
then
mkdir -p zlib-ng/build
(cd zlib-ng/build
cmake -GNinja -DZLIB_COMPAT=ON -DZLIB_ENABLE_TESTS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON ..
VERBOSE=1 ninja $NPROC
call-cmake -DZLIB_COMPAT=ON -DZLIB_ENABLE_TESTS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON ..
call-make
)
else
echo "Failed compiling external/zipper: directory does not exist"
Expand All @@ -65,8 +42,8 @@ if [ -e minizip ];
then
mkdir -p minizip/build
(cd minizip/build
cmake -GNinja -DUSE_AES=ON ..
VERBOSE=1 ninja $NPROC
call-cmake -DUSE_AES=ON ..
call-make
)
else
echo "Failed compiling external/zipper: directory does not exist"
Expand Down
38 changes: 11 additions & 27 deletions external/download-external-libs.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,17 @@
#!/bin/bash
#!/bin/bash -e
###############################################################################
### This script is called by (cd .. && make download-external-libs). It will
### git clone thirdparts needed for this project but does not compile them.
### It replaces git submodules that I dislike.
###############################################################################

### This script will git clone some libraries that Zipper needs and
### compile them. To avoid pollution, they are not installed into your
### environement. Therefore Zipper Makefiles have to know where to
### find their files (includes and static/shared libraries).

### $1 is given by ../Makefile and refers to the current architecture.
if [ "$1" == "" ]; then
echo "Expected one argument. Select the architecture: Linux, Darwin or Windows"
exit 1
fi
ARCHI="$1"
TARGET=Zipper

### Delete all previous directories to be sure to have and compile
### fresh code source.
rm -fr backward-cpp zlib-ng minizip 2> /dev/null

function clone
{
NAME=`echo "$1" | cut -d"/" -f2`
echo -e "\033[35m*** Cloning:\033[00m \033[36m$TARGET\033[00m <= \033[33m$NAME\033[00m"
git clone --recursive https://github.com/$1.git --depth=1 #> /dev/null 2> /dev/null
}
source ../.makefile/download-external-libs.sh

### zlib replacement with optimizations for "next generation" systems.
### License: zlib
clone zlib-ng/zlib-ng
cloning zlib-ng/zlib-ng

### Minizip contrib in zlib with latest bug fixes that supports PKWARE disk spanning, AES encryption, and IO buffering
### Minizip contrib in zlib with latest bug fixes that supports PKWARE disk
### spanning, AES encryption, and IO buffering.
### License: zlib
clone Lecrapouille/minizip
cloning Lecrapouille/minizip

0 comments on commit c3d4fae

Please sign in to comment.