282bfbfe813dbfd23192a86e4ab58e593d5340fa
[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 DESTDIR=@DESTDIR@
9 SRCDIR=@SRCDIR@
10 TOP_SRCDIR=@TOP_SRCDIR@
11 SYS_NAME=@AFS_SYSNAME@
12
13 SHELL = /bin/sh
14
15 include ../config/Makefile.${SYS_NAME}
16
17 INCPATH= -I${TOP_SRCDIR}/config -I${DESTDIR}include
18 BINDIR=/usr/local/etc
19 LINKDIR=/etc
20 LIBS= ${DESTDIR}lib/afs/util.a  
21
22 VERS=3.4
23
24 #CC=gcc -g -W -Wall
25 #afs#CC=cc -g -W
26
27 #afs#INSTALL= install -c
28
29 #
30 # FEATURES include:
31 #       DEBUG     - include DEBUG code
32 #       BROADCAST_NTP - experimental support for broadcast NTP
33 #       XADJTIME2 - experimental support for second-order clock adjustment
34 #                   system call.
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
46 #
47
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
53
54 # for afs
55 DEFINES= -DGENERIC_UNS_BUG -DSUN_FLT_BUG
56
57 # for 4.3 BSD
58 #afs#DEFINES=
59
60 # for Sun
61 #DEFINES= -DSUN_FLT_BUG
62
63 # for Ultrix 2.0/2.2
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
69
70 #
71 # for a NeXT system, define these pre-processor symbols.
72 #DEFINES=-DSUN_FLT_BUG -DGENERIC_UNS_BUG 
73
74 CFLAGS= -O ${DEFINES} ${FEATURES} ${INCPATH} ${XCFLAGS}
75 LDFLAGS= ${XLDFLAGS}
76 #
77 # Header files
78 #
79 HDRS=   ntp.h patchlevel.h
80
81 # Source files
82 #
83 NTPDSRC= ntpd.c ntpsubs.c ntp_proto.c ntp_sock.c ntp_adjust.c read_local.c \
84         read_psti.c
85 SRCS=   ntp.c ntpdc.c test.c ${NTPDSRC}
86
87 # Object files
88 #
89 NTPDOBJ= ntpd.o ntpsubs.o ntp_proto.o ntp_sock.o ntp_adjust.o read_local.o \
90         read_psti.o
91 OBJS=   ntp.o ntpdc.o test.o ${NTPDOBJ}
92
93
94 DIST= README Makefile man ${SRCS} ${HDRS} ntp.conf test.c extract.pl stat.pl
95 PROGS=  ntp ntpd ntpdc ntest
96
97 include ../config/Makefile.version
98
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
103
104 all:    ${PROGS} runntp
105         -@./ntest
106
107 ntp:    ntp.o ntpsubs.o
108         ${CC} ${LDFLAGS} -o ntp ntp.o ntpsubs.o ${LIBS} ${XLIBS} ${XLIBELFA}
109
110 ntpd:   ${NTPDOBJ}
111         case ${SYS_NAME} in \
112                 sgi_*) \
113                         ${CC} ${LDFLAGS} -o ntpd ${NTPDOBJ} ${LIBS} -lelf ;; \
114                 *) \
115                         ${CC} ${LDFLAGS} -o ntpd ${NTPDOBJ} ${LIBS} ${XLIBS} ${XLIBELFA} ;; \
116         esac
117
118
119 ntpdc: ntpdc.o
120         ${CC} ${LDFLAGS} -o ntpdc ntpdc.o ${LIBS} ${XLIBS} ${XLIBELFA}
121
122 ntest: test.o ntpsubs.o
123         ${CC} ${LDFLAGS} -o ntest test.o ntpsubs.o ${LIBS} ${XLIBS} ${XLIBELFA}
124         ./ntest
125
126 sock_test: ntp_sock.c AFS_component_version_number.o
127         ${CC} ${LDFLAGS} -DTEST -o sock_test ntp_sock.c ${LIBS} ${XLIBS} ${XLIBELFA}
128
129 ${OBJS}: ntp.h # Makefile
130 ntpd.o: patchlevel.h
131
132 # for afs
133
134 system: install
135
136 AFSLIBS= ${DESTDIR}lib/afs/libauth.a ${DESTDIR}lib/afs/libcom_err.a ${DESTDIR}lib/afs/util.a 
137
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}
140
141 runntp: runntp.o ${AFSLIBS}
142         ${CC} ${LDFLAGS} -o runntp runntp.o ${AFSLIBS} ${XLIBS}
143
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
150
151 #
152 # If you don't want a symlink to the daemon, comment out the next line
153 #       make ${MFLAGS} DESTDIR=${DESTDIR} install-link
154
155 install-man:
156         cd man; $(MAKE) ${MFLAGS} DESTDIR=${DESTDIR} install
157
158 install-link:
159         rm -f ${BINDIR}/${LINKDIR}/ntpd
160         ln -s ${BINDIR}/ntpd ${DESTDIR}/${LINKDIR}/ntpd
161
162 print:
163         enscript -2r -p - Makefile ${HDRS} ${SRCS} | qpr -q lps40
164
165 clean:
166         @rm -f *.o *~ core ${PROGS} ntp.tar ntest sock_test AFS_component_version_number.c
167
168 lint:
169         lint -bac ${DEFINES} ${NTPDSRC}
170
171 dist:   ntp.tar.Z
172         mv ntp.tar.Z /usr/ftp/pub/ntp.${VERS}/ntp.tar.Z
173
174 test-dist:      ntp.tar.Z
175         mv ntp.tar.Z /usr/ftp/pub/ntp.${VERS}/ntp-test.tar.Z
176
177 ntp.tar.Z:      ${DIST}
178         rm -f ntp.tar ntp.tar.Z
179         tar cf ntp.tar ${DIST}
180         compress  ntp.tar
181
182
183 depend:
184         mkdep $(CFLAGS) $(SRCS)
185
186 # DO NOT DELETE THIS LINE -- mkdep uses it.
187 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
188 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY