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