forked from marinosi/fetch_c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (58 loc) · 1.38 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
# $FreeBSD: stable/9/usr.bin/fetch/Makefile 242609 2012-11-05 12:41:55Z des $
.include <bsd.own.mk>
CC= clang
PROG= fetch
SRCS= fetch.c fetch_sandbox.c
CSTD?= c99
.ifdef DEBUG
CFLAGS+= -DDEBUG -g
.else
CFLAGS+= -DNDEBUG
.endif
# error checking
.if defined(NO_SANDBOX) && (defined(SANDBOX_FETCH)
|| defined(SANDBOX_PARSE_URL)
|| defined(SANDBOX_EPHEMERAL))
.error Sandboxing options should not be specified if NO_SANDBOX is present
.endif
.if defined(SANDBOX_FETCH) && defined(SANDBOX_PARSE_URL)
.error Both SANDBOX_FETCH and SANDBOX_PARSE_URL cannot be specified currently
.endif
.if ${MK_OPENSSL} != "no"
DPADD= ${LIBFETCH} ${LIBSSL} ${LIBCRYPTO}
LDADD= -lfetch -lssl -lcrypto
.else
DPADD= ${LIBFETCH} ${LIBMD}
LDADD= -lfetch -lmd
.endif
LIBFETCH_DIR?= ../libfetch_c
LIBSEP_DIR?= ../libsep
.ifndef NO_SANDBOX
CFLAGS+= -I ${LIBSEP_DIR} -I ${LIBFETCH_DIR}
.ifdef SANDBOX_PARSE_URL
CFLAGS+= -DSANDBOX_PARSE_URL
.endif
.ifdef SANDBOX_FETCH
CFLAGS+= -DSANDBOX_FETCH
.endif
.ifdef SANDBOX_EPHEMERAL
CFLAGS+= -DSANDBOX_EPHEMERAL
.endif
DPADD+= ${LIBSEP_DIR}
LDADD+= -L${LIBSEP_DIR} -lsep
.else
CFLAGS+= -DNO_SANDBOX
.endif
.include <bsd.prog.mk>
sandbox_fetch:
.ifdef DEBUG
make -DSANDBOX_FETCH -DDEBUG
.else
make -DSANDBOX_FETCH
.endif
sandbox_parse:
.ifdef DEBUG
make -DSANDBOX_PARSE_URL -DDEBUG
.else
make -DSANDBOX_PARSE_URL
.endif