-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.gp2x
36 lines (30 loc) · 1.18 KB
/
Makefile.gp2x
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
# You won't need to alter these
TARGET=$(shell cat TARGET)
SOURCES=sdl_main.c common.c sound.c z80.c sdl_engine.c sdl_hotspots.c \
sdl_input.c sdl_loadsave.c sdl_resources.c sdl_sound.c sdl_video.c
OBJECTS=$(patsubst %.c, %.o, $(SOURCES))
VERSION=$(shell cat VERSION)
export PACKAGE_DATA_DIR=./data
export TOOLCHAIN=gp2x
# This uses the GPH GP2XSDK with a different installation directory
# (the GPH default is /gp2xsdk/Tools and mine is /opt/gp2xsdk) so you
# will need to modify at least DEVPREFIX below
DEVPREFIX=/opt/gp2xsdk
CC=$(DEVPREFIX)/bin/arm-gp2x-linux-gcc
CFLAGS=-O3 -Wall -I$(DEVPREFIX)/arm-gp2x-linux/include \
`$(DEVPREFIX)/arm-gp2x-linux/bin/arm-linux-sdl-config --prefix=$(DEVPREFIX) --cflags` \
-DPLATFORM_GP2X -DVERSION=\"$(VERSION)\" -DPACKAGE_DATA_DIR=\"$(PACKAGE_DATA_DIR)\" \
-DOSS_SOUND_SUPPORT -DSZ81
LINK=$(CC)
LDFLAGS=-L$(DEVPREFIX)/arm-gp2x-linux/lib
LIBS=`$(DEVPREFIX)/arm-gp2x-linux/bin/arm-linux-sdl-config --prefix=$(DEVPREFIX) --libs`
# You won't need to alter anything below
all: $(SOURCES) $(TARGET)
$(TARGET): $(OBJECTS)
$(LINK) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
gp2x/build-$(TARGET)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: all clean
clean:
rm -f *.o