File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ UNAME = $(shell uname -s)
2
+
3
+ COMPILER_Linux = g++
4
+ CXX_FLAGS_Linux = -Wall -std=c++11
5
+ DEBUG_LIBS_Linux = -lsfml-system-d -lsfml-window-d -lsfml-graphics-d
6
+ RELEASE_LIBS_Linux = -lsfml-system -lsfml-window -lsfml-graphics
7
+
8
+ COMPILER_Darwin = clang++
9
+ CXX_FLAGS_Darwin = -Wall -std=c++11 -stdlib=libc++
10
+ DEBUG_LIBS_Darwin = -framework SFML -framework sfml-system -framework sfml-window -framework sfml-graphics
11
+ RELEASE_LIBS_Darwin = $(DEBUG_LIBS )
12
+
13
+ COMPILER = $(COMPILER_$(UNAME ) )
14
+ CXX_FLAGS = $(CXX_FLAGS_$(UNAME ) )
15
+ DEBUG_LIBS = $(DEBUG_LIBS_$(UNAME ) )
16
+ RELEASE_LIBS = $(RELEASE_LIBS_$(UNAME ) )
17
+
18
+ DEBUG_PREPROCESSOR = -D_DEBUG
19
+ RELEASE_PREPROCESSOR = -D_RELEASE
20
+
21
+ EXECUTABLE = chesspp
22
+ TARGETDIR = ../bin
23
+ TARGET = $(TARGETDIR ) /$(EXECUTABLE )
24
+ SOURCE = $(shell cd src ; ls * .cpp) $(shell cd src ; ls board/* .cpp)
25
+
26
+ all : debug
27
+
28
+ debug : CXX_PREPROCESSOR=$(DEBUG_PREPROCESSOR )
29
+ debug : LIBS=$(DEBUG_LIBS )
30
+ debug : main
31
+
32
+ release : CXX_PREPROCESSOR=$(RELEASE_PREPROCESSOR )
33
+ release : LIBS=$(RELEASE_LIBS )
34
+ release : main
35
+
36
+ main : | bin
37
+ cd src; \
38
+ $(COMPILER ) $(CXX_FLAGS ) $(CXX_PREPROCESSOR ) -o $(TARGET ) $(SOURCE ) $(LIBS )
39
+
40
+ bin :
41
+ mkdir bin
42
+
You can’t perform that action at this time.
0 commit comments