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
10 TOP_SRCDIR=@TOP_SRCDIR@
11 SYS_NAME=@AFS_SYSNAME@
15 include ../config/Makefile.${SYS_NAME}
17 INCPATH= -I${TOP_SRCDIR}/config -I${DESTDIR}/include
20 LIBS= ${DESTDIR}/lib/afs/util.a
27 #afs#INSTALL= install -c
31 # DEBUG - include DEBUG code
32 # BROADCAST_NTP - experimental support for broadcast NTP
33 # XADJTIME2 - experimental support for second-order clock adjustment
35 # SETTICKADJ - attempt to modify kernel's `tickadj' variable at run time.
36 # REFCLOCK - define if you have a reference clock attached to your
37 # machine. (untested by UMD)
38 # PSTI - define along with REFCLOCK if you have a PSTI clock attached
39 # that you'd like to use a a reference clock.
40 # XTAL=0 - for line freq clock, or
41 # XTAL=1 for crystal controlled clock (default)
42 # LOG_NTP=foo - to change the syslog facility. You could specify
43 # something like -DLOG_NTP=LOG_LOCAL3 to log into the
44 # LOG_LOCAL3 syslog facility
45 # NOSWAP - allow use of plock() to prevent swapping
48 #FEATURES= -DBROADCAST_NTP -DSETTICKADJ -DDEBUG
49 #FEATURES= -DSETTICKADJ -DDEBUG -DREFCLOCK -DPSTI
50 #afs#FEATURES= -DSETTICKADJ -DDEBUG -DREFCLOCK
51 #afs# # SETTICKADJ is set in ntpd.c on SUNs.
52 FEATURES= -DDEBUG -DREFCLOCK
55 DEFINES= -DGENERIC_UNS_BUG -DSUN_FLT_BUG
61 #DEFINES= -DSUN_FLT_BUG
64 # don't forget to fix the broken definition of inet_addr in netdb.h
65 # it should be declared as a u_long not a in_addr (the doc is wrong also)
66 # VAX_COMPILER_FLT_BUG is defined for pcc which doesn't know how to
67 # convert an unsigned long into a float/double
68 #DEFINES= -DVAX_COMPILER_FLT_BUG -DNOSWAP
71 # for a NeXT system, define these pre-processor symbols.
72 #DEFINES=-DSUN_FLT_BUG -DGENERIC_UNS_BUG
74 CFLAGS= -O ${DEFINES} ${FEATURES} ${INCPATH} ${XCFLAGS}
79 HDRS= ntp.h patchlevel.h
83 NTPDSRC= ntpd.c ntpsubs.c ntp_proto.c ntp_sock.c ntp_adjust.c read_local.c \
85 SRCS= ntp.c ntpdc.c test.c ${NTPDSRC}
89 NTPDOBJ= ntpd.o ntpsubs.o ntp_proto.o ntp_sock.o ntp_adjust.o read_local.o \
91 OBJS= ntp.o ntpdc.o test.o ${NTPDOBJ}
94 DIST= README Makefile man ${SRCS} ${HDRS} ntp.conf test.c extract.pl stat.pl
95 PROGS= ntp ntpd ntpdc ntest
97 include ../config/Makefile.version
99 ntp.o: AFS_component_version_number.c
100 ntpd.o: AFS_component_version_number.c
101 ntpdc.o: AFS_component_version_number.c
102 read_psti.o: AFS_component_version_number.c
108 ${CC} ${LDFLAGS} -o ntp ntp.o ntpsubs.o ${LIBS} ${XLIBS} ${XLIBELFA}
111 case ${SYS_NAME} in \
113 ${CC} ${LDFLAGS} -o ntpd ${NTPDOBJ} ${LIBS} -lelf ;; \
115 ${CC} ${LDFLAGS} -o ntpd ${NTPDOBJ} ${LIBS} ${XLIBS} ${XLIBELFA} ;; \
120 ${CC} ${LDFLAGS} -o ntpdc ntpdc.o ${LIBS} ${XLIBS} ${XLIBELFA}
122 ntest: test.o ntpsubs.o
123 ${CC} ${LDFLAGS} -o ntest test.o ntpsubs.o ${LIBS} ${XLIBS} ${XLIBELFA}
126 sock_test: ntp_sock.c AFS_component_version_number.o
127 ${CC} ${LDFLAGS} -DTEST -o sock_test ntp_sock.c ${LIBS} ${XLIBS} ${XLIBELFA}
129 ${OBJS}: ntp.h # Makefile
136 AFSLIBS= ${DESTDIR}/lib/afs/libauth.a ${DESTDIR}/lib/afs/libcom_err.a ${DESTDIR}/lib/afs/util.a
138 runntp.o: runntp.c ${DESTDIR}/include/afs/cellconfig.h AFS_component_version_number.c
139 ${CC} ${CFLAGS} -I${DESTDIR}/include -c runntp.c ${AFSLIBS} ${XLIBS}
141 runntp: runntp.o ${AFSLIBS}
142 ${CC} ${LDFLAGS} -o runntp runntp.o ${AFSLIBS} ${XLIBS}
144 install: AFS_component_version_number.c ntest ntpd ntp ntpdc runntp
145 ${INSTALL} ntpd ${DESTDIR}/root.server/usr/afs/bin/ntpd
146 ${INSTALL} ntpdc ${DESTDIR}/root.server/usr/afs/bin/ntpdc
147 ${INSTALL} ntp ${DESTDIR}/etc/ntp
148 ${INSTALL} ntpdc ${DESTDIR}/etc/ntpdc
149 ${INSTALL} runntp ${DESTDIR}/root.server/usr/afs/bin/runntp
152 # If you don't want a symlink to the daemon, comment out the next line
153 # make ${MFLAGS} DESTDIR=${DESTDIR} install-link
156 cd man; $(MAKE) ${MFLAGS} DESTDIR=${DESTDIR} install
159 $(RM) -f ${BINDIR}/${LINKDIR}/ntpd
160 ln -s ${BINDIR}/ntpd ${DESTDIR}/${LINKDIR}/ntpd
163 enscript -2r -p - Makefile ${HDRS} ${SRCS} | qpr -q lps40
166 @rm -f *.o *~ core ${PROGS} ntp.tar ntest sock_test AFS_component_version_number.c
169 mv ntp.tar.Z /usr/ftp/pub/ntp.${VERS}/ntp.tar.Z
172 mv ntp.tar.Z /usr/ftp/pub/ntp.${VERS}/ntp-test.tar.Z
175 $(RM) -f ntp.tar ntp.tar.Z
176 tar cf ntp.tar ${DIST}
181 mkdep $(CFLAGS) $(SRCS)
183 # DO NOT DELETE THIS LINE -- mkdep uses it.
184 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
185 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY