From 57006a6463611d46d246697572e71860a073bd63 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Fri, 24 Jun 2022 09:21:57 +0200 Subject: [PATCH] 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. --- Makefile | 10 ---------- build.sh | 13 +++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) delete mode 100644 Makefile create mode 100755 build.sh diff --git a/Makefile b/Makefile deleted file mode 100644 index da856d0..0000000 --- a/Makefile +++ /dev/null @@ -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 diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..203cf5b --- /dev/null +++ b/build.sh @@ -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