-
Notifications
You must be signed in to change notification settings - Fork 40
/
Makefile
36 lines (36 loc) · 1.68 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
# ------------------------------------------------------------------------------
# setup
# ------------------------------------------------------------------------------
.PHONY: all
OPENSSL_ROOT=
OPENSSL_INCLUDE=
OPENSSL_LIBS=-lcrypto
# ------------------------------------------------------------------------------
# all target
# ------------------------------------------------------------------------------
all: ectoken libectoken.a
# ------------------------------------------------------------------------------
# ectoken
# ------------------------------------------------------------------------------
ectoken: util/ectoken_cmd.c ectoken.c base64.c
gcc -O2 -Wall -Werror -std=gnu99 util/ectoken_cmd.c -I. ectoken.c base64.c -o ectoken $(OPENSSL_LIBS) $(OPENSSL_INCLUDE) -lm
# ------------------------------------------------------------------------------
# libectoken
# ------------------------------------------------------------------------------
libectoken.a: ectoken.o base64.o
ar rcs $@ ectoken.o base64.o
# ------------------------------------------------------------------------------
# ectoken_test
# ------------------------------------------------------------------------------
ectoken_test: tests/ectoken_test.c all
gcc -std=c99 -I. tests/ectoken_test.c -lcrypto -lm -o ectoken_test
# ------------------------------------------------------------------------------
# test
# ------------------------------------------------------------------------------
test: ectoken_test
./ectoken_test
# ------------------------------------------------------------------------------
# clean
# ------------------------------------------------------------------------------
clean:
-rm -f *.o *.a ectoken ectoken_test