Makefile.common 7.15 KB
Newer Older
RobLoach's avatar
RobLoach committed
1
# ChaiLove
Steel01's avatar
Steel01 committed
2
3
4
5
6
7
8
9
10
SOURCES_CXX := $(wildcard \
	$(CORE_DIR)/src/*.cpp \
	$(CORE_DIR)/src/love/*.cpp \
	$(CORE_DIR)/src/love/Types/Audio/*.cpp \
	$(CORE_DIR)/src/love/Types/FileSystem/*.cpp \
	$(CORE_DIR)/src/love/Types/Graphics/*.cpp \
	$(CORE_DIR)/src/love/Types/Input/*.cpp \
	$(CORE_DIR)/src/love/Types/Config/*.cpp \
	$(CORE_DIR)/test/native/*.cpp \
RobLoach's avatar
RobLoach committed
11
12
)

RobLoach's avatar
RobLoach committed
13
# semver
Steel01's avatar
Steel01 committed
14
15
FLAGS := -I$(CORE_DIR)/vendor/semver
SOURCES_C := $(CORE_DIR)/vendor/semver/semver.c
RobLoach's avatar
RobLoach committed
16

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

RobLoach's avatar
RobLoach committed
20
# filesystem
Steel01's avatar
Steel01 committed
21
FLAGS += -I$(CORE_DIR)/vendor/filesystem
RobLoach's avatar
RobLoach committed
22
23

# libretro-common
Steel01's avatar
Steel01 committed
24
FLAGS += -I$(CORE_DIR)/vendor/libretro-common/include
RobLoach's avatar
RobLoach committed
25

26
27
# zlib
SOURCES_C += \
Steel01's avatar
Steel01 committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
	$(CORE_DIR)/vendor/zlib/zutil.c \
	$(CORE_DIR)/vendor/zlib/adler32.c \
	$(CORE_DIR)/vendor/zlib/crc32.c \
	$(CORE_DIR)/vendor/zlib/compress.c \
	$(CORE_DIR)/vendor/zlib/deflate.c \
	$(CORE_DIR)/vendor/zlib/gzclose.c \
	$(CORE_DIR)/vendor/zlib/gzlib.c \
	$(CORE_DIR)/vendor/zlib/gzread.c \
	$(CORE_DIR)/vendor/zlib/gzwrite.c \
	$(CORE_DIR)/vendor/zlib/infback.c \
	$(CORE_DIR)/vendor/zlib/inffast.c \
	$(CORE_DIR)/vendor/zlib/inftrees.c \
	$(CORE_DIR)/vendor/zlib/inflate.c \
	$(CORE_DIR)/vendor/zlib/trees.c
FLAGS += -I$(CORE_DIR)/vendor/zlib
43
44
FLAGS += -DWANT_ZLIB

RobLoach's avatar
RobLoach committed
45
# PhysFS
Steel01's avatar
Steel01 committed
46
47
FLAGS += -I$(CORE_DIR)/vendor/physfs/src
FLAGS += -I$(CORE_DIR)/vendor/physfs/extras
RobLoach's avatar
RobLoach committed
48
FLAGS += -DPHYSFS_NO_CDROM_SUPPORT=1
RobLoach's avatar
RobLoach committed
49
SOURCES_C += $(wildcard \
Steel01's avatar
Steel01 committed
50
51
	$(CORE_DIR)/vendor/physfs/extras/physfsrwops.c \
	$(CORE_DIR)/vendor/physfs/src/*.c \
RobLoach's avatar
RobLoach committed
52
)
RobLoach's avatar
RobLoach committed
53
ifeq ($(platform), osx)
RobLoach's avatar
RobLoach committed
54
#	LDFLAGS += -mmacosx-version-min=10.2
RobLoach's avatar
RobLoach committed
55
	LDFLAGS += -framework Carbon -framework IOKit
RobLoach's avatar
RobLoach committed
56
#	FLAGS += -DMAC_OS_X_VERSION_MIN_REQUIRED=1020
RobLoach's avatar
RobLoach committed
57
	FLAGS += -D__MACH__ -D__APPLE__
RobLoach's avatar
RobLoach committed
58
endif
RobLoach's avatar
RobLoach committed
59
60

# SDL_tty
Steel01's avatar
Steel01 committed
61
FLAGS += -I$(CORE_DIR)/vendor/SDL_tty/include
RobLoach's avatar
RobLoach committed
62
SOURCES_C += $(wildcard \
Steel01's avatar
Steel01 committed
63
64
	$(CORE_DIR)/vendor/SDL_tty/src/SDL_tty.c \
	$(CORE_DIR)/vendor/SDL_tty/src/SDL_fnt.c \
RobLoach's avatar
RobLoach committed
65
66
67
)

# SDL_gfx
Steel01's avatar
Steel01 committed
68
FLAGS += -I$(CORE_DIR)/vendor/sdl-libretro/tests/SDL_gfx-2.0.26
RobLoach's avatar
RobLoach committed
69
SOURCES_C += $(wildcard \
Steel01's avatar
Steel01 committed
70
	$(CORE_DIR)/vendor/sdl-libretro/tests/SDL_gfx-2.0.26/*.c \
RobLoach's avatar
RobLoach committed
71
72
)

RobLoach's avatar
RobLoach committed
73
# FreeType2
RobLoach's avatar
RobLoach committed
74
# See https://github.com/emscripten-ports/FreeType/blob/master/builds/amiga/makefile
Steel01's avatar
Steel01 committed
75
FLAGS += -I$(CORE_DIR)/vendor/freetype2/include
RobLoach's avatar
RobLoach committed
76
77
78
79
80
81
82
83
84
85
86
87
88
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 += \
Steel01's avatar
Steel01 committed
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
	$(CORE_DIR)/vendor/freetype2/src/base/ftbase.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftinit.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftsystem.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftdebug.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftbbox.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftbdf.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftstroke.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftbitmap.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftcid.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftfntfmt.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftfstype.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftgasp.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftglyph.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftgxval.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftlcdfil.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftmm.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftotval.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftpatent.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftpfr.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftsynth.c \
	$(CORE_DIR)/vendor/freetype2/src/base/fttype1.c \
	$(CORE_DIR)/vendor/freetype2/src/base/ftwinfnt.c \
	$(CORE_DIR)/vendor/freetype2/src/autofit/autofit.c \
	$(CORE_DIR)/vendor/freetype2/src/pshinter/pshinter.c \
	$(CORE_DIR)/vendor/freetype2/src/psaux/psaux.c \
	$(CORE_DIR)/vendor/freetype2/src/psnames/psnames.c \
	$(CORE_DIR)/vendor/freetype2/src/raster/raster.c \
	$(CORE_DIR)/vendor/freetype2/src/smooth/smooth.c \
	$(CORE_DIR)/vendor/freetype2/src/cache/ftcache.c \
	$(CORE_DIR)/vendor/freetype2/src/bdf/bdf.c \
	$(CORE_DIR)/vendor/freetype2/src/cff/cff.c \
	$(CORE_DIR)/vendor/freetype2/src/pcf/pcf.c \
	$(CORE_DIR)/vendor/freetype2/src/winfonts/winfnt.c \
	$(CORE_DIR)/vendor/freetype2/src/sfnt/sfnt.c \
	$(CORE_DIR)/vendor/freetype2/src/pfr/pfr.c \
	$(CORE_DIR)/vendor/freetype2/src/truetype/truetype.c \
	$(CORE_DIR)/vendor/freetype2/src/type1/type1.c \
	$(CORE_DIR)/vendor/freetype2/src/type42/type42.c \
	$(CORE_DIR)/vendor/freetype2/src/cid/type1cid.c \
	$(CORE_DIR)/vendor/freetype2/src/gzip/ftgzip.c \
	$(CORE_DIR)/vendor/freetype2/src/bzip2/ftbzip2.c \
	$(CORE_DIR)/vendor/freetype2/src/lzw/ftlzw.c
RobLoach's avatar
RobLoach committed
131

RobLoach's avatar
RobLoach committed
132
# SDL_ttf
Steel01's avatar
Steel01 committed
133
134
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
135
136

# SDL_stbimage
Steel01's avatar
Steel01 committed
137
FLAGS += -I$(CORE_DIR)/vendor/Snippets
RobLoach's avatar
RobLoach committed
138
139

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

RobLoach's avatar
RobLoach committed
142
143
144
# MD5
FLAGS += -I$(CORE_DIR)/vendor/libretro-common/include
SOURCES_C += $(CORE_DIR)/vendor/libretro-common/utils/md5.c
145

RobLoach's avatar
RobLoach committed
146
147
# ChaiScript
ifeq ($(HAVE_CHAISCRIPT),)
Steel01's avatar
Steel01 committed
148
149
	FLAGS += -I$(CORE_DIR)/vendor/chaiscript/include
	FLAGS += -I$(CORE_DIR)/vendor/ChaiScript_Extras/include
RobLoach's avatar
RobLoach committed
150
151
152
153
	FLAGS += -D__HAVE_CHAISCRIPT__
	FLAGS += -DCHAISCRIPT_NO_THREADS -DCHAISCRIPT_NO_THREADS_WARNING -DCHAISCRIPT_NO_DYNLOAD
endif

RobLoach's avatar
RobLoach committed
154
155
# SDL
ifeq ($(platform), win)
RobLoach's avatar
RobLoach committed
156
	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
157
else
Steel01's avatar
Steel01 committed
158
	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
159
endif
RobLoach's avatar
RobLoach committed
160
FLAGS += -DSDL_THREADS_DISABLED -DSDL_CDROM_DISABLED
Steel01's avatar
Steel01 committed
161
FLAGS += -I$(CORE_DIR)/vendor/sdl-libretro/include
RobLoach's avatar
RobLoach committed
162

RobLoach's avatar
RobLoach committed
163
OBJECTS += $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o)
RobLoach's avatar
RobLoach committed
164

RobLoach's avatar
RobLoach committed
165
LDFLAGS +=  $(fpic) $(SHARED) $(EXTRA_LDF)
RobLoach's avatar
RobLoach committed
166
167
168
169
170
171

WARNINGS :=

ifneq ($(HAVE_TESTS),)
	FLAGS += -D__HAVE_TESTS__
endif