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),
26 include ../config/Makefile.${SYS_NAME}
28 UKERNELDIR=../libuafs/
29 INSTALL=${SRCDIR}bin/install
31 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
33 UKSRCS=des.h mit-cpyright.h
35 K_INC = ${SRCDIR}include
38 # by default do not try to hide entry points
39 F_CC = -c ${GPROF} ${DBG} ${XCFLAGS}
40 F_CPP = -I${K_INC} -I.
41 MK_STR = " \$${CC} -I\$${SRC} \$${F_CPP} \$${F_CC}"
44 # dont use optimizer, since it pessimizes on uvax2,
45 # somehow -pg makes it faster.
50 DEP_LIBS = ${DES_LIB} ${NDES_LIB}
51 LIBS = ${DEP_LIBS} ${XLIBS}
55 ${SRC}/make_keyperm.c \
60 ${SRC}/make_s_table.c \
61 ${SRC}/make_p_table.c \
80 ${SRC}/cbc_encrypt.c \
81 ${SRC}/read_pssword.c \
82 ${SRC}/pcbc_encrypt.c \
85 ${SRC}/new_rnd_key.c \
89 ${SRC}/strng_to_key.c \
107 CFILES = ${SRCHOST} ${SRCTARG}
108 OBJECTS = ${OBJHOST} ${OBJTARG}
110 CODE = ${CFILES} ${SRC}/Makefile
123 # Programs to create generated files
136 # Library component lists.
156 include ../config/Makefile.version
158 # This is required to get compiler flags, but not use CFLAGS.
159 AFS_component_version_number.o: AFS_component_version_number.c
160 $(CC) ${XCFLAGS} -c AFS_component_version_number.c
164 all: ${GFILES} ${CFILES} ${DEP_LIBS}
172 @echo No $@ source here.
174 ukinstall webinstall: all ${UKSRCS}
175 set ${UKERNELDIR}des; $(MKDIR_IF_NEEDED)
176 ${INSTALL} ${UKSRCS} ${UKERNELDIR}des
177 ${INSTALL} libdes.a ${UKERNELDIR}des/libdes.a
179 ${DESTDIR}lib/libdes.a: libdes.a
182 install install.noversion: all ukinstall ${DESTDIR}lib/libdes.a
183 ${INSTALL} des.h des_conf.h mit-cpyright.h ${DESTDIR}include
184 ${INSTALL} odd.h ${DESTDIR}include/des_odd.h
187 rm -f ${OBJECTS} ${DEP_LIBS} ${PROGS} ${GPROGS} ${GFILES} AFS_component_version_number.c
188 rm -f *.s *.o *.b core *~ *.com *.ld
189 rm -f tags TAGS ${LLIB}
192 rm -f tags; ${TAGS} ${CFILES}
200 (cd ${SRC}; co -q $@)
205 lint -I${K_INC} ${CFILES}
207 ${DES_LIB}: ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o
209 ar r ${DES_LIB} ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o
213 des.o cbc_encrypt.o pcbc_encrypt.o new_rnd_key.o cksum.o testit.o verify.o: ../permit_xprt.h
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
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
252 depend: ${CFILES} AFS_component_version_number.o
253 -${CC} -M ${F_CPP} ${CFILES} | \
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; \
264 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
265 echo '$$r makedep' >>eddep
267 cp Makefile Makefile.bak
268 ex - Makefile < eddep
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}
275 depend2: ${CFILES} ${GFILES}
276 ${CC} -M ${F_CPP} ${CFILES} | \
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; \
287 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
288 echo '$$r makedep' >>eddep
290 cp Makefile Makefile.bak
291 ex - Makefile < eddep
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
297 misc.o make_e.o: AFS_component_version_number.c
298 # DO NOT DELETE THIS LINE
300 make_keyperm.o: make_keyperm.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
317 key_sched.o: key_sched.c
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
324 key_test.o: mit-cpyright.h
325 key_test.o: des_conf.h
328 testit.o: mit-cpyright.h
330 des.o: des.c des_internal.h
332 des.o: mit-cpyright.h
333 des.o: des_conf.h ./s_table.h ./p_table.h ./ip.c
335 cbc_encrypt.o: cbc_encrypt.c
337 cbc_encrypt.o: mit-cpyright.h
338 cbc_encrypt.o: des_conf.h
341 verify.o: mit-cpyright.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
352 cksum.o: mit-cpyright.h
354 quad_cksum.o: quad_cksum.c
356 quad_cksum.o: mit-cpyright.h
357 quad_cksum.o: des_conf.h
358 #random_key.o: random_key.c
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
367 util.o: mit-cpyright.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
375 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_keyperm.c
377 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_ip.c
379 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_fp.c
381 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_p.c
383 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_s.c
385 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_s_table.c
387 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_p_table.c
389 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_odd.c
391 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/misc.c
393 -ln -s misc.c misco.c
395 ${CC} -I${SRC} ${F_CPP} ${F_CC} -o misco.o misco.c -DDONT_INCL_MAIN
397 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_sched.c
399 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_test.c
401 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/testit.c
403 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/des.c
405 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/cbc_encrypt.c
407 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/verify.c
409 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/read_pssword.c
411 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/pcbc_encrypt.c
413 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/cksum.c
415 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/quad_cksum.c
417 # ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/random_key.c
419 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_parity.c
421 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/weak_key.c
423 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/new_rnd_key.c
425 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/util.c
427 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/strng_to_key.c
429 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/debug_decl.c
430 # DEPENDENCIES MUST END AT END OF FILE
431 # IF YOU PUT STUFF HERE IT WILL GO AWAY (see make depend above)