forked from retrofw/regba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.gcw0
70 lines (54 loc) · 2.96 KB
/
Makefile.gcw0
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
TARGET := regba/regba.elf
CHAINPREFIX := /opt/gcw0-toolchain
CROSS_COMPILE := $(CHAINPREFIX)/usr/bin/mipsel-linux-
CC := $(CROSS_COMPILE)gcc
STRIP := $(CROSS_COMPILE)strip
SYSROOT := $(shell $(CC) --print-sysroot)
SDL_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
SDL_LIBS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs)
OBJS := ./source/opendingux/main.o ./source/opendingux/draw.o ./source/opendingux/port.o ./source/opendingux/port-asm.o ./source/opendingux/od-input.o ./source/video.o \
./source/input.o ./source/bios.o ./source/zip.o ./source/sound.o ./source/mips/stub.o \
./source/stats.o ./source/memory.o ./source/cpu_common.o ./source/cpu_asm.o ./source/opendingux/od-sound.o \
./source/sha1.o ./source/opendingux/imageio.o ./source/unifont.o ./source/opendingux/gui.o ./source/opendingux/od-memory.o ./source/opendingux/settings.o
HEADERS := ./source/opendingux/cheats.h ./source/common.h ./source/cpu_common.h ./source/cpu.h ./source/opendingux/draw.h ./source/opendingux/main.h \
./source/input.h ./source/memory.h ./source/opendingux/message.h ./source/mips/emit.h ./source/sound.h \
./source/stats.h ./source/video.h ./source/zip.h ./source/opendingux/port.h ./source/opendingux/od-sound.h ./source/sha1.h \
./source/opendingux/imageio.h ./source/unifont.h ./source/opendingux/od-input.h ./source/opendingux/settings.h
INCLUDE := -I./source/opendingux/ -I./source -I./source/mips
OPTIMIZE = -O2 -mips32r2 -march=mips32r2 -mno-mips16 -fomit-frame-pointer -fno-builtin \
-fno-common -Wno-write-strings -Wno-sign-compare -ffast-math -ftree-vectorize \
-funswitch-loops -fno-strict-aliasing
DEFS := -DGCW_ZERO -DRETROGAME -DMIPS_XBURST -DLOAD_ALL_ROM \
-DGIT_VERSION=$(shell git describe --always)
HAS_MIPS32R2 := $(shell echo | $(CC) -dM -E - |grep _MIPS_ARCH_MIPS32R2)
ifneq ($(HAS_MIPS32R2),)
DEFS += -DMIPS_32R2
endif
CFLAGS := $(SDL_CFLAGS) -mno-abicalls -Wall -Wno-unused-variable \
-O2 -fomit-frame-pointer $(DEFS) $(INCLUDE) $(OPTIMIZE)
ASFLAGS := $(CFLAGS) -D__ASSEMBLY__
LDFLAGS := $(SDL_LIBS) -lpthread -lz -lm -lpng
DATA_TO_CLEAN := .opk_data $(TARGET).opk
include source/Makefile.rules
.PHONY: all opk
all: $(TARGET)
opk: $(TARGET)
@mksquashfs \
regba/default.retrofw.desktop \
regba/default.gcw0.desktop \
regba/regba.dge \
regba/regba.elf \
regba/game_config.txt \
regba/regba.png \
regba/regba.man.txt \
bios/gba_bios.bin \
regba/regba-sp-border-silver.png \
regba/regba.opk \
-all-root -noappend -no-exports -no-xattrs
# The two below declarations ensure that editing a .c file recompiles only that
# file, but editing a .h file recompiles everything.
# Courtesy of Maarten ter Huurne.
# Each object file depends on its corresponding source file.
$(C_OBJS): %.o: %.c
# Object files all depend on all the headers.
$(OBJS): $(HEADERS)