Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 67 lines (54 sloc) 1.634 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
10 # whether to enable debugging or not
11 # be careful with this option: it leaks the derived key!
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
12 DEBUG?=no
13
0c6d6a0 @bwalex big warning cleanup
authored
14 WARNFLAGS= -Wsystem-headers -Werror -Wall -W -Wno-unused-parameter \
15 -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
16 -Wold-style-definition -Wreturn-type -Wcast-qual -Wwrite-strings \
17 -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts \
b43f8ea @bwalex fix up a bit
authored
18 -Winline -Wnested-externs
34165ed @bwalex first step to porting to linux; can be broken :)
authored
19
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
20 SRCS= tcplay.c crc32.c safe_mem.c io.c hdr.c humanize.c
21 SRCS+= crypto.c generic_xts.c
22 OBJS= tcplay.o crc32.o safe_mem.o io.o hdr.o humanize.o
23 OBJS+= crypto.o generic_xts.o
24
25 CFLAGS+= $(WARNFLAGS)
26
27 ifeq (${DEBUG}, yes)
5537c69 @bwalex prettify Makefile a bit
authored
28 CFLAGS+= -O0 -g -DDEBUG
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
29 else
5537c69 @bwalex prettify Makefile a bit
authored
30 CFLAGS+= -O3
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
31 endif
32
33 ifeq (${SYSTEM}, linux)
5537c69 @bwalex prettify Makefile a bit
authored
34 LIBS+= -lgcrypt -ldevmapper -luuid
35 SRCS+= crypto-gcrypt.c
36 OBJS+= crypto-gcrypt.o
37 ifeq (${PBKDF_BACKEND}, gcrypt)
38 SRCS+= pbkdf2-gcrypt.c
39 OBJS+= pbkdf2-gcrypt.o
40 endif
41 ifeq (${PBKDF_BACKEND}, openssl)
42 SRCS+= pbkdf2-openssl.c
43 OBJS+= pbkdf2-openssl.o
44 LIBS+= -lcrypto
45 endif
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
46 endif
5537c69 @bwalex prettify Makefile a bit
authored
47
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
48 ifeq (${SYSTEM}, dragonfly)
5537c69 @bwalex prettify Makefile a bit
authored
49 LIBS+= -lcrypto -ldm -lprop
50 SRCS+= crypto-dev.c
51 OBJS+= crypto-dev.o
52 SRCS+= pbkdf2-openssl.c
53 OBJS+= pbkdf2-openssl.o
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
54 endif
55
56 program:
57 $(CC) $(CFLAGS) -o tc-play main.c $(SRCS) $(LIBS)
a6e7a9d @bwalex make compilable when in lib/api mode
authored
58 lib:
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
59 $(CC) $(CFLAGS) -c -fPIC tcplay_api.c $(SRCS)
60 $(CC) -shared -Wl,-version-script=tcplay.map -o libtcplay.so tcplay_api.o $(OBJS)
61
f7a33cd @bwalex add linker version script to hide internal syms
authored
62 test:
5537c69 @bwalex prettify Makefile a bit
authored
63 gcc -O0 -g -L. -I. tcplay_api_test.c -ltcplay -lcrypto -ldm -lprop
95d1abc @bwalex Add Makefile
authored
64 clean:
7d3bd9d @bwalex big cleanup; Makefile is now gnu make
authored
65 rm -f tc-play libtcplay.so tc-play.core *.o ktrace.out
5537c69 @bwalex prettify Makefile a bit
authored
66
Something went wrong with that request. Please try again.