2013-08-10 07:27:17 +00:00
|
|
|
# Potator2x makefile
|
|
|
|
|
|
|
|
# Global definitions
|
|
|
|
|
|
|
|
CCPREFIX = arm-linux-
|
|
|
|
CC = ${CCPREFIX}gcc
|
|
|
|
CPP = ${CCPREFIX}g++
|
|
|
|
STRIP = ${CCPREFIX}strip
|
|
|
|
AS = ${CCPREFIX}as
|
|
|
|
PLATFORM =./platform/GP2X
|
|
|
|
|
|
|
|
PREFIX = /c/devkitPro/devkitGP2X/
|
2018-10-17 03:34:59 +00:00
|
|
|
OBJS = controls.o gpu.o \
|
|
|
|
memorymap.o sound.o \
|
|
|
|
timer.o watara.o m6502/m6502.o \
|
2013-08-10 07:27:17 +00:00
|
|
|
${PLATFORM}/main.o ${PLATFORM}/menues.o \
|
|
|
|
${PLATFORM}/memcmp.o ${PLATFORM}/memcpy.o \
|
|
|
|
${PLATFORM}/memset.o ${PLATFORM}/strcmp.o \
|
2019-07-03 02:22:22 +00:00
|
|
|
${PLATFORM}/strlen.o ${PLATFORM}/strncmp.o \
|
|
|
|
${PLATFORM}/lib/minimal.o
|
2013-08-10 07:27:17 +00:00
|
|
|
ASMOBJS = arm_stub.S
|
2019-07-03 02:22:22 +00:00
|
|
|
BIN = Potator2x
|
2013-08-10 07:27:17 +00:00
|
|
|
|
2019-07-03 02:22:22 +00:00
|
|
|
# Platform specific definitions
|
2013-08-10 07:27:17 +00:00
|
|
|
|
|
|
|
VPATH += common/
|
2019-07-03 02:22:22 +00:00
|
|
|
CFLAGS += -O3 -Wall
|
2013-08-10 07:27:17 +00:00
|
|
|
# NOTE: -funroll-loops will slow down compiling considerably
|
|
|
|
CFLAGS += -funroll-loops -fstrength-reduce -fstrict-aliasing -fexpensive-optimizations -falign-functions -fweb -frename-registers -fomit-frame-pointer -ffast-math -fno-builtin -fno-common -finline -finline-functions
|
2019-07-03 02:22:22 +00:00
|
|
|
#CFLAGS += -fsigned-char
|
2013-08-10 07:27:17 +00:00
|
|
|
CXXFLAGS = ${CFLAGS} -fno-exceptions -fno-rtti
|
2019-07-03 02:22:22 +00:00
|
|
|
ASFLAGS = ${CFLAGS}
|
2013-08-10 07:27:17 +00:00
|
|
|
INCLUDES = -I${PLATFORM} -I${PLATFORM}/lib -I./common -I${PREFIX}/include
|
|
|
|
LIBS = -L${PREFIX}/lib -static -lpthread -lm
|
|
|
|
|
|
|
|
# Compilation:
|
|
|
|
|
|
|
|
.SUFFIXES: .c
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
${CC} ${CFLAGS} ${INCLUDES} -c $<
|
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
$(CPP) $(CXXFLAGS) ${INCLUDES} -c $<
|
|
|
|
%.o: %.S
|
2019-07-03 02:22:22 +00:00
|
|
|
$(CC) ${CFLAGS} -s -c $<
|
2013-08-10 07:27:17 +00:00
|
|
|
all: ${OBJS}
|
2019-07-03 02:22:22 +00:00
|
|
|
${CC} *.o ${LIBS} -o ${BIN}.gpe
|
|
|
|
${STRIP} ${BIN}.gpe
|
|
|
|
gpecomp ${BIN}.gpe ${BIN}_comp.gpe
|
2013-08-10 07:27:17 +00:00
|
|
|
|
|
|
|
clean:
|
2019-07-03 02:22:22 +00:00
|
|
|
rm -f *.o ${BIN}.gpe ${BIN}_comp.gpe
|