-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (25 loc) · 965 Bytes
/
Makefile
File metadata and controls
35 lines (25 loc) · 965 Bytes
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
# Generals
CC = gcc
CFLAGS = -std=gnu11 -Wall -pedantic -O3 -g
LINKERFLAGS = -ldl
LEAKDETECTION = -fsanitize=address -fsanitize=leak -fno-omit-frame-pointer
SNOWFLAGS = -Isnow -DSNOW_ENABLED
# Files
DIR = src
SOURCES = process.c tokens.c command_runner.c command_scheduler.c signals.c prompt.c builtins.c param.c utils.c
TESHFILE = tesh.c
SNOWFILE = tests.c
all: tesh
# Targets
tesh-leak-detection:
$(CC) $(CFLAGS) $(LEAKDETECTION) -o tesh $(addprefix $(DIR)/,$(SOURCES)) $(DIR)/$(TESHFILE) $(LINKERFLAGS)
test-leak-detection:
$(CC) $(SNOWFLAGS) $(LEAKDETECTION) $(CFLAGS) -o test $(addprefix $(DIR)/,$(SOURCES)) $(DIR)/$(SNOWFILE) $(LINKERFLAGS)
# Leak detection doesn't work in docker
tesh:
$(CC) $(CFLAGS) -o tesh $(addprefix $(DIR)/,$(SOURCES)) $(DIR)/$(TESHFILE) $(LINKERFLAGS)
test:
$(CC) $(SNOWFLAGS) $(CFLAGS) -o test $(addprefix $(DIR)/,$(SOURCES)) $(DIR)/$(SNOWFILE) $(LINKERFLAGS)
clean:
rm -rf tesh test
.PHONY: all tesh test clean