This commit is contained in:
2024-11-16 23:38:31 +05:30
parent 3ec0fbb7fa
commit 8c47c6182f

View File

@@ -1,3 +1,33 @@
#Setting a default configuration if invoked with just "make":
CFG ?= debug
# Config specific settings
ifeq ($(CFG),debug)
CFLAGS += -DDEBUG
else
CFLAGS += -O3 -DNDEBUG
endif
inform:
ifneq ($(CFG),release)
ifneq ($(CFG),debug)
@echo "Invalid configuration "$(CFG)" specified."
@echo
@echo "Possible choices for configuration are 'CFG=release' and 'CFG=debug'"
@exit 1
endif
endif
@echo "Configuration "$(CFG)
@echo "--------------------------------------------------"
rule : dep | inform
BUILD_DIR = build/$(CFG)
OBJS_DIR = $(BUILD_DIR)/objs
#--------------------------------------------------
BINARY=bin
CODEDIRS=. lib
INCDIRS=. ./include/ # can be list