mirror of
https://github.com/Hizenberg469/Makefile-tutorial.git
synced 2026-10-10 03:52:59 +03:00
updated
This commit is contained in:
1 parent
3ec0fbb7fa
commit
8c47c6182f
1 file changed
+30
@@ -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
|
||||
|
||||
Reference in new issue
Block a user