introduce-autoconf-for-openafs-20010628
[openafs.git] / src / des / Makefile
1 #
2 # Copyright 1987 by the Massachusetts Institute of Technology.
3 #
4 # For copying and distribution information,
5 # please see the file <mit-cpyright.h>.
6 #
7 # Makefile for BSD DES library
8 #
9 # First define machine type, compiler, and object file suffix
10 # Could be for VAX or PC-DOS
11 #
12 # Some of these files are cross compiled on the vax for the pc8086,
13 # using the MIT LCS cross-compilation environment
14 # Others are always executed on the vax(host).
15 #
16 # A machine, e.g. Vax, pc8086, IBM experimental workstation, is 
17 # described in terms of defines for its word length
18 # (BITS32 or BITS16), byte ordering (LSBFIRST or MSBFIRST) and 
19 # operating system (BSDUNIX or CROSSMSDOS).
20 #
21 # Make sure these are properly defined for any new machine types.
22 # target machine for run-time code (may cross-compile),
23 # override as needed 
24
25 SHELL = /bin/sh
26 include ../config/Makefile.${SYS_NAME}
27
28 UKERNELDIR=../libuafs/
29 SRC     =.
30 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
31
32 UKSRCS=des.h mit-cpyright.h
33
34 K_INC   = ${SRCDIR}include
35 DBG     =
36 GPROF   =
37 # by default do not try to hide entry points
38 F_CC    = -c ${GPROF} ${DBG} ${XCFLAGS}
39 F_CPP   = -I${K_INC} -I. -I${TOP_SRCDIR}/config 
40 MK_STR  = "     \$${CC} -I\$${SRC} \$${F_CPP} \$${F_CC}" -I${TOP_SRCDIR}/config 
41 LDFLAGS = ${XLDFLAGS}
42
43 # dont use optimizer, since it pessimizes on uvax2,
44 # somehow -pg makes it faster.
45
46 TAGS    = /bin/ctags
47
48 DES_LIB  = libdes.a
49 DEP_LIBS = ${DES_LIB} ${NDES_LIB}
50 LIBS     = ${DEP_LIBS} ${XLIBS}
51 LLIB     = llib-ldes.ln
52
53 SRCHOST = \
54         ${SRC}/make_keyperm.c \
55         ${SRC}/make_ip.c \
56         ${SRC}/make_fp.c \
57         ${SRC}/make_p.c \
58         ${SRC}/make_s.c \
59         ${SRC}/make_s_table.c \
60         ${SRC}/make_p_table.c \
61         ${SRC}/make_odd.c \
62         ${SRC}/misc.c
63
64 OBJHOST = \
65         make_keyperm.o \
66         make_ip.o \
67         make_fp.o \
68         make_e.o \
69         make_p.o \
70         make_s.o \
71         make_s_table.o \
72         make_p_table.o \
73         make_odd.o \
74         misc.o
75
76 SRCTARG = \
77         ${SRC}/key_sched.c \
78         ${SRC}/des.c \
79         ${SRC}/cbc_encrypt.c \
80         ${SRC}/read_pssword.c \
81         ${SRC}/pcbc_encrypt.c \
82         ${SRC}/cksum.c \
83         ${SRC}/quad_cksum.c \
84         ${SRC}/new_rnd_key.c \
85         ${SRC}/key_parity.c \
86         ${SRC}/weak_key.c \
87         ${SRC}/util.c \
88         ${SRC}/strng_to_key.c \
89         ${SRC}/debug_decl.c
90
91 OBJTARG = \
92         key_sched.o \
93         des.o \
94         cbc_encrypt.o \
95         read_pssword.o \
96         pcbc_encrypt.o \
97         cksum.o \
98         quad_cksum.o \
99         key_parity.o \
100         weak_key.o \
101         new_rnd_key.o \
102         util.o \
103         strng_to_key.o \
104         debug_decl.o
105
106 CFILES  = ${SRCHOST} ${SRCTARG}
107 OBJECTS = ${OBJHOST} ${OBJTARG}
108
109 CODE    = ${CFILES} ${SRC}/Makefile
110
111 # Generated files
112 GFILES  = \
113         key_perm.h \
114         p_table.h \
115         s_table.h \
116         odd.h \
117         p.c \
118         s.c \
119         fp.c \
120         ip.c
121
122 # Programs to create generated files
123 GPROGS  = \
124         make_keyperm \
125         make_p_table \
126         make_s_table \
127         make_odd \
128         make_p \
129         make_s \
130         make_fp \
131         make_ip
132
133 XGPROGS = \
134         misc \
135         make_e
136
137 # Library component lists.
138
139 TARGOBJS = \
140         des.o \
141         cbc_encrypt.o \
142         pcbc_encrypt.o \
143         cksum.o \
144         new_rnd_key.o \
145         key_sched.o \
146         debug_decl.o \
147         quad_cksum.o \
148         key_parity.o \
149         weak_key.o \
150         read_pssword.o \
151         strng_to_key.o \
152         misco.o \
153         ${CRYPT_OBJ} \
154         util.o
155
156 COMPONENT=des
157 include ../config/Makefile.version
158
159 # This is required to get compiler flags, but not use CFLAGS.
160 AFS_component_version_number.o: AFS_component_version_number.c
161         $(CC) ${XCFLAGS} -c AFS_component_version_number.c
162
163 noversion: install
164
165 all:    ${GFILES} ${CFILES} ${DEP_LIBS}
166
167 gprogs: ${GPROGS}
168
169 test: 
170         cd test; $(MAKE)
171
172 system: install
173
174 kinstall:
175         @echo No $@ source here.
176
177 ukinstall webinstall: all ${UKSRCS}
178         set ${UKERNELDIR}des; $(MKDIR_IF_NEEDED)
179         ${INSTALL} ${UKSRCS} ${UKERNELDIR}des
180         ${INSTALL} libdes.a ${UKERNELDIR}des/libdes.a
181
182 ${DESTDIR}lib/libdes.a: libdes.a
183         ${INSTALL} $? $@
184
185 install install.noversion: all ukinstall ${DESTDIR}lib/libdes.a
186         ${INSTALL} des.h des_conf.h mit-cpyright.h crypt.h ${DESTDIR}include
187         ${INSTALL} odd.h ${DESTDIR}include/des_odd.h
188
189 clean:
190         rm -f ${OBJECTS} ${DEP_LIBS} ${PROGS} ${GPROGS} ${GFILES} AFS_component_version_number.c misco.c
191         rm -f *.s *.o *.b core *~ *.com *.ld
192         rm -f tags TAGS ${LLIB}
193
194 tags:   ${CFILES}
195         rm -f tags; ${TAGS} ${CFILES}
196
197 print:  ${CODE}
198         lpr -p ${CODE}
199
200 src:    ${CODE}
201
202 ${CODE}:
203         (cd ${SRC}; co -q $@)
204
205 lint:   ${LLIB}
206
207 ${LLIB}: ${CFILES}
208         lint -I${K_INC} ${CFILES}
209
210 ${DES_LIB}: ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o
211         rm -f ${DES_LIB}
212         ar r ${DES_LIB} ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o
213         $(RANLIB) ${DES_LIB}
214
215 #       host system stuff
216 make_ip: make_ip.o misc.o
217         ${CC} make_ip.o misc.o ${LDFLAGS} -o make_ip
218 make_fp: make_fp.o misc.o
219         ${CC} make_fp.o misc.o ${LDFLAGS} -o make_fp
220 make_odd: make_odd.o misc.o
221         ${CC} ${LDFLAGS} make_odd.o -o make_odd misc.o
222 make_s_table: make_s_table.o misc.o     
223         ${CC} ${LDFLAGS} make_s_table.o misc.o -o make_s_table
224 make_p_table: make_p_table.o misc.o     
225         ${CC} ${LDFLAGS} make_p_table.o misc.o -o make_p_table
226 make_keyperm:   make_keyperm.o misc.o
227         ${CC} make_keyperm.o misc.o ${LDFLAGS} -o make_keyperm
228 make_e: make_e.o misc.o
229         ${CC} make_e.o misc.o ${LDFLAGS} -o make_e
230 make_p: make_p.o misc.o
231         ${CC} make_p.o misc.o ${LDFLAGS} -o make_p
232 make_s: make_s.o misc.o
233         ${CC} make_s.o misc.o ${LDFLAGS} -o make_s
234
235 odd.h:  make_odd
236         -./make_odd odd.h
237 s_table.h: make_s_table
238         -./make_s_table s_table.h
239 p_table.h: make_p_table
240         -./make_p_table p_table.h
241 key_perm.h: make_keyperm
242         -./make_keyperm key_perm.h
243 ip.c:   make_ip
244         -./make_ip ip.c
245 p.c:    make_p
246         -./make_p p.c
247 s.c:    make_s
248         -./make_s s.c
249 fp.c:   make_fp
250         -./make_fp fp.c
251
252 depend: ${CFILES} AFS_component_version_number.o
253         -${CC} -M ${F_CPP} ${CFILES} | \
254         sed -e ':loop' \
255         -e 't loop' | \
256         awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
257         else { if (length(rec $$2) > 70) { print rec; rec = $$0; } \
258                    else rec = rec " " $$2 } } \
259           END { print rec } ' > makedep
260         for file in ${OBJECTS} ; do \
261         echo "$$file:" >> makedep; \
262         echo ${MK_STR} "\$${SRC}/`basename $$file .o`.c" >> makedep; \
263         done
264         echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
265         echo '$$r makedep' >>eddep
266         echo 'w' >>eddep
267         cp Makefile Makefile.bak
268         ex - Makefile < eddep
269         rm eddep makedep
270         echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
271         echo -n '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
272         echo ' (see make depend above)' >> Makefile
273         make depend2 SRCDIR=${SRCDIR}
274
275 depend2: ${CFILES} ${GFILES}
276         ${CC} -M ${F_CPP} ${CFILES} | \
277         sed -e ':loop' \
278         -e 't loop' | \
279         awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
280         else { if (length(rec $$2) > 70) { print rec; rec = $$0; } \
281                    else rec = rec " " $$2 } } \
282           END { print rec } ' > makedep
283         for file in ${OBJECTS} ; do \
284         echo "$$file:" >> makedep; \
285         echo ${MK_STR} "\$${SRC}/`basename $$file .o`.c" >> makedep; \
286         done
287         echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
288         echo '$$r makedep' >>eddep
289         echo 'w' >>eddep
290         cp Makefile Makefile.bak
291         ex - Makefile < eddep
292         rm eddep makedep
293         echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
294         echo -n '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
295         echo ' (see make depend above)' >> Makefile
296
297 misc.o make_e.o: AFS_component_version_number.c
298 # DO NOT DELETE THIS LINE
299
300 make_keyperm.o: make_keyperm.c 
301 make_keyperm.o: 
302 make_ip.o: make_ip.c 
303 make_ip.o: tables.h
304 make_fp.o: make_fp.c 
305 make_fp.o: tables.h
306 make_p.o: make_p.c
307 make_p.o: conf.h tables.h
308 make_s.o: make_s.c ./s_table.h
309 make_s_table.o: make_s_table.c
310 make_s_table.o: tables.h
311 make_p_table.o: make_p_table.c 
312 make_p_table.o: conf.h
313 make_p_table.o: tables.h
314 make_odd.o: make_odd.c 
315 misc.o: misc.c des_internal.h
316 misc.o: conf.h
317 key_sched.o: key_sched.c
318 key_sched.o: conf.h 
319 key_sched.o: des.h des_internal.h
320 key_sched.o: mit-cpyright.h
321 key_sched.o: des_conf.h ./key_perm.h ./odd.h
322 key_test.o: key_test.c
323 key_test.o: des.h
324 key_test.o: mit-cpyright.h
325 key_test.o: des_conf.h
326 testit.o: testit.c
327 testit.o: des.h
328 testit.o: mit-cpyright.h
329 testit.o: des_conf.h
330 des.o: des.c des_internal.h
331 des.o: des.h
332 des.o: mit-cpyright.h
333 des.o: des_conf.h ./s_table.h ./p_table.h ./ip.c
334 des.o: ./p.c ./fp.c
335 cbc_encrypt.o: cbc_encrypt.c 
336 cbc_encrypt.o: des.h
337 cbc_encrypt.o: mit-cpyright.h
338 cbc_encrypt.o: des_conf.h
339 verify.o: verify.c 
340 verify.o: des.h
341 verify.o: mit-cpyright.h
342 verify.o: des_conf.h
343 read_pssword.o: read_pssword.c
344 read_pssword.o: des.h
345 read_pssword.o: mit-cpyright.h
346 read_pssword.o: des_conf.h 
347 pcbc_encrypt.o: pcbc_encrypt.c
348 pcbc_encrypt.o: des.h des_internal.h
349 pcbc_encrypt.o: mit-cpyright.h
350 pcbc_encrypt.o: des_conf.h
351 cksum.o: des.h
352 cksum.o: mit-cpyright.h
353 cksum.o: des_conf.h
354 quad_cksum.o: quad_cksum.c 
355 quad_cksum.o: des.h
356 quad_cksum.o: mit-cpyright.h
357 quad_cksum.o: des_conf.h
358 #random_key.o: random_key.c 
359 #random_key.o: des.h
360 #random_key.o: mit-cpyright.h
361 #random_key.o: des_conf.h 
362 key_parity.o: key_parity.c des.h odd.h
363 weak_key.o: weak_key.c des.h des_internal.h
364 new_rnd_key.o: des.h des_internal.h 
365 util.o: util.c
366 util.o: des.h
367 util.o: mit-cpyright.h
368 util.o: des_conf.h
369 strng_to_key.o: strng_to_key.c 
370 strng_to_key.o: des.h
371 strng_to_key.o: mit-cpyright.h
372 strng_to_key.o: des_conf.h ./odd.h
373 debug_decl.o: debug_decl.c
374 make_e.o: make_e.c
375 make_keyperm.o:
376         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_keyperm.c
377 make_ip.o:
378         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_ip.c
379 make_fp.o:
380         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_fp.c
381 make_p.o:
382         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_p.c
383 make_s.o:
384         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_s.c
385 make_s_table.o:
386         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_s_table.c
387 make_p_table.o:
388         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_p_table.c
389 make_odd.o:
390         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_odd.c
391 misc.o:
392         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/misc.c
393 misco.c: misc.c
394         -ln -s misc.c misco.c
395 misco.o: misco.c
396          ${CC} -I${SRC} ${F_CPP} ${F_CC} -o misco.o misco.c -DDONT_INCL_MAIN
397 key_sched.o:
398         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_sched.c
399 key_test.o:
400         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_test.c
401 testit.o:
402         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/testit.c
403 crypt.o:
404         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/crypt.c
405 des.o:
406         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/des.c
407 cbc_encrypt.o:
408         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/cbc_encrypt.c
409 verify.o:
410         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/verify.c
411 read_pssword.o:
412         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/read_pssword.c
413 pcbc_encrypt.o:
414         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/pcbc_encrypt.c
415 cksum.o:
416         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/cksum.c
417 quad_cksum.o:
418         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/quad_cksum.c
419 #random_key.o:
420 #       ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/random_key.c
421 key_parity.o:
422         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_parity.c
423 weak_key.o:
424         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/weak_key.c
425 new_rnd_key.o:
426         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/new_rnd_key.c
427 util.o:
428         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/util.c
429 strng_to_key.o:
430         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/strng_to_key.c
431 debug_decl.o:
432         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/debug_decl.c
433 make_e.o:
434         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_e.c
435 # DEPENDENCIES MUST END AT END OF FILE
436 # IF YOU PUT STUFF HERE IT WILL GO AWAY (see make depend above)