-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
137 lines (120 loc) · 3.43 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#PLATFORM = linux_x86
#PLATFORM = linux_x64
#PLATFORM = mingw32 # win32
#PLATFORM = cegcc # wince (arm)
#PLATFORM = gizmondo
#PLATFORM = gp2x
#PLATFORM = wiz
#PLATFORM = caanoo
#PLATFORM = dingux
#PLATFORM = gcw
PLATFORM ?= linux_x86
### Dingoo/Dingux
ifeq ($(PLATFORM), dingux)
CXX = mipsel-linux-g++
STRIP = mipsel-linux-strip
CFLAGS = -mips32 -mtune=mips32 -G0 -fomit-frame-pointer -ffunction-sections -ffast-math -fsingle-precision-constant -mbranch-likely
INCLUDE = -I/opt/opendingux-toolchain/usr/include/SDL
LIB = -lSDL -lpthread
endif
### GCW Zero
ifeq ($(PLATFORM), gcw)
CXX = /opt/gcw0-toolchain/usr/bin/mipsel-gcw0-linux-uclibc-g++
STRIP = /opt/gcw0-toolchain/usr/bin/mipsel-gcw0-linux-uclibc-strip
CFLAGS = -mips32 -mtune=mips32 -G0 -fomit-frame-pointer -ffunction-sections -ffast-math -fsingle-precision-constant -mbranch-likely -DAP_AUDIO_SDLMIXER
LDFLAGS = -L/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib/
INCLUDE = -I/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include/ -I/opt/opendingux-toolchain/usr/include/SDL
LIB = -lSDL_mixer -lSDL -lpthread
endif
### GP2X/Wiz
ifeq ($(PLATFORM), gp2x)
CXX = arm-open2x-linux-g++
STRIP = arm-open2x-linux-strip
CFLAGS =
LDFLAGS = -static # GP2X requires static linking, Wiz does not
LDFLAGS += -L/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/
INCLUDE = -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/
LIB = -lSDL -lpthread
endif
ifeq ($(PLATFORM), wiz)
CXX = arm-open2x-linux-g++
STRIP = arm-open2x-linux-strip
CFLAGS =
LDFLAGS += -L/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/
INCLUDE = -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/
LIB = -lSDL -lpthread
endif
### Caanoo
ifeq ($(PLATFORM), caanoo)
CXX = arm-gph-linux-gnueabi-g++
STRIP = arm-gph-linux-gnueabi-strip
CFLAGS =
LIB = -lSDL -lpthread
endif
### x86 linux
ifeq ($(PLATFORM), linux_x86)
CXX = g++
STRIP = strip
CFLAGS = -DAP_AUDIO_SDLMIXER
INCLUDE = -I/usr/include/ -I/usr/include/SDL
LIB = -lSDL_mixer -lSDL -lpthread
endif
### win32
ifeq ($(PLATFORM), mingw32)
CFLAGS =
INCLUDE = -I/usr/i486-mingw32/include
CXX = i486-mingw32-g++
STRIP = i486-mingw32-strip
LIB = -lmingw32 -lSDLmain -lSDL -lpthread -mwindows
endif
### wince (arm)
ifeq ($(PLATFORM), cegcc)
CFLAGS = -D_WIN32_IE=0x0400
INCLUDE = -I/opt/cegcc/arm-cegcc/include/
LDFLAGS = -static -L/opt/cegcc/arm-cegcc/lib/
CXX = arm-cegcc-g++
STRIP = arm-cegcc-strip
LIB = -lSDL -lpthread -mwindows
endif
### Gizmondo
ifeq ($(PLATFORM), gizmondo)
CFLAGS = -Wall -ffast-math -funroll-loops -mcpu=arm920 -mtune=arm920t -fstrict-aliasing -fexpensive-optimizations -falign-functions -fweb -frename-registers -fomit-frame-pointer -finline -finline-functions -fno-builtin -fno-common -mstructure-size-boundary=8
INCLUDE = -I/opt/cegcc/arm-cegcc/gizmondo/include/
LDFLAGS = -static -L/opt/cegcc/arm-cegcc/gizmondo/lib/
CXX = arm-cegcc-g++
STRIP = arm-cegcc-strip
LIB = /opt/cegcc/arm-cegcc/gizmondo/lib/SDL.dll -lm -lpthread
endif
###
ifdef DEBUG
CFLAGS += -fpermissive -Wextra -Wall -ggdb3 -c -O2
else
CFLAGS += -fpermissive -c -O2
endif
SRC = ai.cpp \
all.cpp \
apricots.cpp \
collide.cpp \
drak.cpp \
drawall.cpp \
fall.cpp \
finish.cpp \
game.cpp \
init.cpp \
menu.cpp \
sampleio.cpp \
SDLfont.cpp \
setup.cpp \
shape.cpp
OBJ = $(SRC:.cpp=.o)
EXE = apricots.elf
build : $(SRC) $(EXE)
$(EXE): $(OBJ)
$(CXX) $(LDFLAGS) $(OBJ) $(LIB) -o $@
ifndef DEBUG
$(STRIP) $(EXE)
endif
.cpp.o:
$(CXX) $(CFLAGS) $(INCLUDE) $< -o $@
clean:
rm -rf *.o $(EXE)