1 # Copyright 2000, International Business Machines Corporation and others.
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
9 TOP_INCDIR=@TOP_INCDIR@
10 TOP_LIBDIR=@TOP_LIBDIR@
12 exec_prefix=@exec_prefix@
15 libexecdir=@libexecdir@
17 includedir=@includedir@
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@
29 include ../config/Makefile.${SYS_NAME}
31 INCPATH=-I${TOP_SRCDIR}/config -I${TOP_INCDIR}
34 LIBS=${TOP_LIBDIR}/util.a
41 #afs#INSTALL= install -c
45 # DEBUG - include DEBUG code
46 # BROADCAST_NTP - experimental support for broadcast NTP
47 # XADJTIME2 - experimental support for second-order clock adjustment
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
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
69 DEFINES= -DGENERIC_UNS_BUG -DSUN_FLT_BUG
75 #DEFINES= -DSUN_FLT_BUG
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
85 # for a NeXT system, define these pre-processor symbols.
86 #DEFINES=-DSUN_FLT_BUG -DGENERIC_UNS_BUG
88 CFLAGS= -O ${DEFINES} ${FEATURES} ${INCPATH} ${XCFLAGS}
93 HDRS= ntp.h patchlevel.h
97 NTPDSRC= ntpd.c ntpsubs.c ntp_proto.c ntp_sock.c ntp_adjust.c read_local.c \
99 SRCS= ntp.c ntpdc.c test.c ${NTPDSRC}
103 NTPDOBJ= ntpd.o ntpsubs.o ntp_proto.o ntp_sock.o ntp_adjust.o read_local.o \
105 OBJS= ntp.o ntpdc.o test.o ${NTPDOBJ}
108 DIST= README Makefile man ${SRCS} ${HDRS} ntp.conf test.c extract.pl stat.pl
109 PROGS= ntp ntpd ntpdc ntest
111 include ../config/Makefile.version
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
118 #all: ${PROGS} runntp
122 ${CC} ${LDFLAGS} -o ntp ntp.o ntpsubs.o ${LIBS} ${XLIBS} ${XLIBELFA}
125 case ${SYS_NAME} in \
127 ${CC} ${LDFLAGS} -o ntpd ${NTPDOBJ} ${LIBS} -lelf ;; \
129 ${CC} ${LDFLAGS} -o ntpd ${NTPDOBJ} ${LIBS} ${XLIBS} ${XLIBELFA} ;; \
134 ${CC} ${LDFLAGS} -o ntpdc ntpdc.o ${LIBS} ${XLIBS} ${XLIBELFA}
136 ntest: test.o ntpsubs.o
137 ${CC} ${LDFLAGS} -o ntest test.o ntpsubs.o ${LIBS} ${XLIBS} ${XLIBELFA}
140 sock_test: ntp_sock.c AFS_component_version_number.o
141 ${CC} ${LDFLAGS} -DTEST -o sock_test ntp_sock.c ${LIBS} ${XLIBS} ${XLIBELFA}
143 ${OBJS}: ntp.h # Makefile
148 all: AFS_component_version_number.c ntest ntpd ntp ntpdc runntp
150 AFSLIBS=${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/util.a
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}
155 runntp: runntp.o ${AFSLIBS}
156 ${CC} ${LDFLAGS} -o runntp runntp.o ${AFSLIBS} ${XLIBS}
158 install: ${DESTDIR}${afssrvlibexecdir}/ntpd ${DESTDIR}${afssrvsbindir}/ntpdc ${DESTDIR}${sbindir}/ntp ${DESTDIR}${sbindir}/ntpdc ${DESTDIR}${afssrvlibexecdir}/runntp
161 # If you don't want a symlink to the daemon, comment out the next line
162 # make ${MFLAGS} DESTDIR=${DESTDIR} install-link
165 cd man; $(MAKE) ${MFLAGS} DESTDIR=${DESTDIR} install
168 $(RM) -f ${BINDIR}/${LINKDIR}/ntpd
169 ln -s ${BINDIR}/ntpd ${DESTDIR}/${LINKDIR}/ntpd
172 enscript -2r -p - Makefile ${HDRS} ${SRCS} | qpr -q lps40
175 @rm -f *.o *~ core ${PROGS} ntp.tar ntest sock_test AFS_component_version_number.c
178 mv ntp.tar.Z /usr/ftp/pub/ntp.${VERS}/ntp.tar.Z
181 mv ntp.tar.Z /usr/ftp/pub/ntp.${VERS}/ntp-test.tar.Z
184 $(RM) -f ntp.tar ntp.tar.Z
185 tar cf ntp.tar ${DIST}
190 mkdep $(CFLAGS) $(SRCS)
192 ${DEST}/root.server/usr/afs/bin/ntpd: ntpd
195 ${DESTDIR}${afssrvlibexecdir}/ntpd: ntpd
199 ${DEST}/root.server/usr/afs/bin/ntpdc: ntpdc
202 ${DESTDIR}${afssrvsbindir}/ntpdc: ntpdc
209 ${DESTDIR}${sbindir}/ntp: ntp
213 ${DEST}/etc/ntpdc: ntpdc
216 ${DESTDIR}${sbindir}/ntpdc: ntpdc
220 ${DEST}/root.server/usr/afs/bin/runntp: runntp
223 ${DESTDIR}${afssrvlibexecdir}/runntp: runntp
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
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