forked from gameblabla/oswan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.rs90
38 lines (30 loc) · 1.52 KB
/
Makefile.rs90
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
PRGNAME = oswan
CC = /opt/rs90-toolchain/bin/mipsel-linux-gcc
PROFILE = APPLY
SRCDIR = ./main/sdl ./main/sound ./main/emu/cpu ./main/emu ./main/menu ./main/scalers
SRCDIR += ./source/scalers ./source/ports/$(PORT) ./source/sound/$(SOUND_ENGINE) ./source/sound_output/$(SOUND_OUTPUT)
VPATH = $(SRCDIR)
SRC_C = $(foreach dir, $(SRCDIR), $(wildcard $(dir)/*.c))
SRC_CP = $(foreach dir, $(SRCDIR), $(wildcard $(dir)/*.cpp))
OBJ_C = $(notdir $(patsubst %.c, %.o, $(SRC_C)))
OBJ_CP = $(notdir $(patsubst %.cpp, %.o, $(SRC_CP)))
OBJS = $(OBJ_C) $(OBJ_CP)
CFLAGS += -DRS90 -DSOUND_ON -DSOUND_EMULATION -DFRAMESKIP -Ofast -mips32 -fdata-sections -ffunction-sections -mno-check-zero-division -flto -mplt -mno-shared -fno-PIC -fno-caller-saves -DNATIVE_AUDIO -DNATIVE_SOUND -DSHOW_LCD_ICON
CFLAGS += -mno-fp-exceptions -mno-check-zero-division -mframe-header-opt -fsingle-precision-constant -ffast-math
CFLAGS += -fno-stack-protector -fomit-frame-pointer -falign-functions=1 -falign-jumps=1 -falign-loops=1
ifeq ($(PROFILE), YES)
CFLAGS += -fprofile-generate=/media/data/local/home
LDFLAGS += -lgcov
else ifeq ($(PROFILE), APPLY)
# CFLAGS += -fprofile-use
endif
CFLAGS += -std=gnu99
CFLAGS += -Imain/emu -Imain/sdl -Imain/headers -Imain/menu -Imain/sound -Imain/scalers
LDFLAGS = -lc -lgcc -lSDL -lz -lm -Wl,--as-needed -Wl,--gc-sections -flto -s
# Rules to make executable
$(PRGNAME): $(OBJS)
$(CC) $(CFLAGS) -o $(PRGNAME) $^ $(LDFLAGS)
$(OBJ_C) : %.o : %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f $(PRGNAME) *.o