Makefile.common 7.03 KB
Newer Older
Libretro-Admin's avatar
Libretro-Admin committed
1
2
3
SOURCES_CXX :=
SOURCES_C   :=

4
DEPS_DIR     	  := $(CORE_DIR)/deps
Libretro-Admin's avatar
Updates    
Libretro-Admin committed
5
6
LIBRETRO_COMM_DIR := $(CORE_DIR)/libretro-common
MEDNAFEN_DIR      := $(CORE_DIR)/mednafen
trinemark's avatar
trinemark committed
7
CORE_EMU_DIR      := $(MEDNAFEN_DIR)/pce
Libretro-Admin's avatar
Updates    
Libretro-Admin committed
8
CDROM_DIR         := $(MEDNAFEN_DIR)/cdrom
Libretro-Admin's avatar
Libretro-Admin committed
9

Libretro-Admin's avatar
Libretro-Admin committed
10
INCFLAGS := -I$(CORE_DIR) \
trinemark's avatar
trinemark committed
11
12
13
14
15
			-I$(MEDNAFEN_DIR) \
			-I$(MEDNAFEN_DIR)/include \
			-I$(MEDNAFEN_DIR)/hw_sound \
			-I$(MEDNAFEN_DIR)/hw_cpu \
			-I$(MEDNAFEN_DIR)/hw_misc \
Maxime Gauduin's avatar
Maxime Gauduin committed
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
			-I$(LIBRETRO_COMM_DIR)/include

LIBCHDR_INCFLAGS = \
	-I$(DEPS_DIR)/crypto \
	-I$(DEPS_DIR)/flac-1.3.2/include \
	-I$(DEPS_DIR)/flac-1.3.2/src/libFLAC/include \
	-I$(DEPS_DIR)/lzma-16.04/C \
	-I$(DEPS_DIR)/libchdr
LIBCHDR_SOURCES_C = \
	$(DEPS_DIR)/crypto/md5.c \
	$(DEPS_DIR)/crypto/sha1.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/bitmath.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/bitreader.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/cpu.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/crc.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/fixed.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/fixed_intrin_sse2.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/fixed_intrin_ssse3.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/float.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/format.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/lpc.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/lpc_intrin_avx2.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/lpc_intrin_sse2.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/lpc_intrin_sse41.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/lpc_intrin_sse.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/md5.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/memory.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/metadata_iterators.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/metadata_object.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/stream_decoder.c \
	$(DEPS_DIR)/flac-1.3.2/src/libFLAC/window.c \
	$(DEPS_DIR)/lzma-16.04/C/Alloc.c \
	$(DEPS_DIR)/lzma-16.04/C/Bra86.c \
	$(DEPS_DIR)/lzma-16.04/C/Bra.c \
	$(DEPS_DIR)/lzma-16.04/C/BraIA64.c \
	$(DEPS_DIR)/lzma-16.04/C/CpuArch.c \
	$(DEPS_DIR)/lzma-16.04/C/Delta.c \
	$(DEPS_DIR)/lzma-16.04/C/LzFind.c \
	$(DEPS_DIR)/lzma-16.04/C/Lzma86Dec.c \
	$(DEPS_DIR)/lzma-16.04/C/Lzma86Enc.c \
	$(DEPS_DIR)/lzma-16.04/C/LzmaDec.c \
	$(DEPS_DIR)/lzma-16.04/C/LzmaEnc.c \
	$(DEPS_DIR)/lzma-16.04/C/LzmaLib.c \
	$(DEPS_DIR)/lzma-16.04/C/Sort.c \
	$(DEPS_DIR)/libchdr/bitstream.c \
	$(DEPS_DIR)/libchdr/cdrom.c \
	$(DEPS_DIR)/libchdr/chd.c \
	$(DEPS_DIR)/libchdr/flac.c \
	$(DEPS_DIR)/libchdr/huffman.c

ZLIB_INCFLAGS = -I$(DEPS_DIR)/zlib
ZLIB_SOURCES_C = \
	$(DEPS_DIR)/zlib/adler32.c \
	$(DEPS_DIR)/zlib/compress.c \
	$(DEPS_DIR)/zlib/crc32.c \
	$(DEPS_DIR)/zlib/deflate.c \
	$(DEPS_DIR)/zlib/gzclose.c \
	$(DEPS_DIR)/zlib/gzlib.c \
	$(DEPS_DIR)/zlib/gzread.c \
	$(DEPS_DIR)/zlib/gzwrite.c \
	$(DEPS_DIR)/zlib/inffast.c \
	$(DEPS_DIR)/zlib/inflate.c \
	$(DEPS_DIR)/zlib/inftrees.c \
	$(DEPS_DIR)/zlib/trees.c \
	$(DEPS_DIR)/zlib/uncompr.c \
	$(DEPS_DIR)/zlib/zutil.c
Libretro-Admin's avatar
Libretro-Admin committed
82
83

