aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 609c0cdba2d9124ec7716282aa8e47a31dbc4d24 (plain)
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
# compiler flags used for sample application and shared library
CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native

# sample application
APP=./sha3
APP_OBJS=sha3.o main.o

# test app (test suite and sanitizers)
TEST_CFLAGS=-g -fsanitize=address,pointer-compare,pointer-subtract,undefined,leak -W -Wall -Wextra -Werror -pedantic -std=c11
TEST_APP=./test-sha3

.PHONY=test all

all: $(APP)

# build sample application
$(APP): $(APP_OBJS)
	$(CC) -o $(APP) $(CFLAGS) $(APP_OBJS)

%.o: %.c
	$(CC) -c $(CFLAGS) $<

# build and run test suite with sanitizers
test:
	$(CC) -o $(TEST_APP) $(TEST_CFLAGS) -DSHA3_TEST sha3.c && $(TEST_APP)

clean:
	$(RM) -f $(TEST_APP) $(APP) $(APP_OBJS)