forked from retrofw/race-od
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.pc
54 lines (45 loc) · 2.31 KB
/
Makefile.pc
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
# Define compilation type
#OSTYPE=msys
OSTYPE=opendingux
# define regarding OS, which compiler to use
PRGNAME = race-od/race-od.dge
# TOOLCHAIN = /opt/mipsel-linux-uclibc/usr
CC = gcc
LD = gcc
# add SDL dependencies
SYSROOT := $(shell $(CC) --print-sysroot)
SDL_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
SDL_LIBS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs)
F_OPTS = -falign-functions -falign-loops -falign-labels -falign-jumps \
-ffast-math -fsingle-precision-constant -funsafe-math-optimizations \
-fomit-frame-pointer -fno-builtin -fno-common \
-fstrict-aliasing -fexpensive-optimizations \
-finline -finline-functions -fpeel-loops
CC_OPTS = -O0 -ggdb -D_OPENDINGUX_ $(F_OPTS)
CFLAGS = -I$(SDL_INCLUDE) -DOPENDINGUX -DZ80 -DTARGET_OD -D_MAX_PATH=2048 -DHOST_FPS=60 $(CC_OPTS)
CXXFLAGS=$(CFLAGS)
LDFLAGS = -L$(SDL_LIB) $(CC_OPTS) -lstdc++ -lSDL -lSDL_image -lpng
# Files to be compiled
SRCDIR = ./emu ./opendingux .
VPATH = $(SRCDIR)
SRC_C = $(foreach dir, $(SRCDIR), $(wildcard $(dir)/*.cpp))
OBJ_C = $(notdir $(patsubst %.cpp, %.o, $(SRC_C)))
OBJS = $(OBJ_C)
# Rules to make executable
$(PRGNAME): $(OBJS)
$(LD) $(LDFLAGS) -o $(PRGNAME) $^
$(OBJ_C): %.o : %.cpp
$(CC) $(CXXFLAGS) -c -o $@ $<
ipk: $(PRGNAME)
@rm -rf /tmp/.race-od-ipk/ && mkdir -p /tmp/.race-od-ipk/root/home/retrofw/emus/race-od /tmp/.race-od-ipk/root/home/retrofw/apps/gmenu2x/sections/emulators /tmp/.race-od-ipk/root/home/retrofw/apps/gmenu2x/sections/emulators.systems
@cp -r race-od/race-od.dge race-od/*.png race-od/race-od.man.txt /tmp/.race-od-ipk/root/home/retrofw/emus/race-od
@cp race-od/race-od.lnk /tmp/.race-od-ipk/root/home/retrofw/apps/gmenu2x/sections/emulators
@cp race-od/ngp.race-od.lnk /tmp/.race-od-ipk/root/home/retrofw/apps/gmenu2x/sections/emulators.systems
@sed "s/^Version:.*/Version: $$(date +%Y%m%d)/" race-od/control > /tmp/.race-od-ipk/control
@cp race-od/conffiles /tmp/.race-od-ipk/
@tar --owner=0 --group=0 -czvf /tmp/.race-od-ipk/control.tar.gz -C /tmp/.race-od-ipk/ control conffiles
@tar --owner=0 --group=0 -czvf /tmp/.race-od-ipk/data.tar.gz -C /tmp/.race-od-ipk/root/ .
@echo 2.0 > /tmp/.race-od-ipk/debian-binary
@ar r race-od/race-od.ipk /tmp/.race-od-ipk/control.tar.gz /tmp/.race-od-ipk/data.tar.gz /tmp/.race-od-ipk/debian-binary
clean:
rm -f $(PRGNAME) *.o