2 # Copyright 1987 by the Massachusetts Institute of Technology.
4 # For copying and distribution information,
5 # please see the file <mit-cpyright.h>.
7 # Makefile for BSD DES library
9 # First define machine type, compiler, and object file suffix
10 # Could be for VAX or PC-DOS
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).
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).
21 # Make sure these are properly defined for any new machine types.
22 # target machine for run-time code (may cross-compile),
27 TOP_SRCDIR=@TOP_SRCDIR@
28 SYS_NAME=@AFS_SYSNAME@
31 include ../config/Makefile.${SYS_NAME}
33 UKERNELDIR=../libuafs/
35 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
37 UKSRCS=des.h mit-cpyright.h
39 K_INC = ${SRCDIR}include
42 # by default do not try to hide entry points
43 F_CC = -c ${GPROF} ${DBG} ${XCFLAGS}
44 F_CPP = -I${K_INC} -I. -I${TOP_SRCDIR}/config
45 MK_STR = " \$${CC} -I\$${SRC} \$${F_CPP} \$${F_CC}" -I${TOP_SRCDIR}/config
48 # dont use optimizer, since it pessimizes on uvax2,
49 # somehow -pg makes it faster.
54 DEP_LIBS = ${DES_LIB} ${NDES_LIB}
55 LIBS = ${DEP_LIBS} ${XLIBS}
59 ${SRC}/make_keyperm.c \
64 ${SRC}/make_s_table.c \
65 ${SRC}/make_p_table.c \
84 ${SRC}/cbc_encrypt.c \
85 ${SRC}/read_pssword.c \
86 ${SRC}/pcbc_encrypt.c \
89 ${SRC}/new_rnd_key.c \
93 ${SRC}/strng_to_key.c \
111 CFILES = ${SRCHOST} ${SRCTARG}
112 OBJECTS = ${OBJHOST} ${OBJTARG}
114 CODE = ${CFILES} ${SRC}/Makefile
127 # Programs to create generated files
142 # Library component lists.
162 include ../config/Makefile.version
164 # This is required to get compiler flags, but not use CFLAGS.
165 AFS_component_version_number.o: AFS_component_version_number.c
166 $(CC) ${XCFLAGS} -c AFS_component_version_number.c
170 all: ${GFILES} ${CFILES} ${DEP_LIBS}
180 @echo No $@ source here.
182 ukinstall webinstall: all ${UKSRCS}
183 set ${UKERNELDIR}des; $(MKDIR_IF_NEEDED)
184 ${INSTALL} ${UKSRCS} ${UKERNELDIR}des
185 ${INSTALL} libdes.a ${UKERNELDIR}des/libdes.a
187 ${DESTDIR}lib/libdes.a: libdes.a
190 install install.noversion: all ukinstall ${DESTDIR}lib/libdes.a
191 ${INSTALL} des.h des_conf.h mit-cpyright.h ${DESTDIR}include
192 ${INSTALL} odd.h ${DESTDIR}include/des_odd.h
195 rm -f ${OBJECTS} ${DEP_LIBS} ${PROGS} ${GPROGS} ${GFILES} AFS_component_version_number.c misco.c
196 rm -f *.s *.o *.b core *~ *.com *.ld
197 rm -f tags TAGS ${LLIB}
200 rm -f tags; ${TAGS} ${CFILES}
208 (cd ${SRC}; co -q $@)
213 lint -I${K_INC} ${CFILES}
215 ${DES_LIB}: ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o
217 ar r ${DES_LIB} ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o
221 make_ip: make_ip.o misc.o
222 ${CC} make_ip.o misc.o ${LDFLAGS} -o make_ip
223 make_fp: make_fp.o misc.o
224 ${CC} make_fp.o misc.o ${LDFLAGS} -o make_fp
225 make_odd: make_odd.o misc.o
226 ${CC} ${LDFLAGS} make_odd.o -o make_odd misc.o
227 make_s_table: make_s_table.o misc.o
228 ${CC} ${LDFLAGS} make_s_table.o misc.o -o make_s_table
229 make_p_table: make_p_table.o misc.o
230 ${CC} ${LDFLAGS} make_p_table.o misc.o -o make_p_table
231 make_keyperm: make_keyperm.o misc.o
232 ${CC} make_keyperm.o misc.o ${LDFLAGS} -o make_keyperm
233 make_e: make_e.o misc.o
234 ${CC} make_e.o misc.o ${LDFLAGS} -o make_e
235 make_p: make_p.o misc.o
236 ${CC} make_p.o misc.o ${LDFLAGS} -o make_p
237 make_s: make_s.o misc.o
238 ${CC} make_s.o misc.o ${LDFLAGS} -o make_s
242 s_table.h: make_s_table
243 -./make_s_table s_table.h
244 p_table.h: make_p_table
245 -./make_p_table p_table.h
246 key_perm.h: make_keyperm
247 -./make_keyperm key_perm.h
257 depend: ${CFILES} AFS_component_version_number.o
258 -${CC} -M ${F_CPP} ${CFILES} | \
261 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
262 else { if (length(rec $$2) > 70) { print rec; rec = $$0; } \
263 else rec = rec " " $$2 } } \
264 END { print rec } ' > makedep
265 for file in ${OBJECTS} ; do \
266 echo "$$file:" >> makedep; \
267 echo ${MK_STR} "\$${SRC}/`basename $$file .o`.c" >> makedep; \
269 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
270 echo '$$r makedep' >>eddep
272 cp Makefile Makefile.bak
273 ex - Makefile < eddep
275 echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
276 echo -n '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
277 echo ' (see make depend above)' >> Makefile
278 make depend2 SRCDIR=${SRCDIR}
280 depend2: ${CFILES} ${GFILES}
281 ${CC} -M ${F_CPP} ${CFILES} | \
284 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
285 else { if (length(rec $$2) > 70) { print rec; rec = $$0; } \
286 else rec = rec " " $$2 } } \
287 END { print rec } ' > makedep
288 for file in ${OBJECTS} ; do \
289 echo "$$file:" >> makedep; \
290 echo ${MK_STR} "\$${SRC}/`basename $$file .o`.c" >> makedep; \
292 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
293 echo '$$r makedep' >>eddep
295 cp Makefile Makefile.bak
296 ex - Makefile < eddep
298 echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
299 echo -n '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
300 echo ' (see make depend above)' >> Makefile
302 misc.o make_e.o: AFS_component_version_number.c
303 # DO NOT DELETE THIS LINE
305 make_keyperm.o: make_keyperm.c
312 make_p.o: conf.h tables.h
313 make_s.o: make_s.c ./s_table.h
314 make_s_table.o: make_s_table.c
315 make_s_table.o: tables.h
316 make_p_table.o: make_p_table.c
317 make_p_table.o: conf.h
318 make_p_table.o: tables.h
319 make_odd.o: make_odd.c
320 misc.o: misc.c des_internal.h
322 key_sched.o: key_sched.c
324 key_sched.o: des.h des_internal.h
325 key_sched.o: mit-cpyright.h
326 key_sched.o: des_conf.h ./key_perm.h ./odd.h
327 key_test.o: key_test.c
329 key_test.o: mit-cpyright.h
330 key_test.o: des_conf.h
333 testit.o: mit-cpyright.h
335 des.o: des.c des_internal.h
337 des.o: mit-cpyright.h
338 des.o: des_conf.h ./s_table.h ./p_table.h ./ip.c
340 cbc_encrypt.o: cbc_encrypt.c
342 cbc_encrypt.o: mit-cpyright.h
343 cbc_encrypt.o: des_conf.h
346 verify.o: mit-cpyright.h
348 read_pssword.o: read_pssword.c
349 read_pssword.o: des.h
350 read_pssword.o: mit-cpyright.h
351 read_pssword.o: des_conf.h
352 pcbc_encrypt.o: pcbc_encrypt.c
353 pcbc_encrypt.o: des.h des_internal.h
354 pcbc_encrypt.o: mit-cpyright.h
355 pcbc_encrypt.o: des_conf.h
357 cksum.o: mit-cpyright.h
359 quad_cksum.o: quad_cksum.c
361 quad_cksum.o: mit-cpyright.h
362 quad_cksum.o: des_conf.h
363 #random_key.o: random_key.c
365 #random_key.o: mit-cpyright.h
366 #random_key.o: des_conf.h
367 key_parity.o: key_parity.c des.h odd.h
368 weak_key.o: weak_key.c des.h des_internal.h
369 new_rnd_key.o: des.h des_internal.h
372 util.o: mit-cpyright.h
374 strng_to_key.o: strng_to_key.c
375 strng_to_key.o: des.h
376 strng_to_key.o: mit-cpyright.h
377 strng_to_key.o: des_conf.h ./odd.h
378 debug_decl.o: debug_decl.c
381 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_keyperm.c
383 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_ip.c
385 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_fp.c
387 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_p.c
389 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_s.c
391 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_s_table.c
393 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_p_table.c
395 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_odd.c
397 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/misc.c
399 -ln -s misc.c misco.c
401 ${CC} -I${SRC} ${F_CPP} ${F_CC} -o misco.o misco.c -DDONT_INCL_MAIN
403 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_sched.c
405 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_test.c
407 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/testit.c
409 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/crypt.c
411 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/des.c
413 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/cbc_encrypt.c
415 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/verify.c
417 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/read_pssword.c
419 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/pcbc_encrypt.c
421 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/cksum.c
423 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/quad_cksum.c
425 # ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/random_key.c
427 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_parity.c
429 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/weak_key.c
431 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/new_rnd_key.c
433 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/util.c
435 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/strng_to_key.c
437 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/debug_decl.c
439 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_e.c
440 # DEPENDENCIES MUST END AT END OF FILE
441 # IF YOU PUT STUFF HERE IT WILL GO AWAY (see make depend above)