-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile.common
86 lines (82 loc) · 2.8 KB
/
Makefile.common
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
# default parameter values
ifeq ($(ARCH),)
UNAME := $(shell uname -s)
ifeq ($(findstring MINGW64, $(UNAME)), MINGW64)
ARCH=x64
else ifeq ($(findstring MINGW32, $(UNAME)), MINGW32)
ARCH=x86
else
UNAME := $(shell uname -m)
ifeq ($(UNAME), x86_64)
ARCH=x64
else ifeq ($(UNAME), aarch64)
ARCH=arm64
else
ARCH=x86
endif
endif
endif
INCLUDES=-Isrc -I./src/miniz -I./src/rcheevos/include
CFLAGS=-Wall $(INCLUDES)
CXXFLAGS=$(CFLAGS) -std=c++11
LDFLAGS=-static-libgcc -static-libstdc++
ifeq ($(ARCH), x86)
CFLAGS += -m32
CXXFLAGS += -m32
LDFLAGS += -m32
OUTDIR=bin
else ifeq ($(ARCH), x64)
CFLAGS += -m64
CXXFLAGS += -m64
LDFLAGS += -m64
OUTDIR=bin64
else ifeq ($(ARCH), arm64)
CFLAGS += -march=armv8-a
CXXFLAGS += -march=armv8-a
LDFLAGS += -march=armv8-a
OUTDIR=bin64
else
$(error unknown ARCH "$(ARCH)")
endif
ifneq ($(DEBUG),)
CFLAGS += -O0 -g
CXXFLAGS += -O0 -g
else
CFLAGS += -O3 -DNDEBUG
CXXFLAGS += -O3 -DNDEBUG
endif
ifdef HAVE_CHD
CXXFLAGS += -DHAVE_CHD -I./src/libchdr/include
CFLAGS += -D_7ZIP_ST -I./src/libchdr/include -I./src/libchdr/deps/lzma-22.01/include -I./src/libchdr/deps/zlib-1.2.12
CHD_OBJS = src/libchdr/deps/lzma-22.01/src/Alloc.o \
src/libchdr/deps/lzma-22.01/src/Bra86.o \
src/libchdr/deps/lzma-22.01/src/BraIA64.o \
src/libchdr/deps/lzma-22.01/src/CpuArch.o \
src/libchdr/deps/lzma-22.01/src/Delta.o \
src/libchdr/deps/lzma-22.01/src/LzFind.o \
src/libchdr/deps/lzma-22.01/src/Lzma86Dec.o \
src/libchdr/deps/lzma-22.01/src/Lzma86Enc.o \
src/libchdr/deps/lzma-22.01/src/LzmaDec.o \
src/libchdr/deps/lzma-22.01/src/LzmaEnc.o \
src/libchdr/deps/lzma-22.01/src/Sort.o \
src/libchdr/deps/zlib-1.2.12/adler32.o \
src/libchdr/deps/zlib-1.2.12/compress.o \
src/libchdr/deps/zlib-1.2.12/crc32.o \
src/libchdr/deps/zlib-1.2.12/deflate.o \
src/libchdr/deps/zlib-1.2.12/gzclose.o \
src/libchdr/deps/zlib-1.2.12/gzlib.o \
src/libchdr/deps/zlib-1.2.12/gzread.o \
src/libchdr/deps/zlib-1.2.12/gzwrite.o \
src/libchdr/deps/zlib-1.2.12/infback.o \
src/libchdr/deps/zlib-1.2.12/inffast.o \
src/libchdr/deps/zlib-1.2.12/inflate.o \
src/libchdr/deps/zlib-1.2.12/inftrees.o \
src/libchdr/deps/zlib-1.2.12/trees.o \
src/libchdr/deps/zlib-1.2.12/uncompr.o \
src/libchdr/deps/zlib-1.2.12/zutil.o \
src/libchdr/src/libchdr_bitstream.o \
src/libchdr/src/libchdr_cdrom.o \
src/libchdr/src/libchdr_chd.o \
src/libchdr/src/libchdr_flac.o \
src/libchdr/src/libchdr_huffman.o
endif