-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (41 loc) · 1.52 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Copyright (c) 2015-2016 Cryptography Research, Inc.
# Author: Mike Hamburg
# Description: STROBE Makefile. for
CC= gcc
ARMCC= arm-none-eabi-gcc -fstack-usage -DNDEBUG
CFLAGS= -std=c11 -Os -Wall -Wextra -Werror $(XCFLAGS)
ARMLDFLAGS= -lc -specs=rdimon.specs
ARMTARGET= -mcpu=cortex-m4 -mthumb -DSTROBE_SINGLE_THREAD=1
.PHONY: all todo clean size-arm test-arm test-native test-strobe test-connection
all: build/test_x25519 build/test_x25519.arm build/test_strobe
build/timestamp:
mkdir build
touch $@
build/%.arm.o: %.c build/timestamp *.h Makefile
$(ARMCC) $(CFLAGS) $(ARMTARGET) -o $@ -c $<
build/%.o: %.c build/timestamp *.h Makefile
$(CC) $(CFLAGS) -o $@ -c $<
build/test_x25519.arm: build/x25519.arm.o build/test_x25519.arm.o
$(ARMCC) $(ARMTARGET) -o $@ $^ $(ARMLDFLAGS)
build/test_x25519: build/x25519.o build/test_x25519.o
$(CC) $(TARGET) -o $@ $^ $(LDFLAGS)
test-strobe: build/test_strobe
build/test_strobe: build/strobe.o build/x25519.o build/test_strobe.o
$(CC) $(TARGET) -o $@ $^ $(LDFLAGS)
size-arm: build/test_x25519.arm
size build/x25519.arm.o
cat build/x25519.arm.su || true
nm --size build/x25519.arm.o | perl -pe 's/[0-9a-f]+/hex $&/e'
test-arm: size-arm
time ./build/test_x25519.arm
test-native: build/test_x25519
build/test_x25519
test-connection: build/test_strobe
./$< --keygen > build/keys
sh -c "`head -n 1 build/keys`" > /dev/null &
sleep 1
sh -c "`tail -n 1 build/keys`"
todo::
@egrep --color 'TODO|FIXME|HACK|XXX|(\bBUG\b)|WTF|PERF' *.c *.h arm/*.inc
clean::
rm -fr build release keys