ifneq (,$(findstring msvc2003,$(platform)))
Maxime Gauduin's avatar
Maxime Gauduin committed
84
	INCFLAGS += -I$(LIBRETRO_COMM_DIR)/include/compat/msvc
Libretro-Admin's avatar
Libretro-Admin committed
85
endif
Libretro-Admin's avatar
Libretro-Admin committed
86

Brad Parker's avatar
Brad Parker committed
87
ifeq ($(HAVE_CDROM), 1)
Maxime Gauduin's avatar
Maxime Gauduin committed
88
89
90
	SOURCES_C += \
					$(LIBRETRO_COMM_DIR)/cdrom/cdrom.c \
					$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation_cdrom.c
Brad Parker's avatar
Brad Parker committed
91
92
endif

Maxime Gauduin's avatar
Maxime Gauduin committed
93
94
ifneq ($(HAVE_GRIFFIN), 1)
    SOURCES_CXX += \
trinemark's avatar
trinemark committed
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
		$(CORE_DIR)/libretro.cpp \
		$(CORE_EMU_DIR)/huc6280.cpp \
		$(CORE_EMU_DIR)/huc.cpp \
		$(CORE_EMU_DIR)/input.cpp \
		$(CORE_EMU_DIR)/mcgenjin.cpp \
		$(CORE_EMU_DIR)/pce.cpp \
		$(CORE_EMU_DIR)/pcecd.cpp \
		$(CORE_EMU_DIR)/tsushin.cpp \
		$(CORE_EMU_DIR)/vce.cpp \
		$(CORE_EMU_DIR)/input/gamepad.cpp \
		$(CORE_EMU_DIR)/input/mouse.cpp \
		$(CORE_EMU_DIR)/input/tsushinkb.cpp \
		$(MEDNAFEN_DIR)/hw_misc/arcade_card/arcade_card.cpp \
		$(MEDNAFEN_DIR)/hw_sound/pce_psg/pce_psg.cpp \
		$(MEDNAFEN_DIR)/hw_video/huc6270/vdc.cpp
Libretro-Admin's avatar
Libretro-Admin committed
110
111
112
endif

ifeq ($(NEED_BLIP), 1)
Maxime Gauduin's avatar
Maxime Gauduin committed
113
	SOURCES_C += $(MEDNAFEN_DIR)/sound/Blip_Buffer.c
Libretro-Admin's avatar
Libretro-Admin committed
114
115
116
117
118
119
120
endif

ifeq ($(HAVE_HES), 1)
	SOURCES_CXX += $(CORE_EMU_DIR)/hes.cpp
endif

ifeq ($(NEED_DEINTERLACER), 1)
Maxime Gauduin's avatar
Maxime Gauduin committed
121
    FLAGS += -DNEED_DEINTERLACER
Libretro-Admin's avatar
Libretro-Admin committed
122
123
124
endif

ifeq ($(NEED_BPP), 8)
Maxime Gauduin's avatar
Maxime Gauduin committed
125
	FLAGS += -DWANT_8BPP
Libretro-Admin's avatar
Libretro-Admin committed
126
127
128
endif

ifeq ($(NEED_BPP), 16)
Maxime Gauduin's avatar
Maxime Gauduin committed
129
	FLAGS += -DWANT_16BPP
Libretro-Admin's avatar
Libretro-Admin committed
130
131
132
endif

ifeq ($(NEED_BPP), 32)
Maxime Gauduin's avatar
Maxime Gauduin committed
133
	FLAGS += -DWANT_32BPP
Libretro-Admin's avatar
Libretro-Admin committed
134
135
136
endif

ifeq ($(WANT_NEW_API), 1)
Maxime Gauduin's avatar
Maxime Gauduin committed
137
	FLAGS += -DWANT_NEW_API
Libretro-Admin's avatar
Libretro-Admin committed
138
139
140
endif

ifeq ($(NO_COMPUTED_GOTO), 1)
Maxime Gauduin's avatar
Maxime Gauduin committed
141
	FLAGS += -DNO_COMPUTED_GOTO
Libretro-Admin's avatar
Libretro-Admin committed
142
143
144
endif

ifeq ($(NEED_STEREO_SOUND), 1)
Maxime Gauduin's avatar
Maxime Gauduin committed
145
	FLAGS += -DWANT_STEREO_SOUND
Libretro-Admin's avatar
Libretro-Admin committed
146
147
148
endif

ifeq ($(FRONTEND_SUPPORTS_RGB565), 1)
Maxime Gauduin's avatar
Maxime Gauduin committed
149
	FLAGS += -DFRONTEND_SUPPORTS_RGB565
Libretro-Admin's avatar
Libretro-Admin committed
150
151
152
endif

ifeq ($(CACHE_CD), 1)
Maxime Gauduin's avatar
Maxime Gauduin committed
153
	FLAGS += -D__LIBRETRO_CACHE_CD__
Libretro-Admin's avatar
Libretro-Admin committed
154
155
156
endif

