Debian Codegraph @

crt/s2n/Makefile

raw symbols SCIP
1 #
2 # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License").
5 # You may not use this file except in compliance with the License.
6 # A copy of the License is located at
7 #
8 # http://aws.amazon.com/apache2.0
9 #
10 # or in the "license" file accompanying this file. This file is distributed
11 # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 # express or implied. See the License for the specific language governing
13 # permissions and limitations under the License.
14 #
15
16 PLATFORM := $(shell uname)
17 MAKEFLAGS += PLATFORM=$(PLATFORM)
18
19 ifndef LIBCRYPTO_ROOT
20 export LIBCRYPTO_ROOT = $(shell echo "`pwd`/libcrypto-root")
21 endif
22
23 export S2N_ROOT=$(shell pwd)
24 export COVERAGE_DIR = $(shell echo "${S2N_ROOT}/coverage")
25 DIRS=$(wildcard */)
26 SRCS=$(wildcard *.c)
27 OBJS=$(SRCS:.c=.o)
28
29 .PHONY : all
30 all: bin
31 $(MAKE) -C tests
32
33 bitcode :
34 ${MAKE} -C tests/saw bitcode
35
36 .PHONY : bc
37 bc:
38 ${MAKE} -C crypto bc
39 ${MAKE} -C stuffer bc
40 ${MAKE} -C tls bc
41 ${MAKE} -C utils bc
42 .PHONY : saw
43 saw : bc
44 $(MAKE) -C tests/saw
45
46 include s2n.mk
47
48 .PHONY : libs
49 libs:
50 $(MAKE) -C utils
51 $(MAKE) -C error
52 $(MAKE) -C stuffer
53 $(MAKE) -C crypto
54 $(MAKE) -C tls
55 $(MAKE) -C lib
56
57 .PHONY : bin
58 bin: libs
59 $(MAKE) -C bin
60
61 .PHONY : integrationv2
62 integrationv2: bin
63 $(MAKE) -C tests integrationv2
64
65 .PHONY : coverage
66 coverage: run-lcov run-genhtml
67
68 .PHONY : run-lcov
69 run-lcov:
70 $(MAKE) -C bin lcov
71 $(MAKE) -C crypto lcov
72 $(MAKE) -C error lcov
73 $(MAKE) -C stuffer lcov
74 $(MAKE) -C tests lcov
75 $(MAKE) -C tls run-lcov
76 $(MAKE) -C utils lcov
77 lcov -a crypto/coverage.info -a error/coverage.info -a stuffer/coverage.info -a tls/coverage.info -a $(wildcard tls/*/coverage.info) -a utils/coverage.info --output ${COVERAGE_DIR}/all_coverage.info
78
79 .PHONY : run-genhtml
80 run-genhtml:
81 genhtml -o ${COVERAGE_DIR}/html ${COVERAGE_DIR}/all_coverage.info
82
83
84 .PHONY : indent
85 indent:
86 $(MAKE) -C tests indentsource
87 $(MAKE) -C stuffer indentsource
88 $(MAKE) -C crypto indentsource
89 $(MAKE) -C utils indentsource
90 $(MAKE) -C error indentsource
91 $(MAKE) -C tls indent
92 $(MAKE) -C bin indentsource
93
94 .PHONY : pre_commit_check
95 pre_commit_check: all indent clean
96
97 # TODO use awslabs instead
98 DEV_IMAGE ?= camshaft/s2n-dev
99 DEV_OPENSSL_VERSION ?= openssl-1.1.1
100 DEV_VERSION ?= ubuntu_18.04_$(DEV_OPENSSL_VERSION)_gcc9
101
102 dev:
103 @docker run -it --rm --ulimit memlock=-1 -v `pwd`:/home/s2n-dev/s2n $(DEV_IMAGE):$(DEV_VERSION)
104
105 .PHONY : install
106 install: bin libs
107 $(MAKE) -C bin install
108 $(MAKE) -C lib install
109
110 .PHONY: uninstall
111 uninstall:
112 $(MAKE) -C bin uninstall
113 $(MAKE) -C lib uninstall
114
115 .PHONY : clean
116 clean:
117 $(MAKE) -C tests clean
118 $(MAKE) -C stuffer decruft
119 $(MAKE) -C crypto decruft
120 $(MAKE) -C utils decruft
121 $(MAKE) -C error decruft
122 $(MAKE) -C tls clean
123 $(MAKE) -C bin decruft
124 $(MAKE) -C lib decruft
125 $(MAKE) -C coverage clean