This repository was archived by the owner on Nov 25, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +20
-22
lines changed Expand file tree Collapse file tree 1 file changed +20
-22
lines changed Original file line number Diff line number Diff line change 1- OS := $(shell uname)
2- ifneq (,$(findstring MINGW,$(OS ) ) )
3- OS := Windows
4- else ifneq(,$(findstring MSYS,$(OS)))
5- OS := Windows
6- else ifneq(,$(findstring CYGWIN,$(OS)))
7- OS := Windows
8- endif # Cygwin
9- endif # MSys
10- endif # MinGW
1+ OS ?= $(shell uname)
112
12- ifneq (,$(findstring $(OS ) ,Darwin FreeBSD) )
13- CXX := clang++
3+ # Assume Visual C++ on Windows
4+ # Environments like Cygwin will hopefully fall through and pick up the
5+ # appropriate Unix-like options
6+ ifneq ($(OS ) ,Windows_NT)
7+ EXE := bin\qqq.exe
8+ OUT := /out:$(EXE )
9+ CXX := cl
10+ CXXFLAGS := /EHsc /W4
1411else
15- CXX := g++
16- endif
17-
18- ifeq ( $( OS ) ,Windows )
19- EXE := bin/qqq.exe
12+ EXE := bin/qqq
13+ OUT := -o $( EXE )
14+ CXXFLAGS := -Wall -O0
15+ ifneq (, $( findstring $( OS ) ,Darwin FreeBSD) )
16+ CXX := clang++
2017else
21- EXE := bin/qqq
22- endif
18+ CXX := g++
19+ endif # macOS or FreeBSD
20+ endif # Windows
2321
2422setup :
2523 -mkdir bin
2624
2725cpp : setup
28- $(CXX ) cpp/qqq.cpp -o $( EXE ) -Wall -O0
26+ $(CXX ) cpp/qqq.cpp $( OUT ) $( CXXFLAGS )
2927
3028rust : setup
31- rustc rust/main.rs -o $( EXE )
29+ rustc rust/main.rs $( OUT )
3230
3331clean :
34- -rm $(EXECUTABLE )
32+ -rm $(EXE )
You can’t perform that action at this time.
0 commit comments