forked from RetroAchievements/RALibretro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.RAHasher
60 lines (47 loc) · 1.17 KB
/
Makefile.RAHasher
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
# Toolset setup
CC=gcc
CXX=g++
ifeq ($(OS),Windows_NT)
EXE=.exe
endif
INCLUDES=-I./src -I./src/RAInterface -I./src/miniz -I./src/rcheevos/include
DEFINES=-D_CONSOLE
CCFLAGS=-Wall -m32 $(INCLUDES) $(DEFINES)
CXXFLAGS=$(CCFLAGS) -std=c++11
LDFLAGS=-m32
ifneq ($(DEBUG),)
CFLAGS += -O0 -g
CXXFLAGS += -O0 -g
else
CFLAGS += -O3
CXXFLAGS += -O3
endif
# main
LIBS=
OBJS=\
src/components/Logger.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/hash.o \
src/rcheevos/src/rhash/md5.o \
src/Git.o \
src/Util.o \
src/RAHasher.o
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
%.o: %.c
$(CC) $(CCFLAGS) -c $< -o $@
%.res: %.rc
$(RC) $< -O coff -o $@
all: bin/RAHasher$(EXE)
bin/RAHasher$(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 > $@
clean:
rm -f bin/RAHasher$(EXE) $(OBJS)
.PHONY: clean FORCE