2012-08-02 13:02:59 +08:00
|
|
|
CC = gcc
|
|
|
|
CXX = g++
|
|
|
|
AR = ar
|
|
|
|
TARGET = libchipmunk.a
|
2012-09-19 03:42:57 +08:00
|
|
|
CCFLAGS = -Wall -std=gnu99
|
|
|
|
CXXFLAGS = -Wall
|
2012-08-02 13:02:59 +08:00
|
|
|
ARFLAGS = cr
|
|
|
|
|
|
|
|
INCLUDES = -I../include/chipmunk
|
|
|
|
|
|
|
|
DEFINES = -DLINUX
|
|
|
|
|
|
|
|
OBJECTS = ../src/chipmunk.o \
|
|
|
|
../src/cpBody.o \
|
|
|
|
../src/cpSpace.o \
|
|
|
|
../src/cpSpatialIndex.o \
|
|
|
|
../src/cpArbiter.o \
|
|
|
|
../src/cpCollision.o \
|
|
|
|
../src/cpSpaceComponent.o \
|
|
|
|
../src/cpSweep1D.o \
|
|
|
|
../src/cpArray.o \
|
|
|
|
../src/cpHashSet.o \
|
|
|
|
../src/cpSpaceHash.o \
|
|
|
|
../src/cpVect.o \
|
|
|
|
../src/cpBB.o \
|
|
|
|
../src/cpPolyShape.o \
|
|
|
|
../src/cpSpaceQuery.o \
|
|
|
|
../src/cpBBTree.o \
|
|
|
|
../src/cpShape.o \
|
|
|
|
../src/cpSpaceStep.o \
|
|
|
|
../src/constraints/cpConstraint.o \
|
|
|
|
../src/constraints/cpPivotJoint.o \
|
|
|
|
../src/constraints/cpDampedRotarySpring.o \
|
|
|
|
../src/constraints/cpRatchetJoint.o \
|
|
|
|
../src/constraints/cpDampedSpring.o \
|
|
|
|
../src/constraints/cpRotaryLimitJoint.o \
|
|
|
|
../src/constraints/cpGearJoint.o \
|
|
|
|
../src/constraints/cpSimpleMotor.o \
|
|
|
|
../src/constraints/cpGrooveJoint.o \
|
|
|
|
../src/constraints/cpSlideJoint.o \
|
|
|
|
../src/constraints/cpPinJoint.o \
|
|
|
|
|
2012-09-19 03:42:57 +08:00
|
|
|
debug: CCFLAGS += -g3 -O0
|
|
|
|
debug: CXXFLAGS += -g3 -O0
|
|
|
|
debug: DEFINES += -DDEBUG
|
|
|
|
debug: $(TARGET)
|
|
|
|
|
|
|
|
release: CCFLAGS += -O3
|
|
|
|
release: CXXFLAGS += -O3
|
|
|
|
release: DEFINES += -DNDEBIG
|
|
|
|
release: $(TARGET)
|
2012-08-02 13:02:59 +08:00
|
|
|
|
|
|
|
####### Build rules
|
|
|
|
$(TARGET): $(OBJECTS)
|
|
|
|
$(AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
|
2012-09-19 03:42:57 +08:00
|
|
|
|
2012-08-02 13:02:59 +08:00
|
|
|
####### Compile
|
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
|
2012-09-19 03:42:57 +08:00
|
|
|
|
2012-08-02 13:02:59 +08:00
|
|
|
clean:
|
|
|
|
rm -f $(OBJECTS) $(TARGET) core
|