-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
69 lines (49 loc) · 1.39 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
57
58
59
60
61
62
63
64
65
66
67
68
69
#
# Written by Solar Designer and placed in the public domain.
# See crypt_blowfish.c for more information.
#
MAJOR_VERSION = 1
VERSION = $(MAJOR_VERSION).1
CC = gcc
AS = $(CC)
LD = $(CC)
RM = rm -f
CFLAGS = -Wall -O2 -fomit-frame-pointer -funroll-loops
ASFLAGS = -c
LDFLAGS = -s
BLOWFISH_OBJS = \
crypt_blowfish.o x86.o
CRYPT_OBJS = \
$(BLOWFISH_OBJS) crypt_gensalt.o wrapper.o
TEST_OBJS = \
$(BLOWFISH_OBJS) crypt_gensalt.o crypt_test.o
TEST_THREADS_OBJS = \
$(BLOWFISH_OBJS) crypt_gensalt.o crypt_test_threads.o
EXTRA_MANS = \
crypt_r.3 crypt_rn.3 crypt_ra.3 \
crypt_gensalt.3 crypt_gensalt_rn.3 crypt_gensalt_ra.3
all: $(CRYPT_OBJS) man
library: libbcrypt.so.$(VERSION)
check: crypt_test
./crypt_test
libbcrypt.so.$(VERSION): $(BLOWFISH_OBJS)
$(CC) -shared -W1,-soname,libbcrypt.so.1 -o $@ $(BLOWFISH_OBJS)
crypt_test: $(TEST_OBJS)
$(LD) $(LDFLAGS) $(TEST_OBJS) -o $@
crypt_test.o: wrapper.c
$(CC) -c $(CFLAGS) wrapper.c -DTEST -o $@
check_threads: crypt_test_threads
./crypt_test_threads
crypt_test_threads: $(TEST_THREADS_OBJS)
$(LD) $(LDFLAGS) $(TEST_THREADS_OBJS) -lpthread -o $@
crypt_test_threads.o: wrapper.c
$(CC) -c $(CFLAGS) wrapper.c -DTEST -DTEST_THREADS=4 -o $@
man: $(EXTRA_MANS)
$(EXTRA_MANS):
echo '.so man3/crypt.3' > $@
.c.o:
$(CC) -c $(CFLAGS) $*.c
.S.o:
$(AS) $(ASFLAGS) $*.S
clean:
$(RM) crypt_test crypt_test_threads *.o $(EXTRA_MANS) core libbcrypt.so.$(VERSION)