smsplus-gx/Makefile.rs97
2018-07-21 22:17:59 -04:00

38 lines
1.2 KiB
Makefile

PRGNAME = sms_sdl
# define regarding OS, which compiler to use
EXESUFFIX =
TOOLCHAIN =
CC = /opt/rs97-toolchain/bin/mipsel-linux-gcc
LD = /opt/rs97-toolchain/bin/mipsel-linux-gcc
# add SDL dependencies
SDL_LIB =
SDL_INCLUDE =
# change compilation / linking flag options
F_OPTS = -DHOME_SUPPORT -Icpu -Isound -I.
CC_OPTS = -msym32 -mlong-calls -fno-pic -fno-pie -O2 -mno-abicalls -fdata-sections -ffunction-sections -mips32 -mno-shared -mno-mips16 -O2 $(F_OPTS)
CFLAGS = -I$(SDL_INCLUDE) $(CC_OPTS)
CXXFLAGS =$(CFLAGS)
LDFLAGS = -lSDLmain -lSDL -lm -Wl,--as-needed -Wl,--gc-sections -flto -lz -s
# Files to be compiled
SRCDIR = . ./sound ./cpu ./rs97
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)
# Rules to make executable
$(PRGNAME)$(EXESUFFIX): $(OBJS)
$(LD) $(CFLAGS) -o $(PRGNAME)$(EXESUFFIX) $^ $(LDFLAGS)
$(OBJ_C) : %.o : %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f $(PRGNAME)$(EXESUFFIX) *.o