File: Makefile.gp2x

package info (click to toggle)
gnurobbo 0.68+dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 5,212 kB
  • sloc: ansic: 21,128; sh: 301; makefile: 185; awk: 98
file content (45 lines) | stat: -rw-r--r-- 1,464 bytes parent folder | download | duplicates (4)
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
# You won't need to alter these
TARGET=$(shell cat TARGET)
SOURCES=$(wildcard *.c)
OBJECTS=$(patsubst %.c, %.o, $(SOURCES))
VERSION=$(shell cat VERSION)
export PACKAGE_DATA_DIR=./data
export TOOLCHAIN=gp2x

# Comment out the line below if you want to disable music support
#MUSIC=-DHAVE_MUSIC
# Comment out the line below if you want to disable the designer
#DESIGNER=-DHAVE_DESIGNER

# Choose ONE of these and comment the other
export FONT_USE_PIXMAP=-DUSE_PIXMAP_FONT
#export FONT_USE_SDL_TTF=-lSDL_ttf

# 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
SDL_CONFIG=$(DEVPREFIX)/arm-gp2x-linux/bin/arm-linux-sdl-config
CC=$(DEVPREFIX)/bin/arm-gp2x-linux-gcc
CFLAGS=-O3 -pipe -Wall -fomit-frame-pointer \
	-I$(DEVPREFIX)/arm-gp2x-linux/include `$(SDL_CONFIG) --prefix=$(DEVPREFIX) --cflags` \
	-DPLATFORM_GP2X -DVERSION=\"$(VERSION)\" -DPACKAGE_DATA_DIR=\"$(PACKAGE_DATA_DIR)\" \
	$(FONT_USE_PIXMAP) $(MUSIC) $(DESIGNER)
LINK=$(CC)
LDFLAGS=-L$(DEVPREFIX)/arm-gp2x-linux/lib 
LIBS=`$(SDL_CONFIG) --prefix=$(DEVPREFIX) --libs` $(FONT_USE_SDL_TTF) -lSDL_image -lSDL_mixer

# 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