-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
58 lines (36 loc) · 1.43 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
prefix =
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
#PROFILE=YES
PROFILE=APPLY
CC = /opt/rs90-toolchain/bin/mipsel-linux-gcc
LD = $(CC)
AS = $(CC)
CFLAGS += -Ofast -mips32 -fdata-sections -ffunction-sections -mno-fp-exceptions -mno-check-zero-division -mframe-header-opt -fsingle-precision-constant -fno-common -march=mips32 -mtune=mips32
CFLAGS += -fno-common
CFLAGS += -mlong32 -mno-micromips -mno-interlink-compressed
CFLAGS += -flto -funroll-loops -fsection-anchors
CFLAGS += -fno-stack-protector -fomit-frame-pointer -falign-functions=1 -falign-jumps=1 -falign-loops=1
CFLAGS += -D_GNU_SOURCE=1 -DIS_LITTLE_ENDIAN
LDFLAGS = -lc -lgcc -lm -lSDL -lasound -lz -no-pie -Wl,--as-needed -Wl,--gc-sections -flto -s
ifeq ($(PROFILE), YES)
CFLAGS += -fprofile-generate="/media/data/local/home"
LDFLAGS += -lgcov
else ifeq ($(PROFILE), APPLY)
CFLAGS += -fprofile-use
endif
ASFLAGS = $(CFLAGS)
TARGETS = sdlgnuboy.dge
ASM_OBJS =
SYS_DEFS = -DIS_LITTLE_ENDIAN -DIS_LINUX -DNATIVE_AUDIO
SYS_OBJS = sys/nix/nix.o $(ASM_OBJS)
SYS_INCS = -I./sys/nix -Ifont -Isrc/core -Isys
SDL_OBJS = sys/sdl/sdl.o sys/sdl/keymap.o sys/sdl/scaler.o sys/sdl/font_drawing.o sys/alsa/alsa.o
all: $(TARGETS)
include Rules
$(TARGETS): $(OBJS) $(SYS_OBJS) $(SDL_OBJS)
$(LD) $(CFLAGS) $(OBJS) $(SYS_OBJS) $(SDL_OBJS) -o $@ $(LDFLAGS)
clean:
rm -f *gnuboy gmon.out src/core/*.o sys/*.o sys/*/*.o
clean_gcda:
rm -f src/core/*.gcda sys/*.gcda sys/*/*.gcda