diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..0718f53 --- /dev/null +++ b/Justfile @@ -0,0 +1,19 @@ +# List available actions +help: + @just -l + +# Do a debug build +debug: + make -j$(nproc) + +# Do a release build +release: + make -j$(nproc) RELEASE=1 + +# Watch and recompile on changes +watch: + watchexec -e c,cc,cpp,h,hpp -- make -j$(nproc) + +# Clean up +clean: + make clean diff --git a/Makefile b/Makefile index 27beb01..695e7c8 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,16 @@ CXX = g++ -CXXFLAGS = -Wall -Wextra -Wpedantic -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -std=c++17 -#CXXFLAGS += -Werror +CXXFLAGS = -Wall -Wextra -Wpedantic -Wshadow -Wnon-virtual-dtor \ +-Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wconversion \ +-Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -std=c++17 + +ifeq ($(RELEASE),) + CFLAGS += -g -O0 + BUILD_TYPE = Debug +else + CXXFLAGS += -O3 + CXXFLAGS += -Werror + BUILD_TYPE = Release +endif SRC = $(wildcard *.cc) HDR = $(wildcard *.h)