Makefile.common 3.14 KB
Newer Older
RobLoach's avatar
RobLoach committed
1

RobLoach's avatar
RobLoach committed
2
# ChaiLove
RobLoach's avatar
RobLoach committed
3
4
SOURCES_CXX += $(wildcard \
	src/*.cpp \
RobLoach's avatar
RobLoach committed
5
	src/chailove/*.cpp \
RobLoach's avatar
RobLoach committed
6
	test/*.cpp \
RobLoach's avatar
RobLoach committed
7
8
9
10
	src/chailove/graphics/*.cpp \
	src/chailove/input/*.cpp \
	src/chailove/audio/*.cpp \
	src/chailove/system/*.cpp \
RobLoach's avatar
RobLoach committed
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
)

# PhysFS
SOURCES_C += $(wildcard \
	vendor/physfs/extras/physfsrwops.c \
	vendor/physfs/src/*.c \
)

# SDL_tty
SOURCES_C += $(wildcard \
	vendor/SDL_tty/src/SDL_tty.c \
	vendor/SDL_tty/src/SDL_fnt.c \
)

# SDL_gfx
SOURCES_C += $(wildcard \
	vendor/sdl-libretro/tests/SDL_gfx-2.0.26/*.c \
)

# SDL
ifeq ($(platform), win)
RobLoach's avatar
RobLoach committed
32
	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
33
else
RobLoach's avatar
RobLoach committed
34
	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
35
endif
RobLoach's avatar
RobLoach committed
36
FLAGS += -DSDL_THREADS_DISABLED -DSDL_CDROM_DISABLED
RobLoach's avatar
RobLoach committed
37

RobLoach's avatar
RobLoach committed
38
OBJECTS += $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o)
RobLoach's avatar
RobLoach committed
39
40
41
42
43
44
45
46
47
48

# Build all the dependencies, and the core.
all: | dependencies	$(TARGET)

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

RobLoach's avatar
RobLoach committed
49
LDFLAGS +=  $(fpic) $(SHARED) $(EXTRA_LDF)
RobLoach's avatar
RobLoach committed
50
51
52
53
54
55
56
FLAGS += -I. \
	-Ivendor/sdl-libretro/include \
	-Ivendor/libretro-common/include \
	-Ivendor/chaiscript/include \
	-Ivendor/SDL_tty/include \
	-Ivendor/sdl-libretro/tests/SDL_gfx-2.0.26 \
	-Ivendor/sdl-libretro/tests/SDL_ttf-2.0.11/VisualC/external/include \
RobLoach's avatar
RobLoach committed
57
	-Ivendor/RobLoachChaiScript_Extras/include \
RobLoach's avatar
RobLoach committed
58
59
60
61
62
63
64
	-Ivendor/physfs/src \
	-Ivendor/Snippets \
	-Ivendor/stb

WARNINGS :=

ifeq ($(HAVE_CHAISCRIPT),)
65
66
67
	FLAGS += -D__HAVE_CHAISCRIPT__
	FLAGS += -DCHAISCRIPT_NO_THREADS -DCHAISCRIPT_NO_THREADS_WARNING -DCHAISCRIPT_NO_DYNLOAD
	FLAGS += -DCHAISCRIPT_EXTRAS_MATH_DISABLE_ISINF -DCHAISCRIPT_EXTRAS_MATH_DISABLE_ISNAN
RobLoach's avatar
RobLoach committed
68
69
70
71
72
endif

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