forked from Nebuleon/ReGBA
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile.dingoo
87 lines (73 loc) · 2.64 KB
/
Makefile.dingoo
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
TARGET := regba
CROSS_COMPILE ?= /opt/opendingux-toolchain/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
OBJS += ./source/opendingux/draw.o
OBJS += ./source/opendingux/port.o
OBJS += ./source/opendingux/port-asm.o
OBJS += ./source/opendingux/od-input.o
OBJS += ./source/video.o
OBJS += ./source/input.o
OBJS += ./source/bios.o
OBJS += ./source/zip.o
OBJS += ./source/sound.o
OBJS += ./source/mips/stub.o
OBJS += ./source/stats.o
OBJS += ./source/memory.o
OBJS += ./source/cpu_common.o
OBJS += ./source/cpu_asm.o
OBJS += ./source/opendingux/od-sound.o
OBJS += ./source/sha1.o
OBJS += ./source/opendingux/imageio.o
OBJS += ./source/unifont.o
OBJS += ./source/opendingux/gui.o
OBJS += ./source/opendingux/od-memory.o
OBJS += ./source/opendingux/settings.o
HEADERS = ./source/opendingux/cheats.h
HEADERS += ./source/common.h
HEADERS += ./source/cpu_common.h
HEADERS += ./source/cpu.h
HEADERS += ./source/opendingux/draw.h
HEADERS += ./source/opendingux/main.h
HEADERS += ./source/input.h
HEADERS += ./source/memory.h
HEADERS += ./source/opendingux/message.h
HEADERS += ./source/mips/emit.h
HEADERS += ./source/sound.h
HEADERS += ./source/stats.h
HEADERS += ./source/video.h
HEADERS += ./source/zip.h
HEADERS += ./source/opendingux/port.h
HEADERS += ./source/opendingux/od-sound.h
HEADERS += ./source/sha1.h
HEADERS += ./source/opendingux/imageio.h
HEADERS += ./source/unifont.h
HEADERS += ./source/opendingux/od-input.h
HEADERS += ./source/opendingux/settings.h
INCLUDE := -I./source/opendingux/ -I./source -I./source/mips
DEFS := -DDINGOO_A320 -DMIPS_XBURST -DUSE_MMAP \
-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)
ASFLAGS := $(CFLAGS) -D__ASSEMBLY__
LDFLAGS := $(SDL_LIBS) -lpthread -lz -lm -lpng
DATA_TO_CLEAN := $(TARGET).dge
include ../Makefile.rules
.PHONY: all dge
all: $(TARGET)
dge: $(TARGET).dge
# 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)