smsplus-gx/Makefile.gcw0
gameblabla 9bbdc89dfc
Add Makefiles for GCW0 and the New bittboy.
Also updating the other Makefiles accordingly.
2019-03-07 19:08:39 +01:00

48 lines
1.4 KiB
Makefile

PRGNAME = sms_sdl
# define regarding OS, which compiler to use
CC = /opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc
# add SDL dependencies
PORT = rs97
SOUND_OUTPUT = alsa
SOUND_ENGINE = maxim_sn76489
Z80_CORE = z80
PROFILE = 0
CFLAGS = -O3 -fdata-sections -ffunction-sections -mno-check-zero-division -funsafe-math-optimizations -fsingle-precision-constant -fno-common -mips32r2
CFLAGS += -std=gnu99 -DLSB_FIRST -DMAXIM_PSG
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=/usr/local/home/profile
else
CFLAGS += -fprofile-use
endif
ifeq ($(SOUND_ENGINE), maxim_sn76489)
CFLAGS += -DMAXIM_PSG
endif
LDFLAGS = -lSDL -lm -lz -lc -Wl,--as-needed -Wl,--gc-sections -s -flto
ifeq ($(SOUND_OUTPUT), alsa)
LDFLAGS += -lasound
endif
# Files to be r
SRCDIR = ./source ./source/unzip ./source/cpu_cores/$(Z80_CORE) ./source/sound
SRCDIR += ./source/generic ./source/ports/$(PORT) ./source/sound/$(SOUND_ENGINE) ./source/sound_output/$(SOUND_OUTPUT)
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