forked from RetroAchievements/RALibretro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
101 lines (86 loc) · 2.51 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# IMPORTANT NOTE FOR CROSS-COMPILING:
# you need to change your PATH to invoke the mingw-32bit flavor of sdl2-config
# Toolset setup
ifeq ($(OS),Windows_NT)
CC=gcc
CXX=g++
RC=windres
else ifeq ($(shell uname -s),Linux)
CC=i686-w64-mingw32-gcc
CXX=i686-w64-mingw32-g++
RC=i686-w64-mingw32-windres
STATICLIBS=-static-libstdc++
endif
INCLUDES=-Isrc -I./src/RAInterface -I./src/miniz -I./src/rcheevos/include
DEFINES=-DOUTSIDE_SPEEX -DRANDOM_PREFIX=speex -DEXPORT= -D_USE_SSE2 -DFIXED_POINT -D_WINDOWS
CCFLAGS=-Wall -m32 $(INCLUDES) $(DEFINES) `sdl2-config --cflags`
CXXFLAGS=$(CCFLAGS) -std=c++11
LDFLAGS=-m32
ifneq ($(DEBUG),)
CFLAGS += -O0 -g -DDEBUG_FSM -DLOG_TO_FILE
CXXFLAGS += -O0 -g -DDEBUG_FSM -DLOG_TO_FILE
else
CFLAGS += -O3 -DNDEBUG -DLOG_TO_FILE
CXXFLAGS += -O3 -DNDEBUG -DLOG_TO_FILE
endif
# main
LIBS=`sdl2-config --static-libs` $(STATICLIBS) -lopengl32 -lwinhttp
OBJS=\
src/dynlib/dynlib.o \
src/jsonsax/jsonsax.o \
src/libretro/BareCore.o \
src/libretro/Core.o \
src/RA_Implementation.o \
src/RAInterface/RA_Interface.o \
src/components/Audio.o \
src/components/Config.o \
src/components/Dialog.o \
src/components/Input.o \
src/components/Logger.o \
src/components/Video.o \
src/miniz/miniz.o \
src/miniz/miniz_tdef.o \
src/miniz/miniz_tinfl.o \
src/miniz/miniz_zip.o \
src/rcheevos/src/rhash/cdreader.o \
src/rcheevos/src/rhash/md5.o \
src/rcheevos/src/rhash/hash.o \
src/speex/resample.o \
src/About.o \
src/Application.o \
src/CdRom.o \
src/Emulator.o \
src/Fsm.o \
src/Git.o \
src/Gl.o \
src/GlUtil.o \
src/Hash.o \
src/KeyBinds.o \
src/main.o \
src/menu.res \
src/Util.o
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
%.o: %.c
$(CC) $(CCFLAGS) -c $< -o $@
%.res: %.rc
$(RC) $< -O coff -o $@
all: bin/RALibretro.exe
bin/RALibretro.exe: $(OBJS)
mkdir -p bin
$(CXX) $(LDFLAGS) -o $@ $+ $(LIBS)
src/Git.cpp: etc/Git.cpp.template FORCE
cat $< | sed s/GITFULLHASH/`git rev-parse HEAD | tr -d "\n"`/g | sed s/GITMINIHASH/`git rev-parse HEAD | tr -d "\n" | cut -c 1-7`/g | sed s/GITRELEASE/`git describe --tags | sed s/\-.*//g | tr -d "\n"`/g > $@
zip:
rm -f bin/RALibretro-*.zip RALibretro-*.zip
zip -9 RALibretro-`git describe | tr -d "\n"`.zip bin/RALibretro.exe
clean:
rm -f bin/RALibretro $(OBJS) bin/RALibretro-*.zip RALibretro-*.zip
pack:
ifeq ("", "$(wildcard bin/RALibretro.exe)")
echo '"bin/RALibretro.exe" not found!'
else
rm -f bin/RALibretro-*.zip RALibretro-*.zip
zip -9r RALibretro-pack-`git describe | tr -d "\n"`.zip bin
endif
.PHONY: clean FORCE