-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.dc
81 lines (62 loc) · 3.02 KB
/
Makefile.dc
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
PRGNAME = gnash_dc.elf
CC = kos-cc
CXX = kos-c++ -frtti -fexceptions
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 -Wall -Wextra -fpermissive
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 += -I/usr/include/freetype2 -I/usr/include/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 -DOPENDINGUX -DDREAMCAST -DNOGIF
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=./
else ifeq ($(PROFILE), APPLY)
CFLAGS += -fprofile-use="./"
endif
CXXFLAGS = $(CFLAGS)
LDFLAGS = -Wl,--start-group -lc -lgcc -lm -lstdc++ -lfreetype -lavcodec -lavformat -lavutil -lswresample -lswscale -ljpeg -lpng -lz -lSDL -Wl,--end-group
ifeq ($(RENDERER_CONFIG), cairo)
LDFLAGS += -lcairo
else ifeq ($(RENDERER_CONFIG), opengl)
LDFLAGS += -lGL -lGLU
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