Makefile.common 10.1 KB
Newer Older
RobLoach's avatar
RobLoach committed
1
# ChaiLove
Steel01's avatar
Steel01 committed
2
3
4
5
SOURCES_CXX := $(wildcard \
	$(CORE_DIR)/src/*.cpp \
	$(CORE_DIR)/src/love/*.cpp \
	$(CORE_DIR)/src/love/Types/Audio/*.cpp \
6
	$(CORE_DIR)/src/love/Types/Config/*.cpp \
Steel01's avatar
Steel01 committed
7
8
9
	$(CORE_DIR)/src/love/Types/FileSystem/*.cpp \
	$(CORE_DIR)/src/love/Types/Graphics/*.cpp \
	$(CORE_DIR)/src/love/Types/Input/*.cpp \
RobLoach's avatar
RobLoach committed
10
)
Vladimir Serbinenko's avatar
Vladimir Serbinenko committed
11
12
SOURCES_C =
SOURCES_S =
RobLoach's avatar
RobLoach committed
13
FLAGS += -Wfatal-errors
RobLoach's avatar
RobLoach committed
14

RobLoach's avatar
RobLoach committed
15
# random
Steel01's avatar
Steel01 committed
16
FLAGS += -I$(CORE_DIR)/vendor/random/include
RobLoach's avatar
RobLoach committed
17

RobLoach's avatar
RobLoach committed
18
# libretro-common
Steel01's avatar
Steel01 committed
19
FLAGS += -I$(CORE_DIR)/vendor/libretro-common/include
20
# Only compile libretro-common when not STATIC_LINKING
21
ifneq ($(STATIC_LINKING), 1)
22
23
24
25
26
	SOURCES_C += $(wildcard \
		$(CORE_DIR)/vendor/libretro-common/audio/audio_mix.c \
		$(CORE_DIR)/vendor/libretro-common/audio/audio_mixer.c \
		$(CORE_DIR)/vendor/libretro-common/audio/conversion/*.c \
		$(CORE_DIR)/vendor/libretro-common/audio/resampler/audio_resampler.c \
27
28
		$(CORE_DIR)/vendor/libretro-common/audio/resampler/drivers/nearest_resampler.c \
		$(CORE_DIR)/vendor/libretro-common/audio/resampler/drivers/null_resampler.c \
29
30
31
32
33
34
35
36
37
38
39
40
41
42
		$(CORE_DIR)/vendor/libretro-common/audio/resampler/drivers/sinc_resampler.c \
		$(CORE_DIR)/vendor/libretro-common/compat/compat_posix_string.c \
		$(CORE_DIR)/vendor/libretro-common/compat/compat_strcasestr.c \
		$(CORE_DIR)/vendor/libretro-common/compat/compat_strl.c \
		$(CORE_DIR)/vendor/libretro-common/compat/fopen_utf8.c \
		$(CORE_DIR)/vendor/libretro-common/encodings/encoding_utf.c \
		$(CORE_DIR)/vendor/libretro-common/features/features_cpu.c \
		$(CORE_DIR)/vendor/libretro-common/file/config_file.c \
		$(CORE_DIR)/vendor/libretro-common/file/config_file_userdata.c \
		$(CORE_DIR)/vendor/libretro-common/file/file_path.c \
		$(CORE_DIR)/vendor/libretro-common/formats/wav/rwav.c \
		$(CORE_DIR)/vendor/libretro-common/lists/string_list.c \
		$(CORE_DIR)/vendor/libretro-common/memmap/memalign.c \
		$(CORE_DIR)/vendor/libretro-common/streams/file_stream.c \
RobLoach's avatar
RobLoach committed
43
		$(CORE_DIR)/vendor/libretro-common/string/stdstring.c \
RobLoach's avatar
RobLoach committed
44
		$(CORE_DIR)/vendor/libretro-common/vfs/vfs_implementation.c \
45
	)
46
    # Ensure the sinc_resampler_neon is available for ARM NEON devices.
Vladimir Serbinenko's avatar
Vladimir Serbinenko committed
47
	SOURCES_S += $(CORE_DIR)/vendor/libretro-common/audio/resampler/drivers/sinc_resampler_neon.S
RobLoach's avatar
RobLoach committed
48

Libretro-Admin's avatar
Libretro-Admin committed
49
50
51
    # MD5
    FLAGS += -I$(CORE_DIR)/vendor/libretro-common/include
    SOURCES_C += $(CORE_DIR)/vendor/libretro-common/utils/md5.c
RobLoach's avatar
RobLoach committed
52
endif
53

Vladimir Serbinenko's avatar
Vladimir Serbinenko committed
54
55
56
57
58
ifeq ($(platform), ctr)
     SOURCES_C += $(CORE_DIR)/vendor/libretro-common/audio/audio_mix.c \
       $(CORE_DIR)/vendor/libretro-common/audio/audio_mixer.c
endif

RobLoach's avatar
RobLoach committed
59
# stb_vorbis
RobLoach's avatar
RobLoach committed
60
#SOURCES_C += $(CORE_DIR)/vendor/stb/stb_vorbis.c
RobLoach's avatar
RobLoach committed
61
FLAGS += -DHAVE_STB_VORBIS
RobLoach's avatar
Update    
RobLoach committed
62
FLAGS += -I$(CORE_DIR)/vendor/libretro-deps
RobLoach's avatar
RobLoach committed
63

64
65
# zlib
SOURCES_C += \
RobLoach's avatar
RobLoach committed
66
67
	$(CORE_DIR)/vendor/libretro-deps/libz/adler32.c \
	$(CORE_DIR)/vendor/libretro-deps/libz/compress.c \
68
	$(CORE_DIR)/vendor/libretro-deps/libz/crc32.c \
RobLoach's avatar
RobLoach committed
69
70
71
72
73
74
75
76
	$(CORE_DIR)/vendor/libretro-deps/libz/deflate.c \
	$(CORE_DIR)/vendor/libretro-deps/libz/gzclose.c \
	$(CORE_DIR)/vendor/libretro-deps/libz/gzlib.c \
	$(CORE_DIR)/vendor/libretro-deps/libz/gzread.c \
	$(CORE_DIR)/vendor/libretro-deps/libz/gzwrite.c \
	$(CORE_DIR)/vendor/libretro-deps/libz/infback.c \
	$(CORE_DIR)/vendor/libretro-deps/libz/inffast.c \
	$(CORE_DIR)/vendor/libretro-deps/libz/inflate.c \
77
78
79
	$(CORE_DIR)/vendor/libretro-deps/libz/inftrees.c \
	$(CORE_DIR)/vendor/libretro-deps/libz/trees.c \
	$(CORE_DIR)/vendor/libretro-deps/libz/zutil.c
RobLoach's avatar
RobLoach committed
80
81
FLAGS += -I$(CORE_DIR)/vendor/libretro-deps/libz
FLAGS += -I$(CORE_DIR)/vendor/libretro-common/compat
82
83
FLAGS += -DWANT_ZLIB

RobLoach's avatar
RobLoach committed
84
# PhysFS
RobLoach's avatar
RobLoach committed
85
86
FLAGS += -I$(CORE_DIR)/vendor/physfs/src
FLAGS += -I$(CORE_DIR)/vendor/physfs/extras
RobLoach's avatar
RobLoach committed
87
FLAGS += -DPHYSFS_NO_CDROM_SUPPORT=1
RobLoach's avatar
RobLoach committed
88
SOURCES_C += $(wildcard \
RobLoach's avatar
RobLoach committed
89
90
	$(CORE_DIR)/vendor/physfs/extras/physfsrwops.c \
	$(CORE_DIR)/vendor/physfs/src/*.c \
RobLoach's avatar
RobLoach committed
91
)
RobLoach's avatar
RobLoach committed
92
ifeq ($(platform), osx)
RobLoach's avatar
RobLoach committed
93
#	LDFLAGS += -mmacosx-version-min=10.2
RobLoach's avatar
RobLoach committed
94
	LDFLAGS += -framework IOKit -framework Foundation
RobLoach's avatar
RobLoach committed
95
#	FLAGS += -DMAC_OS_X_VERSION_MIN_REQUIRED=1020
RobLoach's avatar
RobLoach committed
96
	FLAGS += -D__MACH__ -D__APPLE__ -DPHYSFS_PLATFORM_APPLE
RobLoach's avatar
RobLoach committed
97
	SOURCES_M += $(CORE_DIR)/vendor/physfs/src/physfs_platform_apple.m
RobLoach's avatar
RobLoach committed
98
endif
RobLoach's avatar
RobLoach committed
99
100

# SDL_tty
Steel01's avatar
Steel01 committed
101
FLAGS += -I$(CORE_DIR)/vendor/SDL_tty/include
RobLoach's avatar
RobLoach committed
102
SOURCES_C += $(wildcard \
Steel01's avatar
Steel01 committed
103
	$(CORE_DIR)/vendor/SDL_tty/src/SDL_fnt.c \
104
	$(CORE_DIR)/vendor/SDL_tty/src/SDL_tty.c \
RobLoach's avatar
RobLoach committed
105
106
107
)

# SDL_gfx
Steel01's avatar
Steel01 committed
108
FLAGS += -I$(CORE_DIR)/vendor/sdl-libretro/tests/SDL_gfx-2.0.26
RobLoach's avatar
RobLoach committed
109
SOURCES_C += $(wildcard \
Steel01's avatar
Steel01 committed
110
	$(CORE_DIR)/vendor/sdl-libretro/tests/SDL_gfx-2.0.26/*.c \
RobLoach's avatar
RobLoach committed
111
112
)

RobLoach's avatar
RobLoach committed
113
# FreeType2
RobLoach's avatar
RobLoach committed
114
# See https://github.com/emscripten-ports/FreeType/blob/master/builds/amiga/makefile
RobLoach's avatar
RobLoach committed
115
FLAGS += -I$(CORE_DIR)/vendor/libretro-deps/freetype/include
RobLoach's avatar
RobLoach committed
116
117
118
119
120
121
122
123
124
125
126
127
128
FLAGS += -DFT2_BUILD_LIBRARY \
	-DFT_USE_AUTOFIT \
	-DFT_USE_RASTER \
	-DFT_USE_SMOOTH \
	-DFT_USE_TT \
	-DFT_USE_T1 \
	-DFT_USE_T42 \
	-DFT_USE_T1CID \
	-DFT_USE_CFF \
	-DFT_USE_OTV \
	-DFT_USE_GXV

SOURCES_C += \
129
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/autofit/autofit.c \
RobLoach's avatar
RobLoach committed
130
131
132
133
134
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftbase.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftbbox.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftbdf.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftbitmap.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftcid.c \
135
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftdebug.c \
RobLoach's avatar
RobLoach committed
136
137
138
139
140
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftfntfmt.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftfstype.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftgasp.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftglyph.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftgxval.c \
141
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftinit.c \
RobLoach's avatar
RobLoach committed
142
143
144
145
146
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftlcdfil.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftmm.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftotval.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftpatent.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftpfr.c \
147
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftstroke.c \
RobLoach's avatar
RobLoach committed
148
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftsynth.c \
149
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftsystem.c \
RobLoach's avatar
RobLoach committed
150
151
152
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/fttype1.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftwinfnt.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/bdf/bdf.c \
153
154
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/bzip2/ftbzip2.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/cache/ftcache.c \
RobLoach's avatar
RobLoach committed
155
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/cff/cff.c \
156
157
158
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/cid/type1cid.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/gzip/ftgzip.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/lzw/ftlzw.c \
RobLoach's avatar
RobLoach committed
159
160
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/pcf/pcf.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/pfr/pfr.c \
161
162
163
164
165
166
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/psaux/psaux.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/pshinter/pshinter.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/psnames/psnames.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/raster/raster.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/sfnt/sfnt.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/smooth/smooth.c \
RobLoach's avatar
RobLoach committed
167
168
169
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/truetype/truetype.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/type1/type1.c \
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/type42/type42.c \
170
	$(CORE_DIR)/vendor/libretro-deps/freetype/src/winfonts/winfnt.c
RobLoach's avatar
RobLoach committed
171

RobLoach's avatar
RobLoach committed
172
# SDL_ttf
Steel01's avatar
Steel01 committed
173
174
FLAGS += -I$(CORE_DIR)/vendor/sdl-libretro/tests/SDL_ttf-2.0.11/VisualC/external/include
SOURCES_C += $(CORE_DIR)/vendor/sdl-libretro/tests/SDL_ttf-2.0.11/SDL_ttf.c
RobLoach's avatar
RobLoach committed
175
176

# SDL_stbimage
Steel01's avatar
Steel01 committed
177
FLAGS += -I$(CORE_DIR)/vendor/Snippets
RobLoach's avatar
RobLoach committed
178
179

# STB
Steel01's avatar
Steel01 committed
180
FLAGS += -I$(CORE_DIR)/vendor/stb
RobLoach's avatar
RobLoach committed
181

RobLoach's avatar
RobLoach committed
182
183
184
# TinySHA1
FLAGS += -I$(CORE_DIR)/vendor/TinySHA1

RobLoach's avatar
RobLoach committed
185
186
187
# cppcodec
FLAGS += -I$(CORE_DIR)/vendor/cppcodec

RobLoach's avatar
RobLoach committed
188
189
# ChaiScript
ifeq ($(HAVE_CHAISCRIPT),)
Steel01's avatar
Steel01 committed
190
191
	FLAGS += -I$(CORE_DIR)/vendor/chaiscript/include
	FLAGS += -I$(CORE_DIR)/vendor/ChaiScript_Extras/include
RobLoach's avatar
RobLoach committed
192
193
	FLAGS += -D__HAVE_CHAISCRIPT__
	FLAGS += -DCHAISCRIPT_NO_THREADS -DCHAISCRIPT_NO_THREADS_WARNING -DCHAISCRIPT_NO_DYNLOAD
RobLoach's avatar
RobLoach committed
194
	FLAGS += -DCHAISCRIPT_EXTRAS_MATH_SKIP_ADVANCED
RobLoach's avatar
RobLoach committed
195
196
endif

RobLoach's avatar
RobLoach committed
197
198
# SDL
ifeq ($(platform), win)
RobLoach's avatar
RobLoach committed
199
	SOURCES_C += $(wildcard ./vendor/sdl-libretro/src/*.c  ./vendor/sdl-libretro/src/audio/*.c  ./vendor/sdl-libretro/src/cdrom/dummy/*.c  ./vendor/sdl-libretro/src/cdrom/*.c  ./vendor/sdl-libretro/src/cpuinfo/*.c  ./vendor/sdl-libretro/src/events/*.c  ./vendor/sdl-libretro/src/file/*.c  ./vendor/sdl-libretro/src/stdlib/*.c  ./vendor/sdl-libretro/src/thread/*.c  ./vendor/sdl-libretro/src/timer/*.c  ./vendor/sdl-libretro/src/video/*.c  ./vendor/sdl-libretro/src/joystick/*.c  ./vendor/sdl-libretro/src/video/libretro/*.c  ./vendor/sdl-libretro/src/joystick/libretro/*.c  ./vendor/sdl-libretro/src/timer/libretro/*.c  ./vendor/sdl-libretro/src/audio/libretro/*.c  ./vendor/sdl-libretro/src/thread/win32/SDL_sysmutex.c ./vendor/sdl-libretro/src/thread/win32/SDL_syssem.c ./vendor/sdl-libretro/src/thread/win32/SDL_systhread.c ./vendor/sdl-libretro/src/thread/generic/SDL_syscond.c ./vendor/sdl-libretro/src/loadso/dummy/*.c)
RobLoach's avatar
RobLoach committed
200
else
Steel01's avatar
Steel01 committed
201
	SOURCES_C += $(wildcard $(CORE_DIR)/vendor/sdl-libretro/src/*.c $(CORE_DIR)/vendor/sdl-libretro/src/audio/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/cdrom/dummy/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/cdrom/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/cpuinfo/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/events/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/file/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/stdlib/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/thread/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/timer/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/video/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/joystick/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/video/libretro/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/thread/generic/*.c $(CORE_DIR)/vendor/sdl-libretro/src/joystick/libretro/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/timer/libretro/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/audio/libretro/*.c  $(CORE_DIR)/vendor/sdl-libretro/src/loadso/dummy/*.c)
RobLoach's avatar
RobLoach committed
202
endif
RobLoach's avatar
RobLoach committed
203
FLAGS += -DSDL_THREADS_DISABLED -DSDL_CDROM_DISABLED
Steel01's avatar
Steel01 committed
204
FLAGS += -I$(CORE_DIR)/vendor/sdl-libretro/include
RobLoach's avatar
RobLoach committed
205

206
OBJECTS += $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o) $(SOURCES_S:.S=.o) $(SOURCES_M:.m=.o)
RobLoach's avatar
RobLoach committed
207

RobLoach's avatar
RobLoach committed
208
LDFLAGS +=  $(fpic) $(SHARED) $(EXTRA_LDF)
RobLoach's avatar
RobLoach committed
209
210

WARNINGS :=
211
212
213
214
215

# Windows: Fix retro_common_api.h
ifeq ($(system_platform), win)
	FLAGS += -DPRId64=I64d -DPRIu64=I64u -DPRIuPTR=Iu
endif