forked from 360trev/ME7Sum
-
Notifications
You must be signed in to change notification settings - Fork 19
/
vars.mk
35 lines (28 loc) · 878 Bytes
/
vars.mk
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
RM = rm -f
AR = ar rcs
ECHO = @echo
#CASAN = -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment
#LASAN = -lasan -lubsan
CFLAGS += -Wall -O2 -g -Werror -MMD $(CASAN) $(CDEFS)
CDEFS += -D__GIT_VERSION=\"$(GIT_VERSION)\"
GIT_VERSION = $(shell sh -c 'git describe --tags --abbrev=4 --dirty --always')
SYS := $(shell gcc -dumpmachine)
#SYS := i686-w64-mingw32
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
CC = gcc
LD = gcc
LDFLAGS += -L /opt/homebrew/lib -Linifile $(LASAN) $(GMP_LINK) -lgmp -Wl,-dynamic
CFLAGS += -I /opt/homebrew/include
else
CC = $(SYS)-gcc
LD = $(SYS)-gcc
LDFLAGS += -Linifile $(LASAN) $(GMP_LINK) -lgmp -Wl,-Bdynamic
endif
SRC = $(notdir $(foreach dir, ., $(wildcard $(dir)/*.c)))
ifneq (, $(findstring mingw, $(SYS)))
GMP_LINK = -Wl,-Bstatic
EXE_EXT = .exe
else ifneq (, $(findstring cygwin, $(SYS)))
EXE_EXT = -cyg.exe
endif