1 AM_CFLAGS = -I $(top_srcdir)/include $(LLDP_CFLAGS)
2 AM_CPPFLAGS = $(LLDP_CPPFLAGS)
3 AM_LDFLAGS = $(LLDP_LDFLAGS)
10 noinst_LTLIBRARIES = liblldpd.la
12 ## Convenience library for lldpd and tests
13 nodist_liblldpd_la_SOURCES =
14 liblldpd_la_SOURCES = \
19 privsep.c privsep_io.c privsep_fd.c \
32 liblldpd_la_CFLAGS = $(AM_CFLAGS) @libevent_CFLAGS@ @libcap_CFLAGS@
33 liblldpd_la_CPPFLAGS = $(AM_CPPFLAGS) -DSYSCONFDIR='"$(sysconfdir)"' -DLLDPCLI_PATH='"$(sbindir)/lldpcli"'
34 liblldpd_la_LIBADD = \
35 $(top_builddir)/src/libcommon-daemon-client.la \
36 $(top_builddir)/src/libcommon-daemon-lib.la @libevent_LIBS@ @libcap_LIBS@
39 lldpd_SOURCES = main.c
40 lldpd_LDFLAGS = $(AM_LDFLAGS) $(LLDP_BIN_LDFLAGS)
41 lldpd_LDADD = liblldpd.la @libevent_LDFLAGS@
44 liblldpd_la_SOURCES += \
52 liblldpd_la_SOURCES += \
60 liblldpd_la_SOURCES += \
68 liblldpd_la_SOURCES += \
76 liblldpd_la_SOURCES += \
84 liblldpd_la_SOURCES += \
90 liblldpd_la_LDFLAGS = $(AM_LDFLAGS)
91 liblldpd_la_LDFLAGS += -framework Foundation
92 liblldpd_la_LDFLAGS += -framework CoreFoundation -framework IOKit
93 liblldpd_la_LDFLAGS += -framework IOKit
96 liblldpd_la_SOURCES += \
99 interfaces-solaris.c \
106 BUILT_SOURCES += syscall-names.h
107 CLEANFILES += syscall-names.h syscall-names.h.tmp
110 $(AM_V_at)echo "#include <sys/syscall.h>" | $(CPP) -dM - > $@.tmp ;\
111 echo "static const char *syscall_names[] = {" > $@ ;\
112 grep '^#define __NR_' $@.tmp | \
113 LC_ALL=C sed -r -n -e 's/^\#define[ \t]+__NR_([a-z0-9_]+)[ \t]+([0-9]+)(.*)/ [\2] = "\1",/p' >> $@ ;\
116 nodist_liblldpd_la_SOURCES += syscall-names.h
117 liblldpd_la_SOURCES += priv-seccomp.c
118 liblldpd_la_CFLAGS += @libseccomp_CFLAGS@
119 liblldpd_la_LIBADD += @libseccomp_LIBS@
122 # Add SNMP support if needed
124 noinst_LTLIBRARIES += liblldpd-snmp.la
125 liblldpd_snmp_la_SOURCES = agent.c agent_priv.c agent.h
126 liblldpd_snmp_la_CFLAGS = $(liblldpd_la_CFLAGS) @NETSNMP_CFLAGS@
127 liblldpd_snmp_la_CPPFLAGS = $(liblldpd_la_CPPFLAGS)
128 liblldpd_la_LIBADD += liblldpd-snmp.la
129 lldpd_LDADD += @NETSNMP_LIBS@
133 EXTRA_DIST = dtrace2systemtap.awk
135 BUILT_SOURCES += probes.h
136 CLEANFILES += probes.h lldpd.stp
139 $(AM_V_at)$(DTRACE) -C -h -s $< -o $@
142 $(AM_V_at)$(DTRACE) -C -G -s $< -o $@
143 lldpd_LDADD += probes.o
145 lldpd.stp: probes.d $(srcdir)/dtrace2systemtap.awk $(top_builddir)/config.status
146 $(AM_V_GEN)$(AWK) -f $(srcdir)/dtrace2systemtap.awk -v sbindir=$(sbindir) $< > $@ || ( rm -f $@ ; exit 1 )
147 tapsetdir = $(datadir)/systemtap/tapset
148 tapset_DATA = lldpd.stp
153 event.c: $(top_builddir)/libevent/libevent.la
154 $(top_builddir)/libevent/libevent.la: $(top_srcdir)/libevent/*.c $(top_srcdir)/libevent/*.h
155 (cd $(top_builddir)/libevent && $(MAKE))
158 ## systemd service file
159 if HAVE_SYSTEMDSYSTEMUNITDIR
160 systemdsystemunit_DATA = lldpd.service
164 sysusers_DATA = lldpd.sysusers.conf
169 apparmor_DATA = usr.sbin.lldpd
173 TEMPLATES = lldpd.8 lldpd.service lldpd.sysusers.conf usr.sbin.lldpd
174 EXTRA_DIST += lldpd.8.in lldpd.service.in lldpd.sysusers.conf.in usr.sbin.lldpd.in
175 CLEANFILES += $(TEMPLATES)
177 lldpd.service: lldpd.service.in
178 lldpd.sysusers.conf: lldpd.sysusers.conf.in
179 usr.sbin.lldpd: usr.sbin.lldpd.in
180 include $(top_srcdir)/edit.am