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

RobLoach's avatar
RobLoach committed
13
14
15
16
# semver
FLAGS += -Ivendor/semver
SOURCES_C += vendor/semver/semver.c

RobLoach's avatar
RobLoach committed
17
18
19
# random
FLAGS += -Ivendor/random/include

RobLoach's avatar
RobLoach committed
20
21
22
23
24
25
# filesystem
FLAGS += -Ivendor/filesystem

# libretro-common
FLAGS += -Ivendor/libretro-common/include

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

RobLoach's avatar
RobLoach committed
45
# PhysFS
RobLoach's avatar
RobLoach committed
46
47
48
FLAGS += -Ivendor/physfs/src
FLAGS += -Ivendor/physfs/extras
FLAGS += -DPHYSFS_NO_CDROM_SUPPORT=1
RobLoach's avatar
RobLoach committed
49
50
51
52
SOURCES_C += $(wildcard \
	vendor/physfs/extras/physfsrwops.c \
	vendor/physfs/src/*.c \
)
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
RobLoach's avatar
RobLoach committed
61
FLAGS += -Ivendor/SDL_tty/include
RobLoach's avatar
RobLoach committed
62
63
64
65
66
67
SOURCES_C += $(wildcard \
	vendor/SDL_tty/src/SDL_tty.c \
	vendor/SDL_tty/src/SDL_fnt.c \
)

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

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
RobLoach's avatar
RobLoach committed
75
FLAGS += -Ivendor/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 += \
RobLoach's avatar
RobLoach 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
	vendor/freetype2/src/base/ftbase.c \
	vendor/freetype2/src/base/ftinit.c \
	vendor/freetype2/src/base/ftsystem.c \
	vendor/freetype2/src/base/ftdebug.c \
	vendor/freetype2/src/base/ftbbox.c \
	vendor/freetype2/src/base/ftbdf.c \
	vendor/freetype2/src/base/ftstroke.c \
	vendor/freetype2/src/base/ftbitmap.c \
	vendor/freetype2/src/base/ftcid.c \
	vendor/freetype2/src/base/ftfntfmt.c \
	vendor/freetype2/src/base/ftfstype.c \
	vendor/freetype2/src/base/ftgasp.c \
	vendor/freetype2/src/base/ftglyph.c \
	vendor/freetype2/src/base/ftgxval.c \
	vendor/freetype2/src/base/ftlcdfil.c \
	vendor/freetype2/src/base/ftmm.c \
	vendor/freetype2/src/base/ftotval.c \
	vendor/freetype2/src/base/ftpatent.c \
	vendor/freetype2/src/base/ftpfr.c \
	vendor/freetype2/src/base/ftsynth.c \
	vendor/freetype2/src/base/fttype1.c \
	vendor/freetype2/src/base/ftwinfnt.c \
	vendor/freetype2/src/autofit/autofit.c \
	vendor/freetype2/src/pshinter/pshinter.c \
	vendor/freetype2/src/psaux/psaux.c \
	vendor/freetype2/src/psnames/psnames.c \
	vendor/freetype2/src/raster/raster.c \
	vendor/freetype2/src/smooth/smooth.c \
	vendor/freetype2/src/cache/ftcache.c \
	vendor/freetype2/src/bdf/bdf.c \
	vendor/freetype2/src/cff/cff.c \
	vendor/freetype2/src/pcf/pcf.c \
	vendor/freetype2/src/winfonts/winfnt.c \
	vendor/freetype2/src/sfnt/sfnt.c \
	vendor/freetype2/src/pfr/pfr.c \
	vendor/freetype2/src/truetype/truetype.c \
	vendor/freetype2/src/type1/type1.c \
	vendor/freetype2/src/type42/type42.c \
	vendor/freetype2/src/cid/type1cid.c \
	vendor/freetype2/src/gzip/ftgzip.c \
	vendor/freetype2/src/bzip2/ftbzip2.c \
	vendor/freetype2/src/lzw/ftlzw.c
RobLoach's avatar
RobLoach committed
131

RobLoach's avatar
RobLoach committed
132
# SDL_ttf
RobLoach's avatar
RobLoach committed
133
134
FLAGS += -Ivendor/sdl-libretro/tests/SDL_ttf-2.0.11/VisualC/external/include
SOURCES_C += vendor/sdl-libretro/tests/SDL_ttf-2.0.11/SDL_ttf.c
RobLoach's avatar
RobLoach committed
135
136
137
138
139
140
141
142
143
144

# SDL_stbimage
FLAGS += -Ivendor/Snippets

# STB
FLAGS += -Ivendor/stb

# ChaiScript
ifeq ($(HAVE_CHAISCRIPT),)
	FLAGS += -Ivendor/chaiscript/include
RobLoach's avatar
RobLoach committed
145
	FLAGS += -Ivendor/ChaiScript_Extras/include
RobLoach's avatar
RobLoach committed
146
147
148
149
	FLAGS += -D__HAVE_CHAISCRIPT__
	FLAGS += -DCHAISCRIPT_NO_THREADS -DCHAISCRIPT_NO_THREADS_WARNING -DCHAISCRIPT_NO_DYNLOAD
endif

RobLoach's avatar
RobLoach committed
150
151
# SDL
ifeq ($(platform), win)
RobLoach's avatar
RobLoach committed
152
	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
153
else
RobLoach's avatar
RobLoach committed
154
	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/thread/generic/*.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/loadso/dummy/*.c)
RobLoach's avatar
RobLoach committed
155
endif
RobLoach's avatar
RobLoach committed
156
FLAGS += -DSDL_THREADS_DISABLED -DSDL_CDROM_DISABLED
RobLoach's avatar
RobLoach committed
157
158
FLAGS += -Ivendor/sdl-libretro/include

RobLoach's avatar
RobLoach committed
159
OBJECTS += $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o)
RobLoach's avatar
RobLoach committed
160
161
162
163
164
165
166

ifeq ($(DEBUG), 0)
   FLAGS += -O3 -ffast-math -fomit-frame-pointer
else
   FLAGS += -O0 -g
endif

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

WARNINGS :=

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