-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.open2x
37 lines (30 loc) · 1.06 KB
/
Makefile.open2x
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=open2x
# This uses the Open2x toolchain-new installed into the default folder
# /opt/open2x
#
DEVPREFIX=/opt/open2x/gcc-4.1.1-glibc-2.3.6
SDL_CONFIG=$(DEVPREFIX)/bin/sdl-config
CC=$(DEVPREFIX)/arm-open2x-linux/bin/arm-open2x-linux-gcc
CFLAGS=-O3 -Wall -I$(DEVPREFIX)/include `$(SDL_CONFIG) --cflags` \
-DPLATFORM_GP2X -DVERSION=\"$(VERSION)\" -DPACKAGE_DATA_DIR=\"$(PACKAGE_DATA_DIR)\" \
-DOSS_SOUND_SUPPORT -DTOOLCHAIN_OPEN2X -DSZ81
LINK=$(CC)
LDFLAGS=-L$(DEVPREFIX)/lib
LIBS=-lstdc++ `$(SDL_CONFIG) --static-libs`
# You won't need to alter anything below
all: $(SOURCES) $(TARGET)
$(TARGET): $(OBJECTS)
$(LINK) -static $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
gp2x/build-$(TARGET)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: all clean
clean:
rm -f *.o