ifneq ($(HAVE_GRIFFIN),1)
Maxime Gauduin's avatar
Maxime Gauduin committed
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
	SOURCES_CXX += \
		$(CDROM_DIR)/CDAccess.cpp \
		$(CDROM_DIR)/CDAccess_Image.cpp \
		$(CDROM_DIR)/CDAccess_CCD.cpp \
		$(CDROM_DIR)/CDAFReader.cpp \
		$(CDROM_DIR)/CDAFReader_Vorbis.cpp \
		$(CDROM_DIR)/cdromif.cpp \
		$(CDROM_DIR)/CDUtility.cpp \
		$(CDROM_DIR)/lec.cpp \
		$(CDROM_DIR)/galois.cpp \
		$(CDROM_DIR)/recover-raw.cpp \
		$(CDROM_DIR)/l-ec.cpp \
		$(CDROM_DIR)/edc_crc32.cpp \
		$(CDROM_DIR)/scsicd.cpp
endif
FLAGS += -DNEED_CD
Libretro-Admin's avatar
Libretro-Admin committed
173

174
ifeq ($(HAVE_CHD), 1)
Maxime Gauduin's avatar
Maxime Gauduin committed
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
    FLAGS += -DHAVE_CHD -D_7ZIP_ST -DPACKAGE_VERSION=\"1.3.2\" -DFLAC_API_EXPORTS -DFLAC__HAS_OGG=0 -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_SYS_PARAM_H
    ifeq ($(platform), win)
        FLAGS += -DHAVE_FSEEKO
    endif

	ifeq ($(SYSTEM_LIBCHDR), 1)
		INCFLAGS += $(shell pkg-config --cflags libchdr)
		LIBS += $(shell pkg-config --libs libchdr)
	else
		INCFLAGS += $(LIBCHDR_INCFLAGS)
		SOURCES_C += $(LIBCHDR_SOURCES_C)
		ifeq ($(platform), win)
			SOURCES_C += $(DEPS_DIR)/flac-1.3.2/src/libFLAC/windows_unicode_filenames.c
		endif
	endif

	ifneq ($(STATIC_LINKING), 1)
		ifeq ($(SYSTEM_ZLIB), 1)
			INCFLAGS += $(shell pkg-config --cflags zlib)
			LIBS += $(shell pkg-config --libs zlib)
		else
			INCFLAGS += $(ZLIB_INCFLAGS)
			SOURCES_C += $(ZLIB_SOURCES_C)
		endif
	endif

    SOURCES_CXX += $(CDROM_DIR)/CDAccess_CHD.cpp
202
203
endif

Libretro-Admin's avatar
Libretro-Admin committed
204
ifeq ($(NEED_TREMOR), 1)
Maxime Gauduin's avatar
Maxime Gauduin committed
205
206
    SOURCES_C += $(sort $(filter-out %ivorbisfile_example.c, $(wildcard $(MEDNAFEN_DIR)/tremor/*.c)))
    FLAGS += -DNEED_TREMOR
Libretro-Admin's avatar
Libretro-Admin committed
207
208
209
endif

ifneq ($(HAVE_GRIFFIN), 1)
Maxime Gauduin's avatar
Maxime Gauduin committed
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
	SOURCES_CXX += \
		$(MEDNAFEN_DIR)/settings.cpp \
		$(MEDNAFEN_DIR)/general.cpp \
		$(MEDNAFEN_DIR)/FileStream.cpp \
		$(MEDNAFEN_DIR)/MemoryStream.cpp \
		$(MEDNAFEN_DIR)/Stream.cpp \
		$(MEDNAFEN_DIR)/state.cpp \
		$(MEDNAFEN_DIR)/mempatcher.cpp \
		$(MEDNAFEN_DIR)/sound/okiadpcm.cpp \
		$(MEDNAFEN_DIR)/sound/OwlResampler.cpp

	SOURCES_C += \
		$(MEDNAFEN_DIR)/file.c \
		$(MEDNAFEN_DIR)/mednafen-endian.c \
		$(MEDNAFEN_DIR)/cputest/cputest.c
Libretro-Admin's avatar
Libretro-Admin committed
225
226
endif

227
ifneq ($(STATIC_LINKING), 1)
Maxime Gauduin's avatar
Maxime Gauduin committed
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
	SOURCES_C += \
		$(LIBRETRO_COMM_DIR)/streams/file_stream.c \
		$(LIBRETRO_COMM_DIR)/streams/file_stream_transforms.c \
		$(LIBRETRO_COMM_DIR)/file/file_path.c \
		$(LIBRETRO_COMM_DIR)/file/retro_dirent.c \
		$(LIBRETRO_COMM_DIR)/lists/string_list.c \
		$(LIBRETRO_COMM_DIR)/lists/dir_list.c \
		$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
		$(LIBRETRO_COMM_DIR)/compat/compat_snprintf.c \
		$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.c \
		$(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.c \
		$(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \
		$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \
		$(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.c \
		$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c \
		$(LIBRETRO_COMM_DIR)/memmap/memalign.c \
		$(LIBRETRO_COMM_DIR)/string/stdstring.c
245
endif