File: Makefile.open2x

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,387 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=open2x

# 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 -lfreetype

# 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 -pipe -Wall -fomit-frame-pointer \
	-I$(DEVPREFIX)/include `$(SDL_CONFIG) --cflags` \
	-DPLATFORM_GP2X -DTOOLCHAIN_OPEN2X -DVERSION=\"$(VERSION)\" \
	-DPACKAGE_DATA_DIR=\"$(PACKAGE_DATA_DIR)\" $(FONT_USE_PIXMAP) $(MUSIC) $(DESIGNER)
LINK=$(CC)
LDFLAGS=-L$(DEVPREFIX)/lib 
LIBS=$(FONT_USE_SDL_TTF) -lSDL_image -lpng -ljpeg -lz -lSDL_mixer -lsmpeg -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