]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ntp/ntpdc/Makefile.am
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ntp / ntpdc / Makefile.am
1 AUTOMAKE_OPTIONS=       ../util/ansi2knr
2
3 bindir=         ${exec_prefix}/${BINSUBDIR}
4 bin_PROGRAMS=   ntpdc
5 EXTRA_PROGRAMS= ntpdc-layout
6 EXTRA_DATA=     check-layout
7 BUILT_SOURCES=  @MAKE_CHECK_LAYOUT@
8 AM_CPPFLAGS=    -I$(top_srcdir)/include $(LIBOPTS_CFLAGS)
9 # LDADD might need RESLIB and ADJLIB
10 ntpdc_LDADD=    version.o @READLINE_LIBS@ $(LIBOPTS_LDADD) ../libntp/libntp.a
11 # ntpdc-layout doesn't need any additional libraries at all
12 ntpdc_layout_LDADD=
13 DISTCLEANFILES= .version version.c
14 CLEANFILES=     check-layout layout.here nl.c ntpdc-layout
15 noinst_HEADERS= ntpdc.h
16 ETAGS_ARGS=     Makefile.am
17 EXTRA_DIST=     nl_in.c nl.pl layout.std        \
18                 ntpdc-opts.def ntpdc.1 ntpdc-opts.texi ntpdc-opts.menu
19 BUILT_SOURCES+= ntpdc-opts.c ntpdc-opts.h ntpdc.1 ntpdc-opts.texi       \
20                 ntpdc-opts.menu
21 man_MANS=       ntpdc.1
22 run_ag=         cd $(srcdir) && autogen -L ../include --writable
23 std_def_list=   $(top_srcdir)/include/debug-opt.def             \
24                 $(top_srcdir)/include/autogen-version.def       \
25                 $(top_srcdir)/include/copyright.def             \
26                 $(top_srcdir)/include/homerc.def                \
27                 $(top_srcdir)/include/version.def
28
29 $(srcdir)/ntpdc-opts.h: $(srcdir)/ntpdc-opts.c
30 $(srcdir)/ntpdc-opts.c: $(srcdir)/ntpdc-opts.def $(std_def_list)
31         $(run_ag) ntpdc-opts.def
32
33 $(srcdir)/ntpdc.1: $(srcdir)/ntpdc-opts.def $(std_def_list)
34         $(run_ag) -Tagman1.tpl -bntpdc ntpdc-opts.def
35
36 $(srcdir)/ntpdc-opts.texi $(srcdir)/ntpdc-opts.menu: $(srcdir)/ntpdc-opts.def $(std_def_list)
37         $(run_ag) -Taginfo.tpl -DLEVEL=section ntpdc-opts.def
38
39 ntpdc_SOURCES = ntpdc.c ntpdc_ops.c ntpdc-opts.c ntpdc-opts.h
40
41 ntpdc-layout.o: nl.c
42
43 layout.here: ntpdc-layout
44         ./ntpdc-layout > $@
45
46 check-layout: ntpdc-layout layout.std layout.here
47         cmp $(srcdir)/layout.std layout.here && echo stamp > $@
48
49 $(PROGRAMS): $(LDADD)
50
51 ../libntp/libntp.a:
52         cd ../libntp && $(MAKE)
53
54 $(top_srcdir)/version :
55         cd $(top_srcdir) && $(MAKE) version
56
57 version.o: $(ntpdc_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version
58         env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpdc
59         $(COMPILE) -c version.c
60
61 # I ran nl_in.c (attached, to be installed into ntpdc) through
62 # $(CC) -E nl_in.c | nl.pl > nl.c
63 nl.c: nl_in.c nl.pl Makefile.am
64         $(CC) -E $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srcdir)/nl_in.c | ./nl.pl > nl.c
65
66 include ../bincheck.mf