DEV: Makefile rule correction and some warning suppression

This commit is contained in:
Christos Houtouridis
2019-11-14 13:43:25 +02:00
parent 4d9e2e4678
commit ee9b93317b
4 changed files with 21 additions and 17 deletions
+8 -9
View File
@@ -20,7 +20,7 @@
#
# ========== Project settings ==========
TARGET := utlTest
TARGET := utlTest.exe
SRC_DIR := tests gtest
INC_DIR := ../include gtest
EXC_FILE :=
@@ -36,7 +36,7 @@ CXX := g++
CPP := g++ -E
CSIZE := size
CFLAGS := -std=c++14 -Wall #-Wextra
CFLAGS := -std=c++14 -Wall -Wextra
DEB_FLAGS := -DDEBUG -g3
REL_FLAGS := -O3
LDFLAGS :=
@@ -91,16 +91,15 @@ $(DEP):
include $(wildcard $(DEP))
# main target rule
$(BUILD_DIR)/%/$(TARGET): $(OBJ)
$(BUILD_DIR)/$(TARGET): $(OBJ)
@mkdir -p $(@D)
@echo Linking to target: $(TARGET)
@echo $(CXX) $(LDFLAGS) $(MAP_FLAG) -o $(@D)/$(TARGET) '$$(OBJ)'
@$(CXX) $(LDFLAGS) $(MAP_FLAG) -o $(@D)/$(TARGET) $(OBJ)
@echo
@echo Print size information
@$(CSIZE) $(@D)/$(TARGET)
@echo Done
# @echo
# @echo Print size information
# @$(CSIZE) $(@D)/$(TARGET)
.PHONY: clean
@@ -118,12 +117,12 @@ clean:
.PHONY: debug
debug: CFLAGS += $(DEB_FLAGS)
debug: $(BUILD_DIR)/debug/$(TARGET)
debug: $(BUILD_DIR)/$(TARGET)
.PHONY: release
release: CFLAGS += $(REL_FLAGS)
release: clean $(BUILD_DIR)/release/$(TARGET)
release: clean $(BUILD_DIR)/$(TARGET)
.PHONY: all