]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ntp/ntpdc/Makefile.am
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / ntp / ntpdc / Makefile.am
1 NULL=
2
3 bin_PROGRAMS=   $(NTPDC_DB)
4 libexec_PROGRAMS=       $(NTPDC_DL)
5 sbin_PROGRAMS=  $(NTPDC_DS)
6
7 EXTRA_PROGRAMS= ntpdc ntpdc-layout
8 EXTRA_DATA=     check-layout
9 BUILT_SOURCES=  @MAKE_CHECK_LAYOUT@ ntpdc-opts.c ntpdc-opts.h
10
11 AM_CFLAGS = $(CFLAGS_NTP)
12
13 AM_CPPFLAGS  = $(NTP_INCS)
14 AM_CPPFLAGS += $(LIBOPTS_CFLAGS)
15 AM_CPPFLAGS += $(CPPFLAGS_NTP)
16
17 AM_LDFLAGS = $(LDFLAGS_NTP)
18
19 # LDADD might need RESLIB and ADJLIB
20 ntpdc_LDADD  = version.o $(LIBOPTS_LDADD)
21 ntpdc_LDADD += ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
22 ntpdc_LDADD += $(PTHREAD_LIBS) $(EDITLINE_LIBS)
23 ntpdc_LDADD += $(LDADD_NTP)
24 # ntpdc-layout doesn't need any additional libraries at all
25 ntpdc_layout_LDADD=
26
27 DISTCLEANFILES= .version version.c config.log $(man_MANS)
28 CLEANFILES=     check-layout layout.here nl.c ntpdc-layout
29 noinst_HEADERS= ntpdc.h
30 ETAGS_ARGS=     Makefile.am
31 EXTRA_DIST=                     \
32         invoke-ntpdc.menu       \
33         invoke-ntpdc.texi       \
34         layout.std              \
35         nl_in.c                 \
36         nl.pl                   \
37         ntpdc-opts.def          \
38         ntpdc.1ntpdcman         \
39         ntpdc.1ntpdcmdoc        \
40         ntpdc.man.in            \
41         ntpdc.mdoc.in           \
42         ntpdc.html              \
43         ntpdc.texi              \
44         $(NULL)
45
46 man1_MANS=
47 man8_MANS=
48 man_MANS=       ntpdc.$(NTPDC_MS)
49
50 ## HMS: Real Soon Now...
51 ##info_TEXINFOS=        ntpdc.texi
52 ##ntpdc_TEXINFOS=       ntpdc-opts.texi
53
54 html_DATA=                              \
55         $(srcdir)/ntpdc.html            \
56         $(NULL)
57
58 noinst_DATA=                            \
59         $(srcdir)/invoke-ntpdc.menu     \
60         $(srcdir)/invoke-ntpdc.texi     \
61         $(srcdir)/ntpdc.man.in          \
62         $(srcdir)/ntpdc.mdoc.in         \
63         $(NULL)
64
65 install-data-local: install-html
66
67 run_ag=         cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D  \
68                 autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
69
70 std_def_list =                                                  \
71         $(top_srcdir)/sntp/include/debug-opt.def                \
72         $(top_srcdir)/sntp/include/autogen-version.def          \
73         $(top_srcdir)/sntp/include/copyright.def                \
74         $(top_srcdir)/sntp/include/homerc.def                   \
75         $(top_srcdir)/sntp/include/ntp.lic                      \
76         $(top_srcdir)/sntp/include/version.def                  \
77         $(NULL)
78
79 $(srcdir)/ntpdc-opts.h: $(srcdir)/ntpdc-opts.c
80         @: do-nothing action to avoid default SCCS get, .h built with .c
81         
82 $(srcdir)/ntpdc-opts.c: $(srcdir)/ntpdc-opts.def $(std_def_list)
83         $(run_ag) ntpdc-opts.def
84
85 ###
86
87 $(srcdir)/ntpdc.1ntpdcman: $(srcdir)/ntpdc-opts.def $(std_def_list)
88         $(run_ag) -DMAN_SECTION=1ntpdcman -Tagman-cmd.tpl ntpdc-opts.def
89
90 $(srcdir)/ntpdc.man.in: $(srcdir)/ntpdc.1ntpdcman $(top_srcdir)/sntp/scripts/mansec2subst.sed
91         sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpdc.1ntpdcman > $(srcdir)/ntpdc.man.in+
92         mv $(srcdir)/ntpdc.man.in+ $(srcdir)/ntpdc.man.in
93
94 ###
95
96 $(srcdir)/ntpdc.1ntpdcmdoc: $(srcdir)/ntpdc-opts.def $(std_def_list)
97         $(run_ag) -DMAN_SECTION=1ntpdcmdoc -Tagmdoc-cmd.tpl ntpdc-opts.def
98
99 $(srcdir)/ntpdc.mdoc.in: $(srcdir)/ntpdc.1ntpdcmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
100         sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpdc.1ntpdcmdoc > $(srcdir)/ntpdc.mdoc.in+
101         mv $(srcdir)/ntpdc.mdoc.in+ $(srcdir)/ntpdc.mdoc.in
102
103 ###
104
105 ntpdc.$(NTPDC_MS): $(srcdir)/ntpdc.$(MANTAGFMT).in $(top_builddir)/config.status
106         $(top_builddir)/config.status --file=ntpdc.$(NTPDC_MS)+:$(srcdir)/ntpdc.$(MANTAGFMT).in
107         mv ntpdc.$(NTPDC_MS)+ ntpdc.$(NTPDC_MS)
108
109 ###
110
111 $(srcdir)/invoke-ntpdc.menu: $(srcdir)/invoke-ntpdc.texi
112         @: do-nothing action to avoid default SCCS get, .menu built with .texi
113         
114 $(srcdir)/invoke-ntpdc.texi: $(srcdir)/ntpdc-opts.def $(std_def_list)
115         $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpdc-opts.def
116         $(top_srcdir)/scripts/build/check--help $@
117
118 $(srcdir)/ntpdc.html: $(srcdir)/invoke-ntpdc.menu $(srcdir)/invoke-ntpdc.texi $(srcdir)/ntpdc.texi $(top_srcdir)/sntp/include/version.texi
119         cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntpdc.html ntpdc.texi || true )
120
121 ntpdc_SOURCES = ntpdc.c ntpdc_ops.c ntpdc-opts.c ntpdc-opts.h
122
123 ntpdc-layout.o: nl.c
124
125 layout.here: ntpdc-layout
126         ./ntpdc-layout > $@
127
128 check-layout: ntpdc-layout $(srcdir)/layout.std layout.here
129         cmp $(srcdir)/layout.std layout.here && echo stamp > $@
130
131 $(PROGRAMS): version.o
132
133 $(top_srcdir)/sntp/scm-rev:
134         cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev
135
136 version.c: $(ntpdc_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
137         env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdc
138         
139 version.o: version.c
140         env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
141
142 # I ran nl_in.c (attached, to be installed into ntpdc) through
143 # $(CC) -E nl_in.c | nl.pl > nl.c
144 nl.c: nl_in.c nl.pl Makefile.am ../config.h ../include/ntp_request.h ntpdc.h
145         $(CC) -E $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srcdir)/nl_in.c | ./nl.pl > nl.c
146
147 include $(top_srcdir)/bincheck.mf
148 include $(top_srcdir)/check-libopts.mf
149 include $(top_srcdir)/sntp/check-libntp.mf
150 include $(top_srcdir)/depsver.mf
151 include $(top_srcdir)/includes.mf