forked from idmillington/cyclone-physics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (46 loc) · 1.4 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# LINK FLAGS AND PLATFORM
# Linux (default)
LDFLAGS = -lGL -lGLU -lglut
# OS X
ARCH = $(shell uname)
ifeq ($(ARCH),Darwin)
LDFLAGS = -framework GLUT -framework OpenGL -framework Cocoa
endif
mkdir=mkdir -p
rm=rm -f
AR=ar cq
RANLIB=ranlib
# CYCLONEPHYSICS LIB
CXXFLAGS=-O2 -I./include -fPIC
CYCLONEOBJS=src/body.o src/collide_coarse.o src/collide_fine.o src/contacts.o src/core.o src/fgen.o src/joints.o src/particle.o src/pcontacts.o src/pfgen.o src/plinks.o src/pworld.o src/random.o src/world.o
# DEMO FILES
LIBNAME=libcyclone.a
CYCLONELIB=./lib/linux/$(LIBNAME)
DEMO_CPP=./src/demos/app.cpp ./src/demos/timing.cpp ./src/demos/main.cpp
DEMOS=ballistic bigballistic blob bridge explosion fireworks flightsim fracture platform ragdoll sailboat
# OUTPUT DIRECTORIES
OUTDIRS=./lib/linux ./bin/linux
# BUILD COMMANDS
all: out_dirs $(CYCLONELIB) $(DEMOS)
out_dirs:
$(mkdir) $(OUTDIRS)
$(CYCLONELIB): $(CYCLONEOBJS)
$(rm) $@
$(AR) $@ $(CYCLONEOBJS)
$(RANLIB) $@
$(DEMOS):
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o ./bin/linux/$@ $(DEMO_CPP) $(CYCLONELIB) ./src/demos/$@/[email protected]
clean:
$(rm) src/*.o lib/linux/libcyclone.a
$(rm) \
./bin/linux/fireworks \
./bin/linux/fracture \
./bin/linux/flightsim \
./bin/linux/bridge \
./bin/linux/sailboat \
./bin/linux/explosion \
./bin/linux/ballistic \
./bin/linux/platform \
./bin/linux/bigballistic \
./bin/linux/blob \
./bin/linux/ragdoll