make-install-support-for-transarc-and-prefix-style-universes-20010907
[openafs.git] / src / ntp / Makefile.in
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3
4 # This software has been released under the terms of the IBM Public
5 # License.  For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7
8 DEST=@DEST@
9 TOP_INCDIR=@TOP_INCDIR@
10 TOP_LIBDIR=@TOP_LIBDIR@
11 prefix=@prefix@
12 exec_prefix=@exec_prefix@
13 bindir=@bindir@
14 sbindir=@sbindir@
15 libexecdir=@libexecdir@
16 libdir=@libdir@
17 includedir=@includedir@
18 mandir=@mandir@
19 afssrvbindir=@afssrvbindir@
20 afssrvsbindir=@afssrvsbindir@
21 afssrvlibexecdir=@afssrvlibexecdir@
22 COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
23 RXGEN=${TOP_SRCDIR}/rxgen/rxgen
24 TOP_SRCDIR=@TOP_SRCDIR@
25 SYS_NAME=@AFS_SYSNAME@
26
27 SHELL = /bin/sh
28
29 include ../config/Makefile.${SYS_NAME}
30
31 INCPATH=-I${TOP_SRCDIR}/config -I${TOP_INCDIR}
32 BINDIR=/usr/local/etc
33 LINKDIR=/etc
34 LIBS=${TOP_LIBDIR}/util.a
35
36 VERS=3.4
37
38 #CC=gcc -g -W -Wall
39 #afs#CC=cc -g -W
40
41 #afs#INSTALL= install -c
42
43 #
44 # FEATURES include:
45 #       DEBUG     - include DEBUG code
46 #       BROADCAST_NTP - experimental support for broadcast NTP
47 #       XADJTIME2 - experimental support for second-order clock adjustment
48 #                   system call.
49 #       SETTICKADJ - attempt to modify kernel's `tickadj' variable at run time.
50 #       REFCLOCK  - define if you have a reference clock attached to your
51 #                   machine.  (untested by UMD)
52 #       PSTI - define along with REFCLOCK if you have a PSTI clock attached
53 #               that you'd like to use a a reference clock.
54 #       XTAL=0 - for line freq clock, or
55 #       XTAL=1   for crystal controlled clock (default)
56 #       LOG_NTP=foo - to change the syslog facility.  You could specify
57 #                   something like -DLOG_NTP=LOG_LOCAL3 to log into the
58 #                   LOG_LOCAL3 syslog facility
59 #       NOSWAP - allow use of plock() to prevent swapping
60 #
61
62 #FEATURES= -DBROADCAST_NTP -DSETTICKADJ -DDEBUG
63 #FEATURES= -DSETTICKADJ -DDEBUG -DREFCLOCK -DPSTI
64 #afs#FEATURES= -DSETTICKADJ -DDEBUG -DREFCLOCK
65 #afs# # SETTICKADJ is set in ntpd.c on SUNs.
66 FEATURES= -DDEBUG -DREFCLOCK
67
68 # for afs
69 DEFINES= -DGENERIC_UNS_BUG -DSUN_FLT_BUG
70
71 # for 4.3 BSD
72 #afs#DEFINES=
73
74 # for Sun
75 #DEFINES= -DSUN_FLT_BUG
76
77 # for Ultrix 2.0/2.2
78 # don't forget to fix the broken definition of inet_addr in netdb.h
79 # it should be declared as a u_long not a in_addr  (the doc is wrong also)
80 # VAX_COMPILER_FLT_BUG is defined for pcc which doesn't know how to 
81 # convert an unsigned long into a float/double
82 #DEFINES= -DVAX_COMPILER_FLT_BUG -DNOSWAP
83
84 #
85 # for a NeXT system, define these pre-processor symbols.
86 #DEFINES=-DSUN_FLT_BUG -DGENERIC_UNS_BUG 
87
88 CFLAGS= -O ${DEFINES} ${FEATURES} ${INCPATH} ${XCFLAGS}
89 LDFLAGS= ${XLDFLAGS}
90 #
91 # Header files
92 #
93 HDRS=   ntp.h patchlevel.h
94
95 # Source files
96 #
97 NTPDSRC= ntpd.c ntpsubs.c ntp_proto.c ntp_sock.c ntp_adjust.c read_local.c \
98         read_psti.c
99 SRCS=   ntp.c ntpdc.c test.c ${NTPDSRC}
100
101 # Object files
102 #
103 NTPDOBJ= ntpd.o ntpsubs.o ntp_proto.o ntp_sock.o ntp_adjust.o read_local.o \
104         read_psti.o
105 OBJS=   ntp.o ntpdc.o test.o ${NTPDOBJ}
106
107
108 DIST= README Makefile man ${SRCS} ${HDRS} ntp.conf test.c extract.pl stat.pl
109 PROGS=  ntp ntpd ntpdc ntest
110
111 include ../config/Makefile.version
112
113 ntp.o: AFS_component_version_number.c
114 ntpd.o: AFS_component_version_number.c
115 ntpdc.o: AFS_component_version_number.c
116 read_psti.o: AFS_component_version_number.c
117
118 #all:   ${PROGS} runntp
119 #       -@./ntest
120
121 ntp:    ntp.o ntpsubs.o
122         ${CC} ${LDFLAGS} -o ntp ntp.o ntpsubs.o ${LIBS} ${XLIBS} ${XLIBELFA}
123
124 ntpd:   ${NTPDOBJ}
125         case ${SYS_NAME} in \
126                 sgi_*) \
127                         ${CC} ${LDFLAGS} -o ntpd ${NTPDOBJ} ${LIBS} -lelf ;; \
128                 *) \
129                         ${CC} ${LDFLAGS} -o ntpd ${NTPDOBJ} ${LIBS} ${XLIBS} ${XLIBELFA} ;; \
130         esac
131
132
133 ntpdc: ntpdc.o
134         ${CC} ${LDFLAGS} -o ntpdc ntpdc.o ${LIBS} ${XLIBS} ${XLIBELFA}
135
136 ntest: test.o ntpsubs.o
137         ${CC} ${LDFLAGS} -o ntest test.o ntpsubs.o ${LIBS} ${XLIBS} ${XLIBELFA}
138         ./ntest
139
140 sock_test: ntp_sock.c AFS_component_version_number.o
141         ${CC} ${LDFLAGS} -DTEST -o sock_test ntp_sock.c ${LIBS} ${XLIBS} ${XLIBELFA}
142
143 ${OBJS}: ntp.h # Makefile
144 ntpd.o: patchlevel.h
145
146 # for afs
147
148 all: AFS_component_version_number.c ntest ntpd ntp ntpdc runntp
149
150 AFSLIBS=${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/util.a
151
152 runntp.o: runntp.c ${TOP_INCDIR}/afs/cellconfig.h AFS_component_version_number.c
153         ${CC} ${CFLAGS} -I${TOP_INCDIR} -c runntp.c ${AFSLIBS} ${XLIBS}
154
155 runntp: runntp.o ${AFSLIBS}
156         ${CC} ${LDFLAGS} -o runntp runntp.o ${AFSLIBS} ${XLIBS}
157
158 install:       ${DESTDIR}${afssrvlibexecdir}/ntpd ${DESTDIR}${afssrvsbindir}/ntpdc ${DESTDIR}${sbindir}/ntp ${DESTDIR}${sbindir}/ntpdc ${DESTDIR}${afssrvlibexecdir}/runntp
159
160 #
161 # If you don't want a symlink to the daemon, comment out the next line
162 #       make ${MFLAGS} DESTDIR=${DESTDIR} install-link
163
164 install-man:
165         cd man; $(MAKE) ${MFLAGS} DESTDIR=${DESTDIR} install
166
167 install-link:
168         $(RM) -f ${BINDIR}/${LINKDIR}/ntpd
169         ln -s ${BINDIR}/ntpd ${DESTDIR}/${LINKDIR}/ntpd
170
171 print:
172         enscript -2r -p - Makefile ${HDRS} ${SRCS} | qpr -q lps40
173
174 clean:
175         @rm -f *.o *~ core ${PROGS} ntp.tar ntest sock_test AFS_component_version_number.c
176
177 dist:   ntp.tar.Z
178         mv ntp.tar.Z /usr/ftp/pub/ntp.${VERS}/ntp.tar.Z
179
180 test-dist:      ntp.tar.Z
181         mv ntp.tar.Z /usr/ftp/pub/ntp.${VERS}/ntp-test.tar.Z
182
183 ntp.tar.Z:      ${DIST}
184         $(RM) -f ntp.tar ntp.tar.Z
185         tar cf ntp.tar ${DIST}
186         compress  ntp.tar
187
188
189 depend:
190         mkdep $(CFLAGS) $(SRCS)
191
192 ${DEST}/root.server/usr/afs/bin/ntpd: ntpd
193         ${INSTALL} $? $@
194
195 ${DESTDIR}${afssrvlibexecdir}/ntpd: ntpd
196         ${INSTALL} $? $@
197
198
199 ${DEST}/root.server/usr/afs/bin/ntpdc: ntpdc
200         ${INSTALL} $? $@
201
202 ${DESTDIR}${afssrvsbindir}/ntpdc: ntpdc
203         ${INSTALL} $? $@
204
205
206 ${DEST}/etc/ntp: ntp
207         ${INSTALL} $? $@
208
209 ${DESTDIR}${sbindir}/ntp: ntp
210         ${INSTALL} $? $@
211
212
213 ${DEST}/etc/ntpdc: ntpdc
214         ${INSTALL} $? $@
215
216 ${DESTDIR}${sbindir}/ntpdc: ntpdc
217         ${INSTALL} $? $@
218
219
220 ${DEST}/root.server/usr/afs/bin/runntp: runntp
221         ${INSTALL} $? $@
222
223 ${DESTDIR}${afssrvlibexecdir}/runntp: runntp
224         ${INSTALL} $? $@
225
226
227 dest:       ${DEST}/root.server/usr/afs/bin/ntpd ${DEST}/root.server/usr/afs/bin/ntpdc ${DEST}/etc/ntp ${DEST}/etc/ntpdc ${DEST}/root.server/usr/afs/bin/runntp
228
229 # DO NOT DELETE THIS LINE -- mkdep uses it.
230 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
231 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY