-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile.powkiddy
42 lines (31 loc) · 1.29 KB
/
Makefile.powkiddy
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
#CHAINPREFIX ?= /opt/buildroot-bittboy/output/host
#CROSS_COMPILE ?= $(CHAINPREFIX)/bin/arm-miyoo-linux-musleabi-
#SYSROOT ?= $(CHAINPREFIX)/arm-miyoo-linux-musleabi/sysroot
CHAINPREFIX ?= /opt/miyoo
CROSS_COMPILE ?= $(CHAINPREFIX)/bin/arm-buildroot-linux-musleabi-
SYSROOT ?= $(CHAINPREFIX)/arm-buildroot-linux-musleabi/sysroot
BUILDTIME=$(shell date +'\"%Y-%m-%d %H:%M\"')
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
STRIP = $(CROSS_COMPILE)strip
SDL_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
OUTPUTNAME = boot-logo
DEFINES = -DHAVE_STDINT_H -DVERSION_POWKIDDY
INCLUDES = -Iinclude $(SDL_CFLAGS)
#OPT_FLAGS = -Ofast -fdata-sections -fdata-sections -fno-common -fno-PIC -flto
EXTRA_LDFLAGS = -lasound -lmpg123 -Wl,--as-needed -Wl,--gc-sections -flto -s
CFLAGS = $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -std=gnu11
CXXFLAGS = $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -std=gnu++11
LDFLAGS = -Wl,--start-group -lSDL -lSDL_image -lpng -ljpeg -lSDL_mixer -lfreetype -lSDL_ttf -logg -lvorbisidec -lm -pthread -lz -lstdc++ $(EXTRA_LDFLAGS) -Wl,--end-group
# Redream (logo engine)
OBJS = \
logo.o
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
.cpp.o:
$(CXX) $(CXXFLAGS) -c -o $@ $<
all: executable
executable : $(OBJS)
$(CC) -o $(OUTPUTNAME) $(OBJS) $(CFLAGS) $(LDFLAGS)
clean:
rm $(OBJS) $(OUTPUTNAME)