Debian Codegraph @

crt/s2n/tests/testlib/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 EXAMPLES_DIR=../../docs/examples
17 EXAMPLES=$(wildcard $(EXAMPLES_DIR)/*.c)
18
19 SRCS=$(wildcard *.c)
20 # Consider the examples part of the testlib.
21 # It would be more correct to build the examples separately, but requires more setup
22 # and we've deprecated our Makefiles anyway.
23 SRCS += $(EXAMPLES)
24 OBJS=$(SRCS:.c=.o)
25 CRYPTO_LDFLAGS = -L$(LIBCRYPTO_ROOT)/lib
26
27 .PHONY : all
28 all: libtests2n.a libtests2n.so libtests2n.dylib
29
30 include ../../s2n.mk
31
32 CFLAGS += -I../
33 LIBS += ../../lib/libs2n.a
34 LDFLAGS += ${CRYPTO_LDFLAGS} ${LIBS} ${CRYPTO_LIBS} -lm -ldl -lrt -pthread
35 CRUFT += $(filter-out %.c, $(wildcard $(EXAMPLES_DIR)/*))
36
37 libtests2n.so: ${OBJS}
38 ${CC} ${CFLAGS} -shared ${LDFLAGS} -o libtests2n.so ${OBJS}
39
40 libtests2n.dylib: ${OBJS}
41 test ! -f /usr/lib/libSystem.dylib || libtool ${LDFLAGS} -dynamic -o libtests2n.dylib ${OBJS}
42
43 libtests2n.a: ${OBJS}
44 $(AR) cru libtests2n.a ${OBJS}
45 $(RANLIB) libtests2n.a