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.602 kb
20ecb52 Alex Hornung add a few comments to make options
authored
1 # either linux or dragonfly
7d3bd9d Alex Hornung big cleanup; Makefile is now gnu make
authored
2 SYSTEM?=linux
20ecb52 Alex Hornung add a few comments to make options
authored
3
4 # either openssl or gcrypt
7d3bd9d Alex Hornung big cleanup; Makefile is now gnu make
authored
5 PBKDF_BACKEND?=openssl
20ecb52 Alex Hornung add a few comments to make options
authored
6
7 # system compiler, normally gcc
7d3bd9d Alex Hornung big cleanup; Makefile is now gnu make
authored
8 CC?=gcc
20ecb52 Alex Hornung add a few comments to make options
authored
9
10 # whether to enable debugging or not
7d3bd9d Alex Hornung big cleanup; Makefile is now gnu make
authored
11 DEBUG?=no
12
0c6d6a0 Alex Hornung big warning cleanup
authored
13 WARNFLAGS= -Wsystem-headers -Werror -Wall -W -Wno-unused-parameter \
14 -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
15 -Wold-style-definition -Wreturn-type -Wcast-qual -Wwrite-strings \
16 -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts \
b43f8ea Alex Hornung fix up a bit
authored
17 -Winline -Wnested-externs
34165ed Alex Hornung first step to porting to linux; can be broken :)
authored
18
7d3bd9d Alex Hornung big cleanup; Makefile is now gnu make
authored
19 SRCS= tcplay.c crc32.c safe_mem.c io.c hdr.c humanize.c
20 SRCS+= crypto.c generic_xts.c
21 OBJS= tcplay.o crc32.o safe_mem.o io.o hdr.o humanize.o
22 OBJS+= crypto.o generic_xts.o
23
24 CFLAGS+= $(WARNFLAGS)
25
26 ifeq (${DEBUG}, yes)
5537c69 Alex Hornung prettify Makefile a bit
authored
27 CFLAGS+= -O0 -g -DDEBUG
7d3bd9d Alex Hornung big cleanup; Makefile is now gnu make
authored
28 else
5537c69 Alex Hornung prettify Makefile a bit
authored
29 CFLAGS+= -O3
7d3bd9d Alex Hornung big cleanup; Makefile is now gnu make
authored
30 endif
31
32 ifeq (${SYSTEM}, linux)
5205e14 Alex Hornung Fix build on some linux distros & fix generic bug
authored
33 CFLAGS+= -D_GNU_SOURCE
5537c69 Alex Hornung 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 Alex Hornung big cleanup; Makefile is now gnu make
authored
46 endif
5537c69 Alex Hornung prettify Makefile a bit
authored
47
7d3bd9d Alex Hornung big cleanup; Makefile is now gnu make
authored
48 ifeq (${SYSTEM}, dragonfly)
5537c69 Alex Hornung 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 Alex Hornung big cleanup; Makefile is now gnu make
authored
54 endif
55
56 program:
57 $(CC) $(CFLAGS) -o tc-play main.c $(SRCS) $(LIBS)
a6e7a9d Alex Hornung make compilable when in lib/api mode
authored
58 lib:
7d3bd9d Alex Hornung 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 Alex Hornung add linker version script to hide internal syms
authored
62 test:
5537c69 Alex Hornung prettify Makefile a bit
authored
63 gcc -O0 -g -L. -I. tcplay_api_test.c -ltcplay -lcrypto -ldm -lprop
95d1abc Alex Hornung Add Makefile
authored
64 clean:
7d3bd9d Alex Hornung big cleanup; Makefile is now gnu make
authored
65 rm -f tc-play libtcplay.so tc-play.core *.o ktrace.out
5537c69 Alex Hornung prettify Makefile a bit
authored
66
Something went wrong with that request. Please try again.