Justfile & makefile changes
This commit is contained in:
parent
1655cd83f5
commit
5712d3f51d
2 changed files with 31 additions and 2 deletions
19
Justfile
Normal file
19
Justfile
Normal file
|
@ -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
|
14
Makefile
14
Makefile
|
@ -1,6 +1,16 @@
|
||||||
CXX = g++
|
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 = -Wall -Wextra -Wpedantic -Wshadow -Wnon-virtual-dtor \
|
||||||
#CXXFLAGS += -Werror
|
-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)
|
SRC = $(wildcard *.cc)
|
||||||
HDR = $(wildcard *.h)
|
HDR = $(wildcard *.h)
|
||||||
|
|
Loading…
Reference in a new issue