forked from lantus/Cannonball-C
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.bittboy
48 lines (39 loc) · 2.26 KB
/
Makefile.bittboy
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
44
45
46
47
48
CHAINPREFIX=/opt/bittboy-toolchain
CROSS_COMPILE=$(CHAINPREFIX)/usr/bin/arm-linux-
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
STRIP = $(CROSS_COMPILE)strip
SYSROOT := $(CHAINPREFIX)/usr/arm-buildroot-linux-musleabihf/sysroot
SDL_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
SDL_LIBS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs)
PROFILE = APPLY
CFLAGS = -I./ -I./engine/audio -I./src -I./hwvideo -I./engine -I./directx -I./frontend -I./hwaudio -I./sdl
CFLAGS += -Ofast -fdata-sections -ffunction-sections -flto -fno-PIC -Wall $(FFLAGS) $(SDL_CFLAGS) -DSDL -DCOMPILE_SOUND_CODE -DHOME_SUPPORT -DBITTBOY -DRENDER_240
ifeq ($(PROFILE), YES)
CFLAGS += -fprofile-generate="/mnt/cannonball_gcda"
LDFLAGS = -lgcov
else ifeq ($(PROFILE), APPLY)
CFLAGS += -fprofile-use="./"
LDFLAGS = -nodefaultlibs
else
LDFLAGS = -nodefaultlibs
endif
LDFLAGS += -lc -lgcc -lm $(SDL_LIBS) -Wl,--as-needed -Wl,--gc-sections -no-pie -flto -s
OUTPUT = cannonball.elf
SOURCES = main.c sdl/music.c xmlutils.c romloader.c roms.c trackloader.c utils.c video.c thirdparty/crc/crc.c thirdparty/sxmlc/sxmlc.c thirdparty/sxmlc/sxmlsearch.c
SOURCES += engine/oentry.c engine/oanimseq.c engine/oattractai.c engine/obonus.c engine/ocrash.c engine/oferrari.c engine/ohiscore.c engine/ohud.c engine/oinitengine.c engine/oinputs.c engine/olevelobjs.c engine/ologo.c engine/omap.c engine/omusic.c
SOURCES += engine/ooutputs.c engine/opalette.c engine/oroad.c engine/osmoke.c engine/osprite.c engine/osprites.c engine/ostats.c engine/otiles.c
SOURCES += engine/otraffic.c engine/outils.c engine/outrun.c engine/audio/osound.c engine/audio/osoundint.c frontend/config.c
SOURCES += frontend/menu.c frontend/ttrial.c
SOURCES += hwaudio/segapcm.c hwaudio/ym2151.c
SOURCES += hwvideo/hwroad.c hwvideo/hwsprites.c hwvideo/hwtiles.c cannonboard/interface.c cannonboard/asyncserial.c
SOURCES += sdl/audio.c sdl/input.c sdl/rendersw.c sdl/timer.c font/font_drawing.c
OBJS = ${SOURCES:.c=.o}
all: $(OUTPUT)
%.o: %.c
$(CC) ${CFLAGS} -c -o $@ $?
$(OUTPUT): ${OBJS}
$(CC) ${CFLAGS} -o $@ $+ ${LDFLAGS}
clean:
rm *.o src/*.o engine/audio/*.o engine/*.o hwvideo/*.o engine/*.o directx/*.o frontend/*.o hwaudio/*.o sdl/*.o sdl/*.o thirdparty/crc/*.o thirdparty/sxmlc/*.o cannonboard/*.o font/*.o
rm ${OUTPUT}