-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
33 lines (25 loc) · 924 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
CC = clang
CFLAGS = -std=gnu11 -O2 -Wall -Wextra -Werror -Wconversion -pedantic -Wno-unused-result
MUMSH_SRC = *.c
MUMSH_H = *.h
MUMSH = mumsh
MUMSHMC = mumsh_memory_check
MUMSHMC_FLAGS = -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=integer
TAR_NAME = mumsh.tar
.PHONY: clean
all: $(MUMSH)
@echo mumsh successfully constructed
tar:
tar -cvzf $(TAR_NAME) $(MUMSH_SRC) $(MUMSH_H)
check: $(MUMSH) $(MUMSHMC) $(MUMSH_H)
cpplint --linelength=120 --filter=-legal,-readability/casting,-whitespace,-runtime/printf,-runtime/threadsafe_fn,-readability/todo,-build/include_subdir,-build/header_guard *.c *.h
./$(MUMSHMC)
$(MUMSH): $(MUMSH_SRC) $(MUMSH_H)
$(CC) $(CFLAGS) -o $(MUMSH) $(MUMSH_SRC)
$(MUMSHMC): $(MUMSH_SRC) $(MUMSH_H)
$(CC) $(CFLAGS) $(MUMSHMC_FLAGS) -o $(MUMSHMC) $(MUMSH_SRC)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
clean:
$(RM) -f *.o *.a *~ $(MUMSH) $(MUMSHMC)
$(RM) -f *.tar