-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile.inc
106 lines (85 loc) · 2.47 KB
/
Makefile.inc
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# -*- makefile -*-
-include ${UNSTRUNG_SRCDIR}/Makefile.local
default:: programs
ARCH=$(shell uname -m)
GRASP_CLIENT?=false
USE_MBEDTLS?=false
# stuff to set... use -m32 by default because of UML testing, should remove this to elsewhere.
INC=${UNSTRUNG_SRCDIR}/include
#-I${UNSTRUNG_SRCDIR}/../tcpdump-4.6.0
CFLAGS+=-I${INC} -fno-show-column
CXXFLAGS+=-I${INC} -fno-show-column
USERLINK?=-g
USERCPPCOMPILE?=-g -O0
#ifeq ($(ARCH),x86_64)
#HOSTFLAGS=-m32
#endif
USE_OBJDIR?=false
XMLTO=xmlto
RONN=ronn
MANTREE=/usr/share/man
INSTALL=install
INSTMANFLAGS=-D
INSTBINFLAGS=-D
ifneq ($(EMBEDDED),)
CFLAGS+=-DEMBEDDED
CXXFLAGS+=-DEMBEDDED
endif
# no grasp for now.
ifeq ($(GRASP_CLIENT),true)
CFLAGS+= -DGRASP_CLIENT
CXXFLAGS+= -DGRASP_CLIENT
LIBGRASP=${UNSTRUNG_OBJDIR}/lib/libgrasp/libgrasp.a
endif
ifeq ($(USE_MBEDTLS),true)
CFLAGS+= ${MBEDTLSH} -DHAVE_MBEDTLS
CXXFLAGS+= ${MBEDTLSH} -DHAVE_MBEDTLS
LIBCRYPT=${MBEDTLSLIB}/libmbedtls.a
LIBCRYPT+=${MBEDTLSLIB}/libmbedcrypto.a
LIBCRYPT+=${MBEDTLSLIB}/libmbedx509.a
else
# no mbedtls
LIBCRYPT=
endif
CFLAGS+= ${CBOR_INCLUDE}
CXXFLAGS+= ${CBOR_INCLUDE}
ifeq ($(USE_OBJDIR),true)
OBJDIR?=OBJ.${ARCH}
else
OBJDIR=.
endif
OBJDIRTOP?=$(shell cd ${UNSTRUNG_SRCDIR} && mkdir -p ${OBJDIR}; cd ${OBJDIR} && pwd)
UNSTRUNG_OBJDIR?=${OBJDIRTOP}
export OBJDIRTOP
OSDEP=$(shell uname -s).${ARCH}
ifeq ($(ARCH),i386)
CROSSFLAGS?=-m32
endif
LIBNDMGMT=${UNSTRUNG_OBJDIR}/lib/libndmgmt/libndmgmt.a
LIBOSW=${UNSTRUNG_OBJDIR}/lib/libosw/libosw.a
LIBNETLINK=${UNSTRUNG_OBJDIR}/lib/libnetlink/libnetlinkstrung.a
LIBIDEVID=${UNSTRUNG_OBJDIR}/lib/libidevid/libidevid.a
LIBFAKEIFACE=${UNSTRUNG_OBJDIR}/lib/libfakeiface/libfakeiface.a
LIBPCAP?=$(shell pcap-config --libs --static)
LIBPCAP_HOST?=-lpcap
LIBCBOR=${CBOR_LIB}
TCPDUMP?=tcpdump
ifeq ($(EMBEDDED),)
# needed by fake interface library
EXTRALIBS:=${LIBPCAP} ${EXTRALIBPATHS} -lusb-1.0 -lpthread
endif
NETDISSECTLIB?=-L${UNSTRUNG_SRCDIR}/../amd64/tcpdump -lnetdissect
NETDISSECTH?=-DNETDISSECT -I${UNSTRUNG_SRCDIR}/../tcpdump
NEEDCHECK?=check
.PHONY: TAGS clean ${NEEDCHECK} programs checkprograms install
ifeq (${MAKEFILETOP},)
TAGS clean ${NEEDCHECK} programs checkprograms install::
@err=0; for d in $(SUBDIRS) ; \
do \
if $(MAKE) -C $$d UNSTRUNG_SRCDIR=${UNSTRUNG_SRCDIR} $@; then true; else err=$$(($$err + 1)); fi; \
done; exit $$err
endif
env::
@env | sed -e "s/'/'\\\\''/g" -e "s/\([^=]*\)=\(.*\)/\1='\2'/"
TAGS::
@if [ -n "${CXXSRCS}${SRCS}" ]; then etags --append -o ${UNSTRUNG_SRCDIR}/TAGS ${CXXSRCS} ${SRCS}; fi