-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile.RAHasher
68 lines (54 loc) · 1.54 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
61
62
63
64
65
66
67
68
# supported parameters
# ARCH architecture - "x86" or "x64" [detected if not set]
# DEBUG if set to anything, builds with DEBUG symbols
include Makefile.common
# Toolset setup
CC=gcc
CXX=g++
ifeq ($(OS),Windows_NT)
EXE=.exe
KERNEL=windows
else
KERNEL := $(shell uname -s)
endif
# compile flags
DEFINES=-D_CONSOLE
CFLAGS += $(DEFINES)
CXXFLAGS += $(DEFINES)
# main
LIBS=
OBJS=\
src/components/Logger.o \
src/libmincrypt/sha256.o \
src/miniz/miniz.o \
src/miniz/miniz_tdef.o \
src/miniz/miniz_tinfl.o \
src/miniz/miniz_zip.o \
src/rcheevos/src/rhash/aes.o \
src/rcheevos/src/rhash/cdreader.o \
src/rcheevos/src/rhash/hash.o \
src/rcheevos/src/rhash/md5.o \
src/Git.o \
src/Hash3DS.o \
src/Util.o \
src/RAHasher.o
ifdef HAVE_CHD
OBJS += $(CHD_OBJS) \
src/HashCHD.o
endif
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
all: $(OUTDIR)/RAHasher$(EXE)
$(OUTDIR)/RAHasher$(EXE): $(OBJS)
mkdir -p $(OUTDIR)
$(CXX) -o $@ $+ $(LDFLAGS)
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: $(OUTDIR)/RAHasher$(EXE)
rm -f $(OUTDIR)/RAHasher-*.zip RAHasher-*.zip
zip -9 RAHasher-$(ARCH)-$(KERNEL)-`git describe --tags | sed s/\-.*//g | tr -d "\n"`.zip $(OUTDIR)/RAHasher$(EXE)
clean:
rm -f $(OUTDIR)/RAHasher$(EXE) $(OBJS) $(OUTDIR)/RAHasher*.zip RAHasher*.zip
.PHONY: clean FORCE