mirror of
https://github.com/libretro/smsplus-gx.git
synced 2024-12-14 04:59:04 +00:00
9bbdc89dfc
Also updating the other Makefiles accordingly.
47 lines
1.5 KiB
Makefile
47 lines
1.5 KiB
Makefile
PRGNAME = sms_sdl
|
|
|
|
# define regarding OS, which compiler to use
|
|
CC = /opt/bittboy-toolchain/bin/arm-miyoo-linux-musleabi-gcc
|
|
|
|
# add SDL dependencies
|
|
PORT = bittboy
|
|
SOUND_OUTPUT = portaudio
|
|
SOUND_ENGINE = maxim_sn76489
|
|
Z80_CORE = eighty
|
|
PROFILE = 0
|
|
|
|
CFLAGS = -O2 -fdata-sections -ffunction-sections -fno-common -std=gnu99 -DLSB_FIRST -DPERFORMANCE_HACK -DALIGN_DWORD -Wall -Wextra
|
|
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=/mnt/profile
|
|
else
|
|
CFLAGS += -fprofile-use
|
|
endif
|
|
|
|
ifeq ($(SOUND_ENGINE), maxim_sn76489)
|
|
CFLAGS += -DMAXIM_PSG
|
|
endif
|
|
|
|
LDFLAGS = -Wl,--start-group -lSDL -lasound -lm -lz -lc -no-pie -Wl,--as-needed -Wl,--gc-sections -s -flto
|
|
ifeq ($(SOUND_OUTPUT), portaudio)
|
|
LDFLAGS += -lportaudio
|
|
endif
|
|
LDFLAGS += -Wl,--end-group
|
|
|
|
# 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
|