xref: /freebsd/contrib/ntp/ntpsnmpd/Makefile.am (revision f4b37ed0f8b307b1f3f0f630ca725d68f1dff30d)
1NULL=
2
3bin_PROGRAMS=	$(NTPSNMPD_DB)
4libexec_PROGRAMS=	$(NTPSNMPD_DL)
5sbin_PROGRAMS=	$(NTPSNMPD_DS)
6
7EXTRA_PROGRAMS=	ntpsnmpd
8ntpsnmpd_SOURCES= netsnmp_daemonize.c ntpsnmpd.c ntpSnmpSubagentObject.c \
9		ntpsnmpd-opts.c ntpsnmpd-opts.h ntpSnmpSubagentObject.h \
10		ntp_snmp.h
11# HMS: we probably want a version.o file here, too.
12LDADD  = ../ntpq/libntpq.a ../libntp/libntp.a
13LDADD += $(SNMP_LIBS) $(LDADD_LIBNTP) $(LIBM)
14LDADD += $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBOPTS_LDADD)
15
16AM_CFLAGS = $(SNMP_CFLAGS) $(CFLAGS_NTP)
17
18AM_CPPFLAGS  = -I$(top_srcdir)/ntpq
19AM_CPPFLAGS += $(NTP_INCS)
20AM_CPPFLAGS += $(LIBOPTS_CFLAGS)
21AM_CPPFLAGS += $(SNMP_CPPFLAGS)
22AM_CPPFLAGS += $(CPPFLAGS_NTP)
23
24AM_LDFLAGS = $(LDFLAGS_NTP)
25
26EXTRA_DIST=			\
27	invoke-ntpsnmpd.menu	\
28	invoke-ntpsnmpd.texi	\
29	ntpsnmpd-opts.def	\
30	ntpsnmpd.1ntpsnmpdman	\
31	ntpsnmpd.1ntpsnmpdmdoc	\
32	ntpsnmpd.man.in		\
33	ntpsnmpd.mdoc.in	\
34	ntpsnmpd.html		\
35	ntpsnmpd.texi		\
36	ntpv4-mib.mib		\
37	$(NULL)
38
39BUILT_SOURCES=	ntpsnmpd-opts.c ntpsnmpd-opts.h
40CLEANFILES=
41DISTCLEANFILES=	config.log $(man_MANS)
42
43html_DATA=				\
44	$(srcdir)/ntpsnmpd.html		\
45	$(NULL)
46
47noinst_DATA=				\
48	$(srcdir)/invoke-ntpsnmpd.menu	\
49	$(srcdir)/invoke-ntpsnmpd.texi	\
50	$(srcdir)/ntpsnmpd.man.in	\
51	$(srcdir)/ntpsnmpd.mdoc.in	\
52	$(NULL)
53
54install-data-local: install-html
55
56man1_MANS=
57man8_MANS=
58man_MANS=	ntpsnmpd.$(NTPSNMPD_MS)
59
60run_ag=		cd $(srcdir) &&	env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D	\
61		autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
62std_def_list =							\
63	$(top_srcdir)/sntp/include/debug-opt.def		\
64	$(top_srcdir)/sntp/include/autogen-version.def 		\
65	$(top_srcdir)/sntp/include/copyright.def 		\
66	$(top_srcdir)/sntp/include/homerc.def 			\
67	$(top_srcdir)/sntp/include/ntp.lic			\
68	$(top_srcdir)/sntp/include/version.def			\
69	$(NULL)
70
71$(srcdir)/ntpsnmpd-opts.h: $(srcdir)/ntpsnmpd-opts.c
72	@: do-nothing action to avoid default SCCS get, .h built with .c
73
74$(srcdir)/ntpsnmpd-opts.c: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
75	$(run_ag) ntpsnmpd-opts.def
76
77###
78
79$(srcdir)/ntpsnmpd.1ntpsnmpdman: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
80	$(run_ag) -DMAN_SECTION=1ntpsnmpdman -Tagman-cmd.tpl ntpsnmpd-opts.def
81
82$(srcdir)/ntpsnmpd.man.in: $(srcdir)/ntpsnmpd.1ntpsnmpdman $(top_srcdir)/sntp/scripts/mansec2subst.sed
83	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsnmpd.1ntpsnmpdman > $(srcdir)/ntpsnmpd.man.in+
84	mv $(srcdir)/ntpsnmpd.man.in+ $(srcdir)/ntpsnmpd.man.in
85
86###
87
88$(srcdir)/ntpsnmpd.1ntpsnmpdmdoc: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
89	$(run_ag) -DMAN_SECTION=1ntpsnmpdmdoc -Tagmdoc-cmd.tpl ntpsnmpd-opts.def
90
91$(srcdir)/ntpsnmpd.mdoc.in: $(srcdir)/ntpsnmpd.1ntpsnmpdmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
92	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsnmpd.1ntpsnmpdmdoc > $(srcdir)/ntpsnmpd.mdoc.in+
93	mv $(srcdir)/ntpsnmpd.mdoc.in+ $(srcdir)/ntpsnmpd.mdoc.in
94
95###
96
97ntpsnmpd.$(NTPSNMPD_MS): $(srcdir)/ntpsnmpd.$(MANTAGFMT).in $(top_builddir)/config.status
98	$(top_builddir)/config.status --file=ntpsnmpd.$(NTPSNMPD_MS)+:$(srcdir)/ntpsnmpd.$(MANTAGFMT).in
99	mv ntpsnmpd.$(NTPSNMPD_MS)+ ntpsnmpd.$(NTPSNMPD_MS)
100
101###
102
103$(srcdir)/invoke-ntpsnmpd.menu: $(srcdir)/invoke-ntpsnmpd.texi
104	@: do-nothing action to avoid default SCCS get, .menu built with .texi
105
106$(srcdir)/invoke-ntpsnmpd.texi: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
107	$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsnmpd-opts.def
108	$(top_srcdir)/scripts/build/check--help $@
109
110$(srcdir)/ntpsnmpd.html: $(srcdir)/ntpsnmpd.texi $(top_srcdir)/sntp/include/version.texi
111	cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpsnmpd.html ntpsnmpd.texi || true )
112
113include $(top_srcdir)/bincheck.mf
114include $(top_srcdir)/sntp/check-libntp.mf
115include $(top_srcdir)/check-libopts.mf
116include $(top_srcdir)/depsver.mf
117include $(top_srcdir)/includes.mf
118