diff --git a/Makefile b/Makefile deleted file mode 100644 index f4da049..0000000 --- a/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -all: main - -# Main file -files = src/test/main.c - -# Source files -files += src/*.c - -# Header files -files += include/*.h - -main: - @echo Compiling... - cc $(files) -ljson-c -lcurl -o out/why2 diff --git a/build.sh b/build.sh index bee14a4..ce3860f 100644 --- a/build.sh +++ b/build.sh @@ -1,12 +1,39 @@ #!/bin/bash -# Remove versions.json +#################### + +# Remove previous output & versions.json +rm -rf out/* rm -f versions.json -# Build project -make +# Variables +files=" + src/test/main.c -# Check for 'debug' flag + src/*.c + include/*.h + " + +compiler="cc" +output="out/why2" +flags="-ljson-c -lcurl" + +# Check for debug flag if [ "$1" == "debug" ]; then - ./out/why2 + flags="$flags -g" + echo "Using debug flag" fi + +### +echo "Using '$compiler' as default compiler. (Flags: $flags)" +echo "Compiling..." +### + +# Compile +$compiler $files $flags -o $output + +### +echo "Output generated as '$output'" +### + +