forked from svkaiser/PowerslaveEX
-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
77 lines (67 loc) · 1.92 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
74
75
76
77
NAME=powerslave_ex
CXX=clang
FLAGS ="-std=c++11"
FLAGS+="-fpermissive"
FLAGS+="-w"
FFMPEG_VERSION="n2.7.2"
INCL ="-Isource"
INCL+="-Isource/framework"
INCL+="-Isource/game"
INCL+="-Isource/math"
INCL+="-Isource/movie"
INCL+="-Isource/opengl"
INCL+="-Isource/renderer"
INCL+="-Isource/script"
INCL+="-Isource/script/objects"
INCL+="-Isource/script/al"
INCL+="-Isource/system"
INCL+="-Isource/system/sdl"
INCL+="-Isource/tools"
INCL+="-Isource/tools/mapEditor"
INCL+="-Ilib/angelscript/sdk/angelscript/include"
INCL+="-Ilib/ffmpeg/FFmpeg-$(FFMPEG_VERSION)"
LINK ="-lm"
LINK+="-lpthread"
LINK+="-lstdc++"
LINK+="-lGL"
LINK+="-lpng"
LINK+="-logg"
LINK+="-lvorbisfile"
LINK+="-lopenal"
LINK+="-lSDL2"
LINK+="-lz"
LINK+="-Llib/ffmpeg/FFmpeg-$(FFMPEG_VERSION)/libavutil"
LINK+="-Llib/ffmpeg/FFmpeg-$(FFMPEG_VERSION)/libavcodec"
LINK+="-Llib/ffmpeg/FFmpeg-$(FFMPEG_VERSION)/libavformat"
LINK+="-Llib/ffmpeg/FFmpeg-$(FFMPEG_VERSION)/libswscale"
LINK+="-Llib/ffmpeg/FFmpeg-$(FFMPEG_VERSION)/libswresample"
LINK+="-lavutil"
LINK+="-lavcodec"
LINK+="-lavformat"
LINK+="-lswscale"
LINK+="-lswresample"
OBJS=$(shell make/obj.sh)
bin/$(NAME): $(OBJS) lib/angelscript/sdk/angelscript/lib/libangelscript.a
@echo "compiling executable $@"
@mkdir -p $(@D)/shared game_data
@$(CXX) -o $@ $^ $(LINK)
@cp lib/ffmpeg/FFmpeg-$(FFMPEG_VERSION)/libavutil/libavutil.so $(@D)/shared
@cp lib/ffmpeg/FFmpeg-$(FFMPEG_VERSION)/libavcodec/libavcodec.so $(@D)/shared
@cp lib/ffmpeg/FFmpeg-$(FFMPEG_VERSION)/libavformat/libavformat.so $(@D)/shared
@cp lib/ffmpeg/FFmpeg-$(FFMPEG_VERSION)/libswscale/libswscale.so $(@D)/shared
@cp lib/ffmpeg/FFmpeg-$(FFMPEG_VERSION)/libswresample/libswresample.so $(@D)/shared
@cp -rT game_data bin/
@mkdir $(@D)/mods
@mkdir $(@D)/saves
@cp make/run.sh $(@D)
obj/%.o: %.cpp
@echo "building object $@"
@mkdir -p $(@D)
@$(CXX) $(INCL) $(FLAGS) -c -o $@ $<
lib:
@./make/lib.sh
run: bin/$(NAME)
@./bin/run.sh
clean:
@echo "cleaning"
rm -rf bin obj