-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathMakefile
35 lines (24 loc) · 959 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
34
35
#############################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT-0
#############################################################################
.PHONY: clean go
# Set ARCH to "x86" or "arm" as appropriate; this is literally the
# directory name in which the libs2nbignum.a file should be found.
# If this block fails to do it automatically, replace with manual
# setting: ARCH=x86 or ARCH=arm as appropriate
ARCH=unknown_architecture
UNAME_RESULT=$(shell uname -m)
ifeq ($(UNAME_RESULT),x86_64)
ARCH=x86
endif
ifeq ($(UNAME_RESULT),aarch64)
ARCH=arm
endif
ifeq ($(UNAME_RESULT),arm64)
ARCH=arm
endif
# Benchmarking progfram
benchmark: benchmark.c ../include/s2n-bignum.h ../$(ARCH)/libs2nbignum.a; gcc -O3 -o benchmark benchmark.c -L../$(ARCH) -ls2nbignum -lm
go: benchmark ; ./benchmark
clean: ; rm -f benchmark