death-to-permit-xprt-h-20010327
[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.
40 MK_STR  = "     \$${CC} -I\$${SRC} \$${F_CPP} \$${F_CC}"
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_e \
129         make_p \
130         make_s \
131         make_fp \
132         make_ip \
133         misc
134
135 # Library component lists.
136
137 TARGOBJS = \
138         des.o \
139         cbc_encrypt.o \
140         pcbc_encrypt.o \
141         cksum.o \
142         new_rnd_key.o \
143         key_sched.o \
144         debug_decl.o \
145         quad_cksum.o \
146         key_parity.o \
147         weak_key.o \
148         read_pssword.o \
149         strng_to_key.o \
150         misco.o \
151         ${CRYPT_OBJ} \
152         util.o
153
154 COMPONENT=des
155 include ../config/Makefile.version
156
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
160
161 noversion: install
162
163 all:    ${GFILES} ${CFILES} ${DEP_LIBS}
164
165 test: 
166         cd test; $(MAKE)
167
168 system: install
169
170 kinstall:
171         @echo No $@ source here.
172
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
177
178 ${DESTDIR}lib/libdes.a: libdes.a
179         ${INSTALL} $? $@
180
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
184
185 clean:
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}
189
190 tags:   ${CFILES}
191         rm -f tags; ${TAGS} ${CFILES}
192
193 print:  ${CODE}
194         lpr -p ${CODE}
195
196 src:    ${CODE}
197
198 ${CODE}:
199         (cd ${SRC}; co -q $@)
200
201 lint:   ${LLIB}
202
203 ${LLIB}: ${CFILES}
204         lint -I${K_INC} ${CFILES}
205
206 ${DES_LIB}: ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o
207         rm -f ${DES_LIB}
208         ar r ${DES_LIB} ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o
209         $(RANLIB) ${DES_LIB}
210
211 #       host system stuff
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
230
231 odd.h:  make_odd
232         -./make_odd odd.h
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
239 ip.c:   make_ip
240         -./make_ip ip.c
241 p.c:    make_p
242         -./make_p p.c
243 s.c:    make_s
244         -./make_s s.c
245 fp.c:   make_fp
246         -./make_fp fp.c
247
248 depend: ${CFILES} AFS_component_version_number.o
249         -${CC} -M ${F_CPP} ${CFILES} | \
250         sed -e ':loop' \
251         -e 't loop' | \
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; \
259         done
260         echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
261         echo '$$r makedep' >>eddep
262         echo 'w' >>eddep
263         cp Makefile Makefile.bak
264         ex - Makefile < eddep
265         rm eddep makedep
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}
270
271 depend2: ${CFILES} ${GFILES}
272         ${CC} -M ${F_CPP} ${CFILES} | \
273         sed -e ':loop' \
274         -e 't loop' | \
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; \
282         done
283         echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
284         echo '$$r makedep' >>eddep
285         echo 'w' >>eddep
286         cp Makefile Makefile.bak
287         ex - Makefile < eddep
288         rm eddep makedep
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
292
293 misc.o make_e.o: AFS_component_version_number.c
294 # DO NOT DELETE THIS LINE
295
296 make_keyperm.o: make_keyperm.c 
297 make_keyperm.o: 
298 make_ip.o: make_ip.c 
299 make_ip.o: tables.h
300 make_fp.o: make_fp.c 
301 make_fp.o: tables.h
302 make_p.o: make_p.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
312 misc.o: conf.h
313 key_sched.o: key_sched.c
314 key_sched.o: conf.h 
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
319 key_test.o: des.h
320 key_test.o: mit-cpyright.h
321 key_test.o: des_conf.h
322 testit.o: testit.c
323 testit.o: des.h
324 testit.o: mit-cpyright.h
325 testit.o: des_conf.h
326 des.o: des.c des_internal.h
327 des.o: des.h
328 des.o: mit-cpyright.h
329 des.o: des_conf.h ./s_table.h ./p_table.h ./ip.c
330 des.o: ./p.c ./fp.c
331 cbc_encrypt.o: cbc_encrypt.c 
332 cbc_encrypt.o: des.h
333 cbc_encrypt.o: mit-cpyright.h
334 cbc_encrypt.o: des_conf.h
335 verify.o: verify.c 
336 verify.o: des.h
337 verify.o: mit-cpyright.h
338 verify.o: des_conf.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
347 cksum.o: des.h
348 cksum.o: mit-cpyright.h
349 cksum.o: des_conf.h
350 quad_cksum.o: quad_cksum.c 
351 quad_cksum.o: des.h
352 quad_cksum.o: mit-cpyright.h
353 quad_cksum.o: des_conf.h
354 #random_key.o: random_key.c 
355 #random_key.o: des.h
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 
361 util.o: util.c
362 util.o: des.h
363 util.o: mit-cpyright.h
364 util.o: des_conf.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
370 make_keyperm.o:
371         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_keyperm.c
372 make_ip.o:
373         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_ip.c
374 make_fp.o:
375         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_fp.c
376 make_p.o:
377         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_p.c
378 make_s.o:
379         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_s.c
380 make_s_table.o:
381         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_s_table.c
382 make_p_table.o:
383         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_p_table.c
384 make_odd.o:
385         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_odd.c
386 misc.o:
387         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/misc.c
388 misco.c: misc.c
389         -ln -s misc.c misco.c
390 misco.o: misco.c
391          ${CC} -I${SRC} ${F_CPP} ${F_CC} -o misco.o misco.c -DDONT_INCL_MAIN
392 key_sched.o:
393         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_sched.c
394 key_test.o:
395         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_test.c
396 testit.o:
397         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/testit.c
398 des.o:
399         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/des.c
400 cbc_encrypt.o:
401         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/cbc_encrypt.c
402 verify.o:
403         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/verify.c
404 read_pssword.o:
405         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/read_pssword.c
406 pcbc_encrypt.o:
407         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/pcbc_encrypt.c
408 cksum.o:
409         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/cksum.c
410 quad_cksum.o:
411         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/quad_cksum.c
412 #random_key.o:
413 #       ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/random_key.c
414 key_parity.o:
415         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_parity.c
416 weak_key.o:
417         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/weak_key.c
418 new_rnd_key.o:
419         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/new_rnd_key.c
420 util.o:
421         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/util.c
422 strng_to_key.o:
423         ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/strng_to_key.c
424 debug_decl.o:
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)