-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
106 lines (90 loc) · 3.69 KB
/
Makefile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#
# Dingux MSX for the RetroFW
#
# by pingflood; 2019
#
CHAINPREFIX := /opt/mipsel-linux-uclibc
CROSS_COMPILE := $(CHAINPREFIX)/usr/bin/mipsel-linux-
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
STRIP = $(CROSS_COMPILE)strip
SYSROOT := $(shell $(CC) --print-sysroot)
MSX_VERSION=1.1.0
TARGET = dingux-msx/dingux-msx.dge
SDL_CONFIG = $(SYSROOT)/usr/bin/sdl-config
OBJS = ./src/gp2x_psp.o \
./src/cpudingux.o \
./src/fMSX.o ./src/MSX.o ./src/Patch.o ./src/Sound.o ./src/Disk.o \
./src/Z80.o ./src/I8255.o ./src/AY8910.o ./src/YM2413.o ./src/SCC.o ./src/V9938.o ./src/I8251.o \
./src/SDLgfx.o ./src/SDLsnd.o ./src/SDLfilter.o \
./src/emu2413.o ./src/emu2212.o ./src/emu2149.o \
./src/fmopl.o ./src/ymdeltat.o \
./src/psp_main.o \
./src/psp_sdl.o \
./src/psp_kbd.o \
./src/psp_font.o \
./src/psp_menu.o \
./src/psp_joy.o \
./src/psp_danzeff.o \
./src/psp_menu_set.o \
./src/psp_menu_help.o \
./src/psp_menu_joy.o \
./src/psp_menu_kbd.o \
./src/psp_menu_cheat.o \
./src/psp_menu_list.o \
./src/psp_editor.o \
./src/unzip.o \
./src/ioapi.o \
./src/sha1.o \
./src/psp_fmgr.o
DEFAULT_CFLAGS = $(shell $(SDL_CONFIG) --cflags)
MORE_CFLAGS = -DFMSX -DUNIX -DNARROW -DSOUND -DBPP16 -DSDL -DLSB_FIRST -std=gnu11
MORE_CFLAGS += -I. -I$(CHAINPREFIX)/usr/include/
MORE_CFLAGS += -DMPU_JZ4740 -mips32 -G0
MORE_CFLAGS += -O3 -fsigned-char -ffast-math -fomit-frame-pointer -fno-strength-reduce
MORE_CFLAGS += -DDINGUX_MODE
MORE_CFLAGS += -DLINUX_MODE
MORE_CFLAGS += -DNO_STDIO_REDIRECT
MORE_CFLAGS += -DMSX_VERSION=\"$(MSX_VERSION)\"
MORE_CFLAGS += -O2 -fomit-frame-pointer -ffunction-sections -ffast-math -fsingle-precision-constant
LDFLAGS = -s -lm -lz `$(SDL_CONFIG) --libs`
LDFLAGS += -Wl,--gc-sections
LIBS += -lSDL_image -lpng
LIBS += -lpthread -ldl
LIBS += -B$(SYSROOT)/usr/lib
LIBS += -R$(SYSROOT)/usr/lib
LIBS += -L$(SYSROOT)/usr/lib
CFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS) $(CFLAGS) $(OBJS) $(LIBS) -o $(TARGET) && $(STRIP) $(TARGET)
ipk: $(TARGET)
@rm -rf /tmp/.dingux-msx-ipk/ && mkdir -p /tmp/.dingux-msx-ipk/root/home/retrofw/emus/dingux-msx /tmp/.dingux-msx-ipk/root/home/retrofw/apps/gmenu2x/sections/emulators /tmp/.dingux-msx-ipk/root/home/retrofw/apps/gmenu2x/sections/emulators.systems
@cp -r dingux-msx/*.rom dingux-msx/dingux-msx.dge dingux-msx/dingux-msx.man.txt dingux-msx/dingux-msx.png dingux-msx/splash.png dingux-msx/thumb.png dingux-msx/graphics /tmp/.dingux-msx-ipk/root/home/retrofw/emus/dingux-msx
@cp dingux-msx/dingux-msx.lnk /tmp/.dingux-msx-ipk/root/home/retrofw/apps/gmenu2x/sections/emulators
@cp dingux-msx/msx.dingux-msx.lnk /tmp/.dingux-msx-ipk/root/home/retrofw/apps/gmenu2x/sections/emulators.systems
@sed "s/^Version:.*/Version: $$(date +%Y%m%d)/" dingux-msx/control > /tmp/.dingux-msx-ipk/control
@cp dingux-msx/conffiles dingux-msx/preinst /tmp/.dingux-msx-ipk/
@chmod +x /tmp/.dingux-msx-ipk/preinst
@tar --owner=0 --group=0 -czvf /tmp/.dingux-msx-ipk/control.tar.gz -C /tmp/.dingux-msx-ipk/ control conffiles preinst
@tar --owner=0 --group=0 -czvf /tmp/.dingux-msx-ipk/data.tar.gz -C /tmp/.dingux-msx-ipk/root/ .
@echo 2.0 > /tmp/.dingux-msx-ipk/debian-binary
@ar r dingux-msx/dingux-msx.ipk /tmp/.dingux-msx-ipk/control.tar.gz /tmp/.dingux-msx-ipk/data.tar.gz /tmp/.dingux-msx-ipk/debian-binary
opk: $(TARGET)
@mksquashfs \
dingux-msx/default.retrofw.desktop \
dingux-msx/msx.retrofw.desktop \
dingux-msx/*.rom \
dingux-msx/dingux-msx.dge \
dingux-msx/dingux-msx.man.txt \
dingux-msx/dingux-msx.png \
dingux-msx/splash.png \
dingux-msx/thumb.png \
dingux-msx/graphics \
dingux-msx/dingux-msx.opk \
-all-root -noappend -no-exports -no-xattrs
ctags:
ctags *[ch]
clean:
rm -f $(OBJS) $(TARGET) ./dingux-msx/dingux-msx.ipk