-
Notifications
You must be signed in to change notification settings - Fork 1
/
OldMakefile
114 lines (86 loc) · 2.89 KB
/
OldMakefile
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
TARGET := edugame
TARGET_FILES := main
FILES := #python_function
TEST_FILES := #python_function_test
CC := g++
LD := g++
OBJSUFFIX := .o
LIBPREFIX := lib
STATIC_LIBSUFFIX := .a
CFLAGS := -g -DBOOST_TEST_DYN_LINK
CFLAGS_PLATFORM :=
LDFLAGS :=
FRAMEWORKS :=
LIBS := #python2.5 boost_python dl
TEST_LIBS := boost_unit_test_framework
EXESUFFIX :=
DEPARGS := -MD
BOOST_VERSION=1_47_0
BOOST_LIBS=signals,thread,python,test
OOST_ARGS= -sBUILD=boost_unit_test_framework variant=release link=shared
TARGET := $(addsuffix $(EXESUFFIX), $(TARGET))
INCDIRS := . #boost/include /usr/include/python2.5
LIBDIRS := #boost/lib
# how we link to libraries depends on the platform
ARCH=$(shell uname | sed -e 's/-.*//g')
ifeq ($(ARCH), CYGWIN_NT)
# If building on Cygwin, use glut32, opengl32
EXESUFFIX := .exe
LIBS +=
else
ifeq ($(ARCH), Darwin)
# Building on Os X
FRAMEWORKS +=
BOOST_ARGS += toolset=darwin architecture=x86 address-model=32
INCDIRS += irrlicht-1.7.2/include
LIBDIRS +=
LIBS +=
CFLAGS += -arch i386
LDFLAGS += -arch i386
else
# Building on Linux
endif
endif # Not CYGWIN_END
CFLAGS += $(addprefix -I, $(INCDIRS)) $(CFLAGS_PLATFORM)
LDFLAGS += $(addprefix -L, $(LIBDIRS))
LDLIBS := $(addprefix -l, $(LIBS))
LDFRAMEWORKS := $(addprefix -framework , $(FRAMEWORKS))
OBJS := $(addsuffix $(OBJSUFFIX), $(FILES))
DEPS := $(addsuffix .d, $(FILES))
TARGET_OBJS := $(addsuffix $(OBJSUFFIX), $(TARGET_FILES))
TARGET_DEPS := $(addsuffix .d, $(TARGET_FILES))
TEST_OBJS := $(addsuffix $(OBJSUFFIX), $(TEST_FILES))
TEST_DEPS := $(addsuffix .d, $(TEST_FILES))
LDTESTLIBS += $(addprefix -l, $(TEST_LIBS))
LDLIBS += -framework OpenGL -framework Cocoa -framework Carbon -framework IOKit
.SUFFIXES: .cpp $(OBJSUFFIX)
.PHONY: clean release all
all: $(TARGET)
# Handle dependencies
-include $(patsubst %.o,%.d,$(OBJS))
ifeq ($(ARCH), Darwin)
$(TARGET): $(OBJS) $(TARGET_OBJS)
$(LD) -o $(TARGET) irrlicht-1.7.2/source/Irrlicht/MacOSX/build/Release/libIrrlicht.a $(OBJS) $(TARGET_OBJS) $(LDFLAGS) $(LDLIBS) $(LDFRAMEWORKS)
lipo -create edugame -output edugame.app/Contents/MacOS/edugame
else
$(TARGET): $(OBJS) $(TARGET_OBJS)
$(LD) -o $(TARGET) irrlicht-1.7.2/source/Irrlicht/MacOSX/build/Release/libIrrlicht.a $(OBJS) $(TARGET_OBJS) $(LDFLAGS) $(LDLIBS) $(LDFRAMEWORKS)
endif
%.o: %.cpp
$(CXX) $(CFLAGS) -o $@ -c $< $(DEPARGS)
test: $(OBJS) $(TEST_OBJS)
$(LD) -o test $(OBJS) $(TEST_OBJS) $(LDFLAGS) $(LDLIBS) $(LDFRAMEWORKS) $(LDTESTLIBS)
boost:
tar -xvf boost_${BOOST_VERSION}.tar.bz2
cd boost_${BOOST_VERSION} && \
./bootstrap.sh --prefix=../boost --libdir=../boost/lib --with-libraries=${BOOST_LIBS} && \
./bjam ${BOOST_ARGS} install
rm -rf boost_${BOOST_VERSION}
blah:
clean:
rm -rf $(OBJS) $(TARGET) $(DEPS) $(TEST_OBJS) $(TEST_DEPS) $(TARGET_OBJS) $(TARGET_DEPS) test
dist-clean:
@make clean
rm -rf boost
release:
@make --no-print-directory RELEASE=1