-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (25 loc) · 889 Bytes
/
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
37
38
39
CXX := g++
CXXFLAGS := -Wall -g -std=c++11 -Wno-deprecated-declarations
LIBS := -lGL -lglut -lm
ifneq ($(shell uname), Linux)
MACOSX_DEFINE := -I/sw/include
LIBS := -I/usr/common/include -I/usr/include/GL -L/System/Library/Frameworks/OpenGL.framework/Libraries -framework GLUT -framework OpenGL -lGL -lm -lobjc -lstdc++
endif
# here are the usual make rules
mapDraw: mapDraw.o texture.o Neighbor.o Point.o button.o Map.o Path.o
$(CXX) $(CXXFLAGS) -o $(@) $(^) $(LIBS)
mapDraw.o: mapDraw.cpp
$(CXX) $(CXXFLAGS) $(MACOSX_DEFINE) -c mapDraw.cpp
Path.o: Path.cpp Path.h Map.o
$(CXX) $(CXXFLAGS) -c $(<)
Map.o: Map.cpp Map.h Neighbor.o
$(CXX) $(CXXFLAGS) -c $(<)
Neighbor.o: Neighbor.cpp Neighbor.h Point.o
$(CXX) $(CXXFLAGS) -c $(<)
%.o: %.cpp %.h
$(CXX) $(CXXFLAGS) -c $(<)
.PHONY: clean reformat
clean:
rm -f *.o mapDraw
reformat:
clang-format -i -style=llvm *.cpp *.h