-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (25 loc) · 894 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
CXX= g++ -std=c++14 -g -O2
LD= g++ -std=c++14
CXXFLAGS= -Wall -pedantic -frounding-math
INC=-isystem /usr/include/bullet -isystem /usr/include/irrlicht -isystem /usr/include/bullet/LinearMath -isystem include
SRCDIR=src/
BUILDDIR=build/
LDFLAGS= -L/usr/lib
LIBS= -lIrrlicht -lBulletSoftBody -lBulletDynamics -lBulletCollision \
-lLinearMath -lvoro++ -lgmp -lCGAL -lCGAL_Core -lmpfr -lpthread
HEADERS= $(notdir $(wildcard $(SRCDIR)*.h))
OBJS= $(addprefix $(BUILDDIR), $(subst .cpp,.o,$(notdir $(wildcard $(SRCDIR)*.cpp))))
PROG= $(BUILDDIR)game
VPATH=src/
all: $(PROG)
$(BUILDDIR)%.o: %.cpp $(SRCDIR)$(HEADERS) | $(BUILDDIR)
$(CXX) $(CXXFLAGS) $(INC) $< -c -o $@
$(PROG): lib/hacd.a $(OBJS) | $(BUILDDIR)
$(LD) $(LDFLAGS) $(OBJS) $(LIBS) lib/hacd.a -o $(PROG)
lib/hacd.a:
make -C lib/hacd
$(BUILDDIR):
mkdir -p $(BUILDDIR)
clean:
rm -f $(OBJS) $(PROG)
make -C lib/hacd clean