forked from AnimaGUS-minerva/unstrung
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.inc
93 lines (72 loc) · 2.19 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
# -*- makefile -*-
-include ${UNSTRUNG_SRCDIR}/Makefile.local
default:: programs
ARCH?=$(shell uname -m)
# 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 -O
#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
CFLAGS+= -DGRASP_CLIENT
CXXFLAGS+= -DGRASP_CLIENT
CFLAGS+= ${MBEDTLSH}
CXXFLAGS+= ${MBEDTLSH}
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
LIBFAKEIFACE=${UNSTRUNG_OBJDIR}/lib/libfakeiface/libfakeiface.a
LIBGRASP=${UNSTRUNG_OBJDIR}/lib/libgrasp/libgrasp.a
LIBPCAP?=-lpcap $(pcap-config --libs --static)
LIBPCAP_HOST?=-lpcap
LIBCBOR=${CBOR_LIB}
LIBMBEDTLS=${MBEDTLSLIB}/libmbedtls.a ${MBEDTLSLIB}/libmbedcrypto.a
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