forked from gameblabla/divi-dead
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.rs90
43 lines (34 loc) · 1.41 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
39
40
41
42
43
PRGNAME = dividead.elf
CC = /opt/rs90-toolchain/bin/mipsel-linux-gcc
CXX = /opt/rs90-toolchain/bin/mipsel-linux-g++
VIDEO_FORMAT = ROQ
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
INCLUDES = -I. -Isrc -Isrc/smpeg -IRES
DEFINES = -DRS90 -DDISABLE_MIDI
CFLAGS = -Ofast -fdata-sections -ffunction-sections -flto -fno-common -Wall $(INCLUDES) $(DEFINES)
CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++98
LDFLAGS = -Wl,--as-needed -Wl,--gc-sections -lc -lgcc -lm -lSDL -lasound -lSDL_image -lpng -ljpeg -lSDL_mixer -lmikmod -logg -lmpg123 -lvorbisidec -lSDL_ttf -lfreetype -lm -lstdc++ -lz -s -flto
# Files to be compiled
SRCDIR = ./src ./RES
ifeq ($(VIDEO_FORMAT), ROQ)
DEFINES += -DENABLE_VIDEO_ROQ -DALSA_SOUND
SRCDIR += ./src/roq
else
DEFINES += -DENABLE_VIDEO_SMPEG
SRCDIR += ./src/smpeg ./src/smpeg/video ./src/smpeg/audio
endif
VPATH = $(SRCDIR)
SRC_C = $(foreach dir, $(SRCDIR), $(wildcard $(dir)/*.c))
SRC_CPP = $(foreach dir, $(SRCDIR), $(wildcard $(dir)/*.cpp))
OBJ_C = $(notdir $(patsubst %.c, %.o, $(SRC_C)))
OBJ_CPP = $(notdir $(patsubst %.cpp, %.o, $(SRC_CPP)))
OBJS = $(OBJ_C) $(OBJ_CPP)
# Rules to make executable
$(PRGNAME): $(OBJS)
$(CC) $(CFLAGS) -std=gnu99 -o $(PRGNAME) $^ $(LDFLAGS)
$(OBJ_CPP) : %.o : %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
clean:
rm -f $(PRGNAME) *.o
clean_all:
rm -f $(PRGNAME) *.o RES/*.c RES/*.CHARS RES/SPLASH.JPG RES/END/*.lz