File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 77
88ifeq ($(OS ) ,Windows_NT)
99UNAME_S := $(OS )
10+ ifeq ($(shell gcc -dumpmachine) ,mingw32)
11+ MINGW_CXXFLAGS = -U__STRICT_ANSI__
12+ endif
1013else
1114UNAME_S := $(shell uname -s)
1215endif
1316
14- # For Darwin (Mac OS X) we assume that the default compiler
17+ # For Darwin (Mac OS X / macOS ) we assume that the default compiler
1518# clang++ is used; when $(CXX) is some version of g++, then
1619# $(CXXSTD) has to be set to -std=c++11 (or newer) so
1720# that -stdlib=libc++ is not automatically added.
@@ -27,23 +30,25 @@ endif
2730# changed if desired.
2831
2932CPPFLAGS ?= -pedantic
30- CXXFLAGS ?= -Wall -Wextra -Werror -O3
31-
32- .PHONY : all compile check clean
33+ CXXFLAGS ?= -Wall -Wextra -Wshadow -Werror -O3 $(MINGW_CXXFLAGS )
3334
3435SOURCES := $(shell find src -name '* .cpp')
3536DEPENDS := $(SOURCES:%.cpp=build/%.d )
3637BINARIES := $(SOURCES:%.cpp=build/% )
3738
3839UNIT_TESTS := $(filter build/src/test/% ,$(BINARIES ) )
3940
41+ .PHONY : all
4042all : compile check
4143
44+ .PHONY : compile
4245compile : $(BINARIES )
4346
47+ .PHONY : check
4448check : $(UNIT_TESTS )
4549 @set -e; for T in $( UNIT_TESTS) ; do echo $$ T; $$ T > /dev/null; done
4650
51+ .PHONY : clean
4752clean :
4853 @rm -rf build
4954 @find . -name ' *~' -delete
You can’t perform that action at this time.
0 commit comments