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/
30 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
32 UKSRCS=des.h mit-cpyright.h
34 K_INC = ${SRCDIR}include
37 # by default do not try to hide entry points
38 F_CC = -c ${GPROF} ${DBG} ${XCFLAGS}
39 F_CPP = -I${K_INC} -I.
40 MK_STR = " \$${CC} -I\$${SRC} \$${F_CPP} \$${F_CC}"
43 # dont use optimizer, since it pessimizes on uvax2,
44 # somehow -pg makes it faster.
49 DEP_LIBS = ${DES_LIB} ${NDES_LIB}
50 LIBS = ${DEP_LIBS} ${XLIBS}
54 ${SRC}/make_keyperm.c \
59 ${SRC}/make_s_table.c \
60 ${SRC}/make_p_table.c \
79 ${SRC}/cbc_encrypt.c \
80 ${SRC}/read_pssword.c \
81 ${SRC}/pcbc_encrypt.c \
84 ${SRC}/new_rnd_key.c \
88 ${SRC}/strng_to_key.c \
106 CFILES = ${SRCHOST} ${SRCTARG}
107 OBJECTS = ${OBJHOST} ${OBJTARG}
109 CODE = ${CFILES} ${SRC}/Makefile
122 # Programs to create generated files
135 # Library component lists.
155 include ../config/Makefile.version
157 # This is required to get compiler flags, but not use CFLAGS.
158 AFS_component_version_number.o: AFS_component_version_number.c
159 $(CC) ${XCFLAGS} -c AFS_component_version_number.c
163 all: ${GFILES} ${CFILES} ${DEP_LIBS}
171 @echo No $@ source here.
173 ukinstall webinstall: all ${UKSRCS}
174 set ${UKERNELDIR}des; $(MKDIR_IF_NEEDED)
175 ${INSTALL} ${UKSRCS} ${UKERNELDIR}des
176 ${INSTALL} libdes.a ${UKERNELDIR}des/libdes.a
178 ${DESTDIR}lib/libdes.a: libdes.a
181 install install.noversion: all ukinstall ${DESTDIR}lib/libdes.a
182 ${INSTALL} des.h des_conf.h mit-cpyright.h ${DESTDIR}include
183 ${INSTALL} odd.h ${DESTDIR}include/des_odd.h
186 rm -f ${OBJECTS} ${DEP_LIBS} ${PROGS} ${GPROGS} ${GFILES} AFS_component_version_number.c
187 rm -f *.s *.o *.b core *~ *.com *.ld
188 rm -f tags TAGS ${LLIB}
191 rm -f tags; ${TAGS} ${CFILES}
199 (cd ${SRC}; co -q $@)
204 lint -I${K_INC} ${CFILES}
206 ${DES_LIB}: ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o
208 ar r ${DES_LIB} ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o
212 make_ip: make_ip.o misc.o
213 ${CC} make_ip.o misc.o ${LDFLAGS} -o make_ip
214 make_fp: make_fp.o misc.o
215 ${CC} make_fp.o misc.o ${LDFLAGS} -o make_fp
216 make_odd: make_odd.o misc.o
217 ${CC} ${LDFLAGS} make_odd.o -o make_odd misc.o
218 make_s_table: make_s_table.o misc.o
219 ${CC} ${LDFLAGS} make_s_table.o misc.o -o make_s_table
220 make_p_table: make_p_table.o misc.o
221 ${CC} ${LDFLAGS} make_p_table.o misc.o -o make_p_table
222 make_keyperm: make_keyperm.o misc.o
223 ${CC} make_keyperm.o misc.o ${LDFLAGS} -o make_keyperm
224 make_e: make_e.o misc.o
225 ${CC} make_e.o misc.o ${LDFLAGS} -o make_e
226 make_p: make_p.o misc.o
227 ${CC} make_p.o misc.o ${LDFLAGS} -o make_p
228 make_s: make_s.o misc.o
229 ${CC} make_s.o misc.o ${LDFLAGS} -o make_s
233 s_table.h: make_s_table
234 -./make_s_table s_table.h
235 p_table.h: make_p_table
236 -./make_p_table p_table.h
237 key_perm.h: make_keyperm
238 -./make_keyperm key_perm.h
248 depend: ${CFILES} AFS_component_version_number.o
249 -${CC} -M ${F_CPP} ${CFILES} | \
252 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
253 else { if (length(rec $$2) > 70) { print rec; rec = $$0; } \
254 else rec = rec " " $$2 } } \
255 END { print rec } ' > makedep
256 for file in ${OBJECTS} ; do \
257 echo "$$file:" >> makedep; \
258 echo ${MK_STR} "\$${SRC}/`basename $$file .o`.c" >> makedep; \
260 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
261 echo '$$r makedep' >>eddep
263 cp Makefile Makefile.bak
264 ex - Makefile < eddep
266 echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
267 echo -n '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
268 echo ' (see make depend above)' >> Makefile
269 make depend2 SRCDIR=${SRCDIR}
271 depend2: ${CFILES} ${GFILES}
272 ${CC} -M ${F_CPP} ${CFILES} | \
275 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
276 else { if (length(rec $$2) > 70) { print rec; rec = $$0; } \
277 else rec = rec " " $$2 } } \
278 END { print rec } ' > makedep
279 for file in ${OBJECTS} ; do \
280 echo "$$file:" >> makedep; \
281 echo ${MK_STR} "\$${SRC}/`basename $$file .o`.c" >> makedep; \
283 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
284 echo '$$r makedep' >>eddep
286 cp Makefile Makefile.bak
287 ex - Makefile < eddep
289 echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
290 echo -n '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
291 echo ' (see make depend above)' >> Makefile
293 misc.o make_e.o: AFS_component_version_number.c
294 # DO NOT DELETE THIS LINE
296 make_keyperm.o: make_keyperm.c
303 make_p.o: conf.h tables.h
304 make_s.o: make_s.c ./s_table.h
305 make_s_table.o: make_s_table.c
306 make_s_table.o: tables.h
307 make_p_table.o: make_p_table.c
308 make_p_table.o: conf.h
309 make_p_table.o: tables.h
310 make_odd.o: make_odd.c
311 misc.o: misc.c des_internal.h
313 key_sched.o: key_sched.c
315 key_sched.o: des.h des_internal.h
316 key_sched.o: mit-cpyright.h
317 key_sched.o: des_conf.h ./key_perm.h ./odd.h
318 key_test.o: key_test.c
320 key_test.o: mit-cpyright.h
321 key_test.o: des_conf.h
324 testit.o: mit-cpyright.h
326 des.o: des.c des_internal.h
328 des.o: mit-cpyright.h
329 des.o: des_conf.h ./s_table.h ./p_table.h ./ip.c
331 cbc_encrypt.o: cbc_encrypt.c
333 cbc_encrypt.o: mit-cpyright.h
334 cbc_encrypt.o: des_conf.h
337 verify.o: mit-cpyright.h
339 read_pssword.o: read_pssword.c
340 read_pssword.o: des.h
341 read_pssword.o: mit-cpyright.h
342 read_pssword.o: des_conf.h
343 pcbc_encrypt.o: pcbc_encrypt.c
344 pcbc_encrypt.o: des.h des_internal.h
345 pcbc_encrypt.o: mit-cpyright.h
346 pcbc_encrypt.o: des_conf.h
348 cksum.o: mit-cpyright.h
350 quad_cksum.o: quad_cksum.c
352 quad_cksum.o: mit-cpyright.h
353 quad_cksum.o: des_conf.h
354 #random_key.o: random_key.c
356 #random_key.o: mit-cpyright.h
357 #random_key.o: des_conf.h
358 key_parity.o: key_parity.c des.h odd.h
359 weak_key.o: weak_key.c des.h des_internal.h
360 new_rnd_key.o: des.h des_internal.h
363 util.o: mit-cpyright.h
365 strng_to_key.o: strng_to_key.c
366 strng_to_key.o: des.h
367 strng_to_key.o: mit-cpyright.h
368 strng_to_key.o: des_conf.h ./odd.h
369 debug_decl.o: debug_decl.c
371 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_keyperm.c
373 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_ip.c
375 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_fp.c
377 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_p.c
379 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_s.c
381 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_s_table.c
383 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_p_table.c
385 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_odd.c
387 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/misc.c
389 -ln -s misc.c misco.c
391 ${CC} -I${SRC} ${F_CPP} ${F_CC} -o misco.o misco.c -DDONT_INCL_MAIN
393 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_sched.c
395 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_test.c
397 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/testit.c
399 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/des.c
401 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/cbc_encrypt.c
403 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/verify.c
405 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/read_pssword.c
407 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/pcbc_encrypt.c
409 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/cksum.c
411 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/quad_cksum.c
413 # ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/random_key.c
415 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_parity.c
417 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/weak_key.c
419 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/new_rnd_key.c
421 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/util.c
423 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/strng_to_key.c
425 ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/debug_decl.c
426 # DEPENDENCIES MUST END AT END OF FILE
427 # IF YOU PUT STUFF HERE IT WILL GO AWAY (see make depend above)