-
Notifications
You must be signed in to change notification settings - Fork 136
Expand file tree
/
Copy pathMakefile.common
More file actions
142 lines (130 loc) · 5.18 KB
/
Copy pathMakefile.common
File metadata and controls
142 lines (130 loc) · 5.18 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
LIBRETRO_COMM_DIR := $(CORE_DIR)/drivers/libretro/libretro-common
INCFLAGS := \
-I$(CORE_DIR)/drivers/libretro \
-I$(LIBRETRO_COMM_DIR)/include \
-I$(CORE_DIR) \
-I$(CORE_DIR)/input \
-I$(CORE_DIR)/boards
ifneq (,$(findstring msvc2003,$(platform)))
INCFLAGS += -I$(LIBRETRO_COMM_DIR)/include/compat/msvc
endif
COREDEFINES = \
-D__LIBRETRO__ \
-DPATH_MAX=1024 \
-DFCEU_VERSION_NUMERIC=9813
ifeq ($(WANT_32BPP),1)
COREDEFINES += -DFRONTEND_SUPPORTS_RGB888
else
COREDEFINES += -DFRONTEND_SUPPORTS_RGB565
endif
FCEU_SRC_DIRS := \
$(CORE_DIR)/boards \
$(CORE_DIR)/input
SOURCES_C := $(foreach dir,$(FCEU_SRC_DIRS),$(wildcard $(dir)/*.c))
ifeq ($(HAVE_NTSC),1)
COREDEFINES += \
-DHAVE_NTSC_FILTER \
-I$(CORE_DIR)/ntsc
SOURCES_C += $(CORE_DIR)/ntsc/nes_ntsc.c
endif
SOURCES_C += \
$(CORE_DIR)/drivers/libretro/libretro.c \
$(CORE_DIR)/drivers/libretro/libretro_dipswitch.c \
$(CORE_DIR)/cart.c \
$(CORE_DIR)/cheat.c \
$(CORE_DIR)/crc32.c \
$(CORE_DIR)/fceu-endian.c \
$(CORE_DIR)/fceu-memory.c \
$(CORE_DIR)/fceu.c \
$(CORE_DIR)/fds.c \
$(CORE_DIR)/fds_apu.c \
$(CORE_DIR)/file.c \
$(CORE_DIR)/filter.c \
$(CORE_DIR)/general.c \
$(CORE_DIR)/input.c \
$(CORE_DIR)/md5.c \
$(CORE_DIR)/nsf.c \
$(CORE_DIR)/palette.c \
$(CORE_DIR)/ppu.c \
$(CORE_DIR)/sound.c \
$(CORE_DIR)/state.c \
$(CORE_DIR)/video.c \
$(CORE_DIR)/vsuni.c \
$(CORE_DIR)/ines.c \
$(CORE_DIR)/unif.c \
$(CORE_DIR)/x6502.c
ifeq ($(HAVE_HDPACK), 1)
COREDEFINES += -DHAVE_HDPACK -DHAVE_ZLIB=1
SOURCES_C += \
$(CORE_DIR)/hdpack/hdpack_load.c \
$(CORE_DIR)/hdpack/hdpack_image.c \
$(CORE_DIR)/hdpack/hdpack_ppu.c \
$(CORE_DIR)/hdpack/hdpack_render.c \
$(CORE_DIR)/hdpack/hdpack_audio.c \
$(CORE_DIR)/hdpack/hdpack_patch.c \
$(LIBRETRO_COMM_DIR)/formats/png/rpng.c \
$(LIBRETRO_COMM_DIR)/formats/dds/rdds.c \
$(LIBRETRO_COMM_DIR)/formats/webp/rwebp.c \
$(LIBRETRO_COMM_DIR)/formats/vp8/rvp8.c \
$(LIBRETRO_COMM_DIR)/formats/vorbis/rvorbis.c \
$(LIBRETRO_COMM_DIR)/formats/wav/rwav.c \
$(LIBRETRO_COMM_DIR)/streams/trans_stream.c \
$(LIBRETRO_COMM_DIR)/streams/trans_stream_pipe.c \
$(LIBRETRO_COMM_DIR)/streams/trans_stream_zlib.c
# rpng's IDAT inflate needs zlib. Always build the bundled subset
# rather than trusting EXTERNAL_ZLIB: several console SDKs set that
# knob without shipping zlib.h on the default include path (psl1ght,
# wiiu). The gz*/compress translation units are simply not compiled;
# their zlib.h declarations are harmless. Z_SOLO is deliberately NOT
# used: it removes the default zcalloc/zcfree allocators and makes
# inflateInit/deflateInit reject the Z_NULL allocators that
# libretro-common's trans_stream_zlib passes.
# Z_PREFIX renames every public symbol to z_* so a statically linked
# core can never collide with the frontend's own zlib. The one
# exception is z_errmsg: it already starts with z_, so zlib 1.2.8's
# Z_PREFIX list omits it even though every zlib in the world exports
# that exact name -- rename it explicitly.
COREDEFINES += -DZ_PREFIX -Dz_errmsg=fceu_z_errmsg
# zlib compiles its LFS-conditional *64 combine functions even when
# neither Z_LARGE64 nor Z_WANT64 exposes their prototypes; upstream
# zlib does not build with -Wmissing-prototypes, so drop that flag for
# the vendored translation units only. Emitted via $(if ...) keyed on
# WARNING_DEFINES (deferred expansion: that variable is assigned after
# this file is included) so compilers that never get the warning flag
# -- MSVC's cl.exe rejects any -W word with D8021 -- never see the
# counter-flag either. (No tab indent: this is a pattern-specific
# variable, not a recipe line.)
$(CORE_DIR)/drivers/libretro/deps/zlib/%.o: CFLAGS += $(if $(findstring -Wmissing-prototypes,$(WARNING_DEFINES)),-Wno-missing-prototypes)
INCFLAGS += -I$(CORE_DIR)/drivers/libretro/deps/zlib
SOURCES_C += \
$(CORE_DIR)/drivers/libretro/deps/zlib/adler32.c \
$(CORE_DIR)/drivers/libretro/deps/zlib/crc32.c \
$(CORE_DIR)/drivers/libretro/deps/zlib/deflate.c \
$(CORE_DIR)/drivers/libretro/deps/zlib/inffast.c \
$(CORE_DIR)/drivers/libretro/deps/zlib/inflate.c \
$(CORE_DIR)/drivers/libretro/deps/zlib/inftrees.c \
$(CORE_DIR)/drivers/libretro/deps/zlib/trees.c \
$(CORE_DIR)/drivers/libretro/deps/zlib/zutil.c
endif
# memory_stream is consumed directly by the core's savestate code
# (state.c / FCEUSS_Save_Mem / FCEUSS_Load_Mem) and must be linked into
# the core itself even on statically-linked platforms, where the frontend
# does not export libretro-common symbols. Keep it outside the
# STATIC_LINKING guard below.
SOURCES_C += $(LIBRETRO_COMM_DIR)/streams/memory_stream.c
ifneq ($(STATIC_LINKING), 1)
SOURCES_C += \
$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.c \
$(LIBRETRO_COMM_DIR)/compat/compat_snprintf.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
$(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \
$(LIBRETRO_COMM_DIR)/file/file_path.c \
$(LIBRETRO_COMM_DIR)/file/file_path_io.c \
$(LIBRETRO_COMM_DIR)/streams/file_stream.c \
$(LIBRETRO_COMM_DIR)/streams/file_stream_transforms.c \
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
$(LIBRETRO_COMM_DIR)/time/rtime.c \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c
endif