smsplus-gx/Makefile.rs97

44 lines
1.4 KiB
Makefile

PRGNAME = sms_sdl
# define regarding OS, which compiler to use
CC = /opt/rs97-toolchain/bin/mipsel-linux-gcc
# add SDL dependencies
PORT = rs97
SOUND_OUTPUT = oss
SOUND_ENGINE = maxim_sn76489
Z80_CORE = z80
PROFILE = 0
CFLAGS = -Ofast -fdata-sections -ffunction-sections -mno-check-zero-division -mno-fp-exceptions -mframe-header-opt -fsingle-precision-constant -fno-common -mips32 -fno-PIC -mno-abicalls
CFLAGS += -std=gnu99 -DLSB_FIRST -DALIGN_DWORD -DRS97
CFLAGS += -Isource -Isource/cpu_cores/$(Z80_CORE) -Isource/generic -Isource/ports/$(PORT) -I./source/sound -Isource/unzip -Isource/sdl -Isource/sound/$(SOUND_ENGINE) -Isource/sound_output
ifeq ($(PROFILE), 1)
CFLAGS += -fprofile-generate=/home/retrofw/profile
else
CFLAGS += -fprofile-use
endif
ifeq ($(SOUND_ENGINE), maxim_sn76489)
CFLAGS += -DMAXIM_PSG
endif
LDFLAGS = -lSDL -lm -lz -lc -no-pie -Wl,--as-needed -Wl,--gc-sections -s -flto
# Files to be r
SRCDIR = ./source ./source/unzip ./source/cpu_cores/$(Z80_CORE) ./source/sound ./source/sound_output/$(SOUND_OUTPUT) ./source/generic ./source/ports/$(PORT) ./source/sound/$(SOUND_ENGINE)
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) *.o