-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (30 loc) · 784 Bytes
/
Makefile
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
EXEC := mewa
CC := gcc
LIBS := -lreadline -DHAVE_LIBREADLINE -lm
CFLAGS := -std=gnu2x
WARNINGS := -Wall -Wextra -Wpedantic -Wno-multichar -Wformat-security
ifeq ($(DEBUG),1)
WARNINGS += -Werror
CFLAGS += -O0
ifeq ($(CC),clang)
CFLAGS += -fsanitize=address -fsanitize=undefined \
-fno-sanitize-recover=all -fsanitize=float-divide-by-zero \
-fsanitize=float-cast-overflow -fno-sanitize=null \
-fno-sanitize=alignment -g
endif
else
CFLAGS += -DNDEBUG -O2
endif
ifeq ($(COLOR),0)
CFLAGS += -DNCOLORS
endif
ifeq ($(OS),Windows_NT)
EXEC := $(EXEC).exe
endif
build: mewa.c
@echo "BUILDING EXECUTABLE"
@[ -d "./bin" ] || mkdir bin
$(CC) $(CFLAGS) $(WARNINGS) -o bin/$(EXEC) mewa.c $(LIBS)
run: build
@echo "RUNNING EXECUTABLE"
./bin/mewa