-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathMakefile.common
97 lines (93 loc) · 3.59 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
87
88
89
90
91
92
93
94
95
96
97
# 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 += -DZ7_ST -DZSTD_DISABLE_ASM -I./src/libchdr/include -I./src/libchdr/deps/lzma-24.05/include -I./src/libchdr/deps/zlib-1.3.1 -I./src/libchdr/deps/zstd-1.5.6/lib
CHD_OBJS = src/libchdr/deps/lzma-24.05/src/Alloc.o \
src/libchdr/deps/lzma-24.05/src/Bra86.o \
src/libchdr/deps/lzma-24.05/src/BraIA64.o \
src/libchdr/deps/lzma-24.05/src/CpuArch.o \
src/libchdr/deps/lzma-24.05/src/Delta.o \
src/libchdr/deps/lzma-24.05/src/LzFind.o \
src/libchdr/deps/lzma-24.05/src/Lzma86Dec.o \
src/libchdr/deps/lzma-24.05/src/LzmaDec.o \
src/libchdr/deps/lzma-24.05/src/LzmaEnc.o \
src/libchdr/deps/lzma-24.05/src/Sort.o \
src/libchdr/deps/zlib-1.3.1/adler32.o \
src/libchdr/deps/zlib-1.3.1/compress.o \
src/libchdr/deps/zlib-1.3.1/crc32.o \
src/libchdr/deps/zlib-1.3.1/deflate.o \
src/libchdr/deps/zlib-1.3.1/gzclose.o \
src/libchdr/deps/zlib-1.3.1/gzlib.o \
src/libchdr/deps/zlib-1.3.1/gzread.o \
src/libchdr/deps/zlib-1.3.1/gzwrite.o \
src/libchdr/deps/zlib-1.3.1/infback.o \
src/libchdr/deps/zlib-1.3.1/inffast.o \
src/libchdr/deps/zlib-1.3.1/inflate.o \
src/libchdr/deps/zlib-1.3.1/inftrees.o \
src/libchdr/deps/zlib-1.3.1/trees.o \
src/libchdr/deps/zlib-1.3.1/uncompr.o \
src/libchdr/deps/zlib-1.3.1/zutil.o \
src/libchdr/deps/zstd-1.5.6/lib/common/debug.o \
src/libchdr/deps/zstd-1.5.6/lib/common/entropy_common.o \
src/libchdr/deps/zstd-1.5.6/lib/common/error_private.o \
src/libchdr/deps/zstd-1.5.6/lib/common/fse_decompress.o \
src/libchdr/deps/zstd-1.5.6/lib/common/pool.o \
src/libchdr/deps/zstd-1.5.6/lib/common/threading.o \
src/libchdr/deps/zstd-1.5.6/lib/common/xxhash.o \
src/libchdr/deps/zstd-1.5.6/lib/common/zstd_common.o \
src/libchdr/deps/zstd-1.5.6/lib/decompress/huf_decompress.o \
src/libchdr/deps/zstd-1.5.6/lib/decompress/zstd_ddict.o \
src/libchdr/deps/zstd-1.5.6/lib/decompress/zstd_decompress.o \
src/libchdr/deps/zstd-1.5.6/lib/decompress/zstd_decompress_block.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