Skip to content

Commit d63dc3c

Browse files
committed
Make CXX/FLAGS overridable, use standard CXXFLAGS variable name
1 parent 7599519 commit d63dc3c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎Makefile‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
CXX = clang++
2-
CXX_FLAGS = -Wall -Wextra -std=c++14 -O3 # -fsanitize=address -fsanitize=undefined
1+
CXX ?= clang++
2+
CXXFLAGS ?= -O3
3+
CXXFLAGS += -Wall -Wextra -std=c++14
34

45
SOURCES:=$(wildcard *.cxx)
56
HEADERS:=$(wildcard *.hxx)
@@ -9,7 +10,7 @@ OUTPUTS:=$(patsubst tests/%.in,tests/%.out,$(TESTS))
910
tests: $(OUTPUTS)
1011

1112
main: $(SOURCES) $(HEADERS)
12-
$(CXX) $(CXX_FLAGS) -o $@ $(SOURCES)
13+
$(CXX) $(CXXFLAGS) -o $@ $(SOURCES)
1314

1415
%.out: %.in main
1516
./main <$< | tee $@

0 commit comments

Comments
 (0)