Compare commits

...

3 Commits

Author SHA1 Message Date
BodgeMaster ec445d7a44 ignore nano's temp files 2022-06-24 09:29:44 +02:00
BodgeMaster 0c9299b21d Create files for nbt library and a tool to use it.
These files were also used to figure out the process of building them so
their content is garbage.
2022-06-24 09:28:17 +02:00
BodgeMaster 57006a6463 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.
2022-06-24 09:21:57 +02:00
6 changed files with 25 additions and 10 deletions

3
.gitignore vendored
View File

@ -1,2 +1,5 @@
/bin/*
!/bin/.placeholder
# ignore nano's temp files
*.swp

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

3
src/lib/libnbt.cpp Normal file
View File

@ -0,0 +1,3 @@
int blob() {
return 1;
}

1
src/lib/libnbt.h Normal file
View File

@ -0,0 +1 @@
int blob();

5
src/tools/dumpnbt.cpp Normal file
View File

@ -0,0 +1,5 @@
#include "../lib/libnbt.h"
int main(int argc, char* argv[]) {
return blob();
}