aboutsummaryrefslogtreecommitdiff
path: root/makefile
blob: eebe3e991258caaef27974fd26b9e0189c3167c8 (plain) (blame)
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
CC=gcc
CFLAGS=-Wall --std=c99 
SRC=siphash.c halfsiphash.c test.c
BIN=test debug vectors

ifneq ($(cROUNDS),)
CFLAGS:=$(CFLAGS) -DcROUNDS=$(cROUNDS)
endif

ifneq ($(dROUNDS),)
CFLAGS:=$(CFLAGS) -DdROUNDS=$(dROUNDS)
endif

all:                    $(BIN)

test:                   $(SRC)
			$(CC) $(CFLAGS) $^ -o $@

debug:                  $(SRC) 
			$(CC) $(CFLAGS) $^ -o $@ -DDEBUG

vectors:                $(SRC) 
			$(CC) $(CFLAGS) $^ -o $@ -DGETVECTORS


clean:
			rm -f *.o $(BIN)
format:
		        clang-format -style="{BasedOnStyle: llvm, IndentWidth: 4}" \
			-i *.c *.h 

dist:                   clean
			cd ..; \
	                tar zcf SipHash-`date +%Y%m%d%H%M`.tgz SipHash/*