Replace make with a shell script.

This will do for now, until we figure out a better solution. I thought build
systems were for automation but apparently we still need to specify build
commands for all the programs individually so we might as well just do that
in a script until it gets out of hand or a better solution comes up.
BodgeMaster-unfinished
BodgeMaster 2022-06-24 09:21:57 +02:00
parent 9ebc00b0af
commit 57006a6463
2 changed files with 13 additions and 10 deletions

View File

@ -1,10 +0,0 @@
source = $(shell find ./ -name "*.cpp")
headers = $(shell find ./ -name "*.h")
main: $(source) $(headers)
c++ $(source) $(headers) -o ./bin/minecraft -Wall -Wextra
clean:
rm -rv bin/
mkdir bin/
touch bin/.placeholder

13
build.sh Executable file
View File

@ -0,0 +1,13 @@
echo "Building libs..."
mkdir -pv bin/lib
for lib in $(find ./src/lib -name "*.cpp"); do
echo "Compiling $lib"
c++ -shared -o $(sed -e 's/^.\/src/.\/bin/;s/cpp$/so/' <<< $lib) $lib;
done
echo "Building tools..."
mkdir -pv bin/tools
# Commands for every program need to be given individually because we can't
# just add all shared libraries to all programs.
# Or can we? Idk, cba to find out.
c++ src/tools/dumpnbt.cpp -Lbin/lib -lnbt -o bin/tools/dumpnbt