-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile.rs97
46 lines (37 loc) · 1.72 KB
/
Makefile.rs97
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
PRGNAME = swanemu
CC = /opt/rs97-toolchain/bin/mipsel-linux-gcc
PROFILE = 0
# change compilation / linking flag options
INCLUDES = -Ishell/input/sdl -Icore -Icore/sound -Ishell/menu -Ishell/video/sdl -Ishell/audio -Ishell/scalers -Ishell/headers
DEFINES = -DLSB_FIRST -DINLINE="inline" -DWANT_16BPP -DFRONTEND_SUPPORTS_RGB565 -DSUPPORT_NATIVE_RESOLUTION
DEFINES += -DOSS_SOUND -DFRAMESKIP -DIPU_SCALE -DRS97
CFLAGS = $(INCLUDES) $(DEFINES)
CFLAGS += -std=gnu99
CFLAGS += -Ofast -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-PIC -mno-abicalls
CFLAGS += -mlong32 -mno-micromips -mno-interlink-compressed -flto -mno-mips16
CFLAGS += $(FLTO_FLAGS) -funroll-loops -fsection-anchors
CFLAGS += -fno-stack-protector -fomit-frame-pointer -falign-functions=1 -falign-jumps=1 -falign-loops=1
ifeq ($(PROFILE), 1)
CFLAGS += -fprofile-generate=/home/retrofw/profile
else ifeq ($(PROFILE), 2)
CFLAGS += -fprofile-use -fbranch-probabilities
endif
LDFLAGS = -nodefaultlibs -lc -lm -lgcc -lSDL -Wl,--as-needed -Wl,--gc-sections -flto -no-pie -s
ifeq ($(PROFILE), 1)
LDFLAGS += -lgcov
endif
# Files to be compiled
SRCDIR = ./core ./core/sound ./core/wswan
SRCDIR += ./shell/video/fbdev ./shell/audio/oss ./shell/input/event ./shell/menu ./shell/emu ./shell/scalers
VPATH = $(SRCDIR)
SRC_C = $(foreach dir, $(SRCDIR), $(wildcard $(dir)/*.c))
OBJ_C = $(notdir $(patsubst %.c, %.o, $(SRC_C)))
OBJS = $(OBJ_C)
# Rules to make executable
$(PRGNAME): $(OBJS)
$(CC) $(CFLAGS) -o $(PRGNAME) $^ $(LDFLAGS)
$(OBJ_C) : %.o : %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f $(PRGNAME)$(EXESUFFIX) *.o