Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 69 lines (55 sloc) 1.612 kB
20ecb52 @bwalex add a few comments to make options
authored
1 # either linux or dragonfly
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
2 SYSTEM?=linux
20ecb52 @bwalex add a few comments to make options
authored
3
4 # either openssl or gcrypt
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
5 PBKDF_BACKEND?=openssl
20ecb52 @bwalex add a few comments to make options
authored
6
7 # system compiler, normally gcc
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
8 CC?=gcc
20ecb52 @bwalex add a few comments to make options
authored
9
aa7ee2e @jmesmon Use variables for rm (in clean) and gcc (in test)
jmesmon authored
10 RM?=rm -f
11
20ecb52 @bwalex add a few comments to make options
authored
12 # whether to enable debugging or not
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
13 DEBUG?=no
14
0c6d6a0 @bwalex big warning cleanup
authored
15 WARNFLAGS= -Wsystem-headers -Werror -Wall -W -Wno-unused-parameter \
16 -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
17 -Wold-style-definition -Wreturn-type -Wcast-qual -Wwrite-strings \
18 -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts \
b43f8ea @bwalex fix up a bit
authored
19 -Winline -Wnested-externs
34165ed @bwalex first step to porting to linux; can be broken :)
authored
20
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
21 SRCS= tcplay.c crc32.c safe_mem.c io.c hdr.c humanize.c
22 SRCS+= crypto.c generic_xts.c
23 OBJS= tcplay.o crc32.o safe_mem.o io.o hdr.o humanize.o
24 OBJS+= crypto.o generic_xts.o
25
26 CFLAGS+= $(WARNFLAGS)
27
28 ifeq (${DEBUG}, yes)
5537c69 @bwalex prettify Makefile a bit
authored
29 CFLAGS+= -O0 -g -DDEBUG
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
30 else
5537c69 @bwalex prettify Makefile a bit
authored
31 CFLAGS+= -O3
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
32 endif
33
34 ifeq (${SYSTEM}, linux)
5205e14 @bwalex Fix build on some linux distros & fix generic bug
authored
35 CFLAGS+= -D_GNU_SOURCE
5537c69 @bwalex prettify Makefile a bit
authored
36 LIBS+= -lgcrypt -ldevmapper -luuid
37 SRCS+= crypto-gcrypt.c
38 OBJS+= crypto-gcrypt.o
39 ifeq (${PBKDF_BACKEND}, gcrypt)
40 SRCS+= pbkdf2-gcrypt.c
41 OBJS+= pbkdf2-gcrypt.o
42 endif
43 ifeq (${PBKDF_BACKEND}, openssl)
44 SRCS+= pbkdf2-openssl.c
45 OBJS+= pbkdf2-openssl.o
46 LIBS+= -lcrypto
47 endif
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
48 endif
5537c69 @bwalex prettify Makefile a bit
authored
49
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
50 ifeq (${SYSTEM}, dragonfly)
5537c69 @bwalex prettify Makefile a bit
authored
51 LIBS+= -lcrypto -ldm -lprop
52 SRCS+= crypto-dev.c
53 OBJS+= crypto-dev.o
54 SRCS+= pbkdf2-openssl.c
55 OBJS+= pbkdf2-openssl.o
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
56 endif
57
58 program:
59c6097 @bwalex complete the namechange to tcplay
authored
59 $(CC) $(CFLAGS) -o tcplay main.c $(SRCS) $(LIBS)
a6e7a9d @bwalex make compilable when in lib/api mode
authored
60 lib:
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
61 $(CC) $(CFLAGS) -c -fPIC tcplay_api.c $(SRCS)
62 $(CC) -shared -Wl,-version-script=tcplay.map -o libtcplay.so tcplay_api.o $(OBJS)
63
f7a33cd @bwalex add linker version script to hide internal syms
authored
64 test:
aa7ee2e @jmesmon Use variables for rm (in clean) and gcc (in test)
jmesmon authored
65 $(CC) -O0 -g -L. -I. tcplay_api_test.c -ltcplay -lcrypto -ldm -lprop
95d1abc @bwalex Add Makefile
authored
66 clean:
aa7ee2e @jmesmon Use variables for rm (in clean) and gcc (in test)
jmesmon authored
67 $(RM) tcplay libtcplay.so tcplay.core *.o ktrace.out
5537c69 @bwalex prettify Makefile a bit
authored
68
Something went wrong with that request. Please try again.