/
Makefile.linux_shared
108 lines (84 loc) · 4.78 KB
/
Makefile.linux_shared
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
# Makefile.linux_shared
APP_NAME = 3DModelLoaderExample
OF_LIBS_PATH = ../../../libs
OF_ADDONS_PATH = ../../../addons
CC = gcc
PROJECT_DIR = ./
CFLAGS += -Wall -fexceptions
#= CFLAGS += -I$(OF_LIBS_PATH)/libofw/include
#= libofw cflags
CFLAGS += -I$(OF_LIBS_PATH)/openFrameworks/ -I$(OF_LIBS_PATH)/openFrameworks/events -I$(OF_LIBS_PATH)/openFrameworks/app -I$(OF_LIBS_PATH)/openFrameworks/communication -I$(OF_LIBS_PATH)/openFrameworks/graphics -I$(OF_LIBS_PATH)/openFrameworks/video -I$(OF_LIBS_PATH)/openFrameworks/utils -I$(OF_LIBS_PATH)/openFrameworks/sound -I$(OF_LIBS_PATH)/rtAudio/include -I$(OF_LIBS_PATH)/fmodex/inc -I$(OF_LIBS_PATH)/GLee/include -I$(OF_LIBS_PATH)/GLee/ -I$(OF_LIBS_PATH)/freeimage/include -I$(OF_LIBS_PATH)/freeimage -I$(OF_LIBS_PATH)/alsa/include -I$(OF_LIBS_PATH)/alsa/include/alsa -I$(OF_LIBS_PATH)/freetype/include/linux -I$(OF_LIBS_PATH)/freetype/include/linux/freetype2 -I$(OF_LIBS_PATH)/unicap/include -I$(OF_LIBS_PATH)/gstappsink/include -I../../../addons -I$(OF_LIBS_PATH)/poco/include
#= libofw_coreaddons cflags
CFLAGS += -I$(OF_ADDONS_PATH) -I$(OF_ADDONS_PATH)/ofxDirList/src -I$(OF_ADDONS_PATH)/ofxNetwork/src -I$(OF_ADDONS_PATH)/ofxOpenCv/src -I$(OF_ADDONS_PATH)/ofxOpenCv/libs/opencv/include -I$(OF_ADDONS_PATH)/ofxOsc/src -I$(OF_ADDONS_PATH)/ofxOsc/libs/oscpack/include/ip -I$(OF_ADDONS_PATH)/ofxOsc/libs/oscpack/include/osc -I$(OF_ADDONS_PATH)/ofxThread/src -I$(OF_ADDONS_PATH)/ofxVectorGraphics/src -I$(OF_ADDONS_PATH)/ofxVectorGraphics/libs -I$(OF_ADDONS_PATH)/ofxVectorMath/src -I$(OF_ADDONS_PATH)/ofxXmlSettings/src -I$(OF_ADDONS_PATH)/ofxXmlSettings/libs -I$(OF_ADDONS_PATH)/ofx3DModelLoader/src -I$(OF_ADDONS_PATH)/ofx3DModelLoader/src/3DS
CFLAGS +=`pkg-config gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libavcodec libavformat libavutil libswscale --cflags`
LDFLAGS += -L$(OF_LIBS_PATH)/libofw/lib -L$(OF_LIBS_PATH)/fmodex/lib/linux -L$(OF_LIBS_PATH)/unicap/lib -L$(OF_LIBS_PATH)/poco/lib/linux
#= libofw libs
LIBS += -lofw -lofw_coreaddons -lfmodex -lraw1394 -lglut -lGL -lGLU -lXxf86vm -lasound -lPocoFoundation -lunicap
CFLAGS += -DLINUX
OBJS = src/main.o src/testApp.o
Debug: TARGET_NAME = Debug
Debug: OBJ_OUTPUT = build/Debug/
Debug: OUTPUT = bin/$(APP_NAME)_debug
Debug: TARGET_OUTPUT_BASENAME = $(APP_NAME)_debug
Debug: CC = gcc
Debug: CFLAGS += -g -MMD
OBJS_Debug = $(addprefix build/Debug/, $(OBJS) )
Release: TARGET_NAME = Release
Release: OBJ_OUTPUT = build/Release/
Release: OUTPUT = bin/$(APP_NAME)
Release: TARGET_OUTPUT_BASENAME = $(APP_NAME)
Release: CC = gcc
Release: CFLAGS += -O3 -MMD
Release: LDFLAGS += -s
OBJS_Release = $(addprefix build/Release/, $(OBJS) )
.PHONY: after
Debug: bin/$(APP_NAME)_debug after
Release: bin/$(APP_NAME) after
bin/$(APP_NAME)_debug: $(OBJS_Debug)
mkdir -p bin/
$(CC) $(LDFLAGS) -o $@ $(OBJS_Debug) $(LIBS)
bin/$(APP_NAME): $(OBJS_Release)
mkdir -p bin/
$(CC) $(LDFLAGS) -o $@ $(OBJS_Release) $(LIBS)
copy_libs:
# copy libs to bin/libs directory:
mkdir -p $(PROJECT_DIR)bin/
mkdir -p $(PROJECT_DIR)bin/libs/
cp -p $(OF_LIBS_PATH)/fmodex/lib/linux/libfmodex.so $(PROJECT_DIR)bin/libs/
cp -p $(OF_LIBS_PATH)/fmodex/lib/linux/libfmodexp.so $(PROJECT_DIR)bin/libs/
cp -p $(OF_LIBS_PATH)/libofw/lib/libofw.so $(PROJECT_DIR)bin/libs/libofw.so
cp -p $(OF_LIBS_PATH)/libofw/lib/libofw_coreaddons.so $(PROJECT_DIR)bin/libs/libofw_coreaddons.so
# ok
after:
# copy shell script to bin directory:
mkdir -p $(PROJECT_DIR)bin/
mkdir -p $(PROJECT_DIR)bin/libs/
cp ../../../other/codeblocks/linux_clickToLaunchApp2.sh $(PROJECT_DIR)bin/$(TARGET_OUTPUT_BASENAME).sh
sed -i s/applicationName/$(TARGET_OUTPUT_BASENAME)/g $(PROJECT_DIR)bin/$(TARGET_OUTPUT_BASENAME).sh
# ok
build/Debug/src/main.o build/Release/src/main.o: src/main.cpp
mkdir -p $(OBJ_OUTPUT)src/
$(CC) -c $< -o $(OBJ_OUTPUT)src/main.o $(CFLAGS)
build/Debug/src/testApp.o build/Release/src/testApp.o: src/testApp.cpp
mkdir -p $(OBJ_OUTPUT)src/
$(CC) -c $< -o $(OBJ_OUTPUT)src/testApp.o $(CFLAGS)
clean:
-rm $(OBJS_Debug) $(OBJS_Release)
ifneq ($MAKECMDGOALS,clean)
build/Debug/src/main.dep: src/main.cpp
mkdir -p build/Debug/src/
$(CC) -M -MT build/Debug/src/main.o $(CFLAGS) src/main.cpp -MF build/Debug/src/main.dep
-include build/Debug/src/main.dep
build/Debug/src/testApp.dep: src/testApp.cpp
mkdir -p build/Debug/src/
$(CC) -M -MT build/Debug/src/testApp.o $(CFLAGS) src/testApp.cpp -MF build/Debug/src/testApp.dep
-include build/Debug/src/testApp.dep
build/Release/src/main.dep: src/main.cpp
mkdir -p build/Release/src/
$(CC) -M -MT build/Release/src/main.o $(CFLAGS) src/main.cpp -MF build/Release/src/main.dep
-include build/Release/src/main.dep
build/Release/src/testApp.dep: src/testApp.cpp
mkdir -p build/Release/src/
$(CC) -M -MT build/Release/src/testApp.o $(CFLAGS) src/testApp.cpp -MF build/Release/src/testApp.dep
-include build/Release/src/testApp.dep
endif