-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.funkey
95 lines (71 loc) · 3.55 KB
/
Makefile.funkey
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
PRGNAME = gnash.elf
TOOLCHAINDIR ?= /opt/funkey-toolchain
SYSROOT = $(TOOLCHAINDIR)/usr/arm-buildroot-linux-musleabihf/sysroot
BINDIR = $(TOOLCHAINDIR)/usr/bin
PKG_CONFIG := $(BINDIR)/pkg-config
CC = $(BINDIR)/arm-linux-gcc
CXX = $(BINDIR)/arm-linux-g++
PROFILE = 0
RENDERER_CONFIG = agg
HWACCEL_CONFIG = none
PIXEL_FORMAT = RGB565
SRCDIR = ./gui/sdl/$(RENDERER_CONFIG) ./libcore/asobj/flash/geom ./libmedia/ffmpeg ./libmedia ./libcore ./librender/$(RENDERER_CONFIG) ./librender ./gui ./gui/sdl ./libcore/abc ./libcore/asobj ./libcore/asobj/flash ./libcore/asobj/flash/filters ./libcore/asobj/flash/external ./libcore/asobj/flash/display ./libcore/asobj/flash/text ./libcore/asobj/flash/net ./libcore/swf ./libcore/vm ./libcore/parser ./libsound ./libsound/sdl ./libbase ./libdevice
ifeq ($(RENDERER_CONFIG), agg)
SRCDIR += ./agg/src/platform/sdl ./agg/src ./agg/src/ctrl
endif
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)
CFLAGS = -Os -fno-PIC -flto -fno-common
CFLAGS += -fdata-sections -ffunction-sections -freorder-functions -fno-math-errno -fgcse-las -fgcse-sm -fmerge-all-constants
CFLAGS += -DLSB_FIRST -DHAVE_CONFIG_H
CFLAGS += -I./ -Ilibmedia/ffmpeg -Ilibmedia -Ilibrender/$(RENDERER_CONFIG) -Ilibrender -Igui -Igui/sdl -Ilibcore/abc -Ilibcore/asobj -Ilibcore/asobj/flash
CFLAGS += -Ilibcore/asobj/flash/filters -Ilibcore/asobj/flash/external -Ilibcore/asobj/flash/display -Ilibcore/asobj/flash/text -Ilibcore/asobj/flash/net -Ilibcore/swf
CFLAGS += -Ilibcore/vm -Ilibcore/parser -Ilibsound -Ilibsound/sdl -Ilibbase -Ilibdevice -Ilibcore -Ilibcore/asobj/flash/geom -Igui/sdl/$(RENDERER_CONFIG)
CFLAGS += $(shell $(PKG_CONFIG) --cflags freetype2) $(shell $(PKG_CONFIG) --cflags sdl)
ifeq ($(RENDERER_CONFIG), cairo)
CFLAGS += -I/usr/include/cairo
else ifeq ($(RENDERER_CONFIG), agg)
CFLAGS += -I./agg/src/platform/sdl -I./agg/src -I./agg/src/ctrl -Iagg/include
endif
CFLAGS += -DGUI_SDL -DGUI_CONFIG=\"SDL\" -DRENDERER_CONFIG=\"$(RENDERER_CONFIG)\" -DHWACCEL_CONFIG=\"none\" -DCONFIG_CONFIG=\"none\" -DMEDIA_CONFIG=\"ffmpeg\" -DCXXFLAGS=\"ffmpeg\" -DPLUGINSDIR=\"./\" -DSYSCONFDIR=\"./\"
CFLAGS += -DSOUND_SDL -DUSE_MEDIA
ifeq ($(RENDERER_CONFIG), cairo)
CFLAGS += -DRENDERER_CAIRO
else ifeq ($(RENDERER_CONFIG), agg)
CFLAGS += -DRENDERER_AGG
else ifeq ($(RENDERER_CONFIG), opengl)
CFLAGS += -DRENDERER_OPENGL
endif
ifeq ($(PIXEL_FORMAT), RGB565)
CFLAGS += -DPIXELFORMAT_RGB565
else ifeq ($(PIXEL_FORMAT), RGB32)
CFLAGS += -DPIXELFORMAT_ARGB32
endif
ifeq ($(PROFILE), YES)
CFLAGS += -fprofile-generate=/mnt/gnash_profile
else ifeq ($(PROFILE), APPLY)
CFLAGS += -fprofile-use="./"
endif
CXXFLAGS = $(CFLAGS) -ftree-vectorize
LDFLAGS = -no-pie -lc -lgcc -lm -lstdc++ -latomic -lspeex -lSDL -lasound -lfreetype -lavcodec -lavformat -lavutil -lswresample -lswscale -lgif -ljpeg -lpng -lz -pthread -Wl,-z,norelro -Wl,--hash-style=gnu -Wl,--build-id=none -Wl,-O1,--sort-common,--as-needed,--gc-sections -flto -no-pie -s
ifeq ($(RENDERER_CONFIG), cairo)
LDFLAGS += -lcairo
else ifeq ($(RENDERER_CONFIG), opengl)
LDFLAGS += -lGL -lGLU
endif
ifeq ($(PROFILE), YES)
LDFLAGS += -lgcov
endif
# Rules to make executable
$(PRGNAME): $(OBJS)
$(CC) $(CFLAGS) -o $(PRGNAME) $^ $(LDFLAGS)
$(OBJ_C) : %.o : %.c
$(CC) $(CFLAGS) -std=gnu99 -c -o $@ $<
$(OBJ_CP) : %.o : %.cpp
$(CXX) $(CXXFLAGS) -std=gnu++14 -c -o $@ $<
clean:
rm -f $(PRGNAME) *.o