Skip to content

Commit 02c9db1

Browse files
committed
Makefile: correctly override {C,CPP,CXX,LD}FLAGS
1 parent f3e26d9 commit 02c9db1

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Makefile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
CFLAGS = -std=gnu99 -Os -Wall $(CFLAGS)
2-
CXXFLAGS = -std=gnu++11 -Os -Wall $(CXXFLAGS)
3-
41
ifeq ($(OS),Windows_NT)
52
TARGET_OS := WINDOWS
63
DIST_SUFFIX := windows
@@ -48,11 +45,10 @@ OBJ := main.o \
4845

4946
INCLUDES := -Itclap -Ispiffs -I.
5047

51-
CFLAGS += $(TARGET_CFLAGS)
52-
CXXFLAGS += $(TARGET_CXXFLAGS)
53-
LDFLAGS += $(TARGET_LDFLAGS)
54-
55-
CPPFLAGS += $(INCLUDES) -D$(TARGET_OS) -DVERSION=\"$(VERSION)\" -D__NO_INLINE__
48+
override CFLAGS := -std=gnu99 -Os -Wall $(TARGET_CFLAGS) $(CFLAGS)
49+
override CXXFLAGS := -std=gnu++11 -Os -Wall $(TARGET_CXXFLAGS) $(CXXFLAGS)
50+
override LDFLAGS := $(TARGET_LDFLAGS) $(LDFLAGS)
51+
override CPPFLAGS := $(INCLUDES) -D$(TARGET_OS) -DVERSION=\"$(VERSION)\" -D__NO_INLINE__ $(CPPFLAGS)
5652

5753
DIST_NAME := mkspiffs-$(VERSION)-$(DIST_SUFFIX)
5854
DIST_DIR := $(DIST_NAME)

0 commit comments

Comments
 (0)