-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
36 lines (28 loc) · 1.08 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
CXX = g++
# CXXFLAGS = -lsfml-graphics -lsfml-window -lsfml-system -std=c++17 -pthread -o bin/mandelbrot `wx-config --libs` `wx-config --cxxflags`
CXXFLAGS = -std=c++17 -pthread #`wx-config --libs` `wx-config --cxxflags`
WXFLAGS = `wx-config --libs` `wx-config --cxxflags`
# https://stackoverflow.com/questions/714100/os-detecting-makefile
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
# OPENCL_FLAGS = -lOpenCL
WXTHING = wx-config # used to be wx-config-gtk3 ??
endif
ifeq ($(UNAME_S),Darwin)
# OPENCL_FLAGS = -framework OpenCl
WXTHING = wx-config
endif
OBJECTS = bin/GUI.o bin/Game.o bin/NeuralNet.o
# @ supresses output from command
all: $(OBJECTS)
$(CXX) $(OBJECTS) $(CXXFLAGS) `$(WXTHING) --libs` -Ofast -o bin/flappy
bin/GUI.o: src/GUI.cpp
$(CXX) $^ $(CXXFLAGS) `$(WXTHING) --cxxflags` -c -o $@ -g
bin/Game.o: src/Game.cpp
$(CXX) $^ $(CXXFLAGS) `$(WXTHING) --cxxflags` -c -o $@ -g
bin/NeuralNet.o: src/NeuralNet.cpp
$(CXX) $^ $(CXXFLAGS) -c -o $@ -g
debug: $(OBJECTS)
$(CXX) $(OBJECTS) $(CXXFLAGS) `$(WXTHING) --libs` -g -o bin/flappy
clean:
$(RM) bin/flappy $(OBJECTS)