mirror of
https://github.com/Hizenberg469/Makefile-tutorial.git
synced 2026-04-19 22:02:24 +03:00
updated
This commit is contained in:
@@ -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
|
BINARY=bin
|
||||||
CODEDIRS=. lib
|
CODEDIRS=. lib
|
||||||
INCDIRS=. ./include/ # can be list
|
INCDIRS=. ./include/ # can be list
|
||||||
|
|||||||
Reference in New Issue
Block a user