initial-objdir-support-20011017
[openafs.git] / src / des / Makefile.in
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 DEST=@DEST@
26 TOP_INCDIR=@TOP_INCDIR@
27 TOP_LIBDIR=@TOP_LIBDIR@
28 TOP_OBJDIR=@TOP_OBJDIR@
29 srcdir=@srcdir@
30 VPATH=${srcdir}
31 prefix=@prefix@
32 exec_prefix=@exec_prefix@
33 bindir=@bindir@
34 sbindir=@sbindir@
35 libexecdir=@libexecdir@
36 libdir=@libdir@
37 includedir=@includedir@
38 mandir=@mandir@
39 afssrvbindir=@afssrvbindir@
40 afssrvsbindir=@afssrvsbindir@
41 afssrvlibexecdir=@afssrvlibexecdir@
42 COMPILE_ET=${TOP_OBJDIR}/src/comerr/compile_et
43 RXGEN=${TOP_OBJDIR}/src/rxgen/rxgen
44 TOP_SRCDIR=@TOP_SRCDIR@
45 SYS_NAME=@AFS_SYSNAME@
46
47 SHELL = /bin/sh
48 include ../config/Makefile.${SYS_NAME}
49
50 UKERNELDIR=../libuafs/
51
52 LDFLAGS = ${XLDFLAGS}
53
54 OBJS = \
55         des.o \
56         cbc_encrypt.o \
57         pcbc_encrypt.o \
58         cksum.o \
59         new_rnd_key.o \
60         key_sched.o \
61         debug_decl.o \
62         quad_cksum.o \
63         key_parity.o \
64         weak_key.o \
65         read_pssword.o \
66         strng_to_key.o \
67         misc.o \
68         crypt.o \
69         util.o
70
71 all: ukinstall ${TOP_LIBDIR}/libdes.a ${TOP_INCDIR}/des.h ${TOP_INCDIR}/des_conf.h ${TOP_INCDIR}/mit-cpyright.h ${TOP_INCDIR}/des_odd.h
72
73 #
74 # Build rules
75 #
76 .c.o:
77         ${CC} -c -I. -I${srcdir} -I${TOP_INCDIR} -I${TOP_OBJDIR}/src/config ${XCFLAGS} $<
78
79 libdes.a: ${OBJS} AFS_component_version_number.o
80         $(RM) -f libdes.a
81         ar r libdes.a ${OBJS} AFS_component_version_number.o
82         $(RANLIB) libdes.a
83
84 make_ip: make_ip.o misc.o main.o
85         ${CC} make_ip.o misc.o main.o ${LDFLAGS} -o make_ip
86
87 make_fp: make_fp.o misc.o main.o
88         ${CC} make_fp.o misc.o main.o ${LDFLAGS} -o make_fp
89
90 make_odd: make_odd.o misc.o main.o
91         ${CC} make_odd.o misc.o main.o ${LDFLAGS} -o make_odd
92
93 make_s_table: make_s_table.o misc.o main.o 
94         ${CC} make_s_table.o misc.o main.o ${LDFLAGS} -o make_s_table
95
96 make_p_table: make_p_table.o misc.o main.o 
97         ${CC} make_p_table.o misc.o main.o ${LDFLAGS} -o make_p_table
98
99 make_keyperm: make_keyperm.o misc.o main.o 
100         ${CC} make_keyperm.o misc.o main.o ${LDFLAGS} -o make_keyperm
101
102 make_e: make_e.o misc.o main.o 
103         ${CC} make_e.o misc.o main.o ${LDFLAGS} -o make_e
104
105 make_p: make_p.o misc.o main.o 
106         ${CC} make_p.o misc.o main.o ${LDFLAGS} -o make_p
107
108 make_s: make_s.o misc.o main.o 
109         ${CC} make_s.o misc.o main.o ${LDFLAGS} -o make_s
110
111 #
112 # Table/code generation targets
113 #
114 odd.h: make_odd
115         ./make_odd odd.h
116
117 s_table.h: make_s_table
118         ./make_s_table s_table.h
119
120 p_table.h: make_p_table
121         ./make_p_table p_table.h
122
123 key_perm.h: make_keyperm
124         ./make_keyperm key_perm.h
125
126 ip.c: make_ip
127         ./make_ip ip.c
128
129 p.c: make_p
130         ./make_p p.c
131
132 s.c: make_s
133         ./make_s s.c
134
135 fp.c: make_fp
136         ./make_fp fp.c
137
138 #
139 # Dependency rules
140 #
141 INCLS=des.h mit-cpyright.h des_conf.h des_internal.h conf.h
142
143 make_keyperm.o: make_keyperm.c ${INCLS}
144 make_ip.o: make_ip.c tables.h ${INCLS}
145 make_fp.o: make_fp.c tables.h ${INCLS}
146 make_p.o: make_p.c tables.h ${INCLS}
147 make_s.o: make_s.c s_table.h ${INCLS}
148 make_s_table.o: make_s_table.c tables.h ${INCLS}
149 make_p_table.o: make_p_table.c tables.h ${INCLS}
150 make_odd.o: make_odd.c ${INCLS}
151 misc.o: misc.c AFS_component_version_number.c ${INCLS}
152 main.o: main.c AFS_component_version_number.c ${INCLS}
153 key_sched.o: key_sched.c key_perm.h odd.h ${INCLS}
154 key_test.o: key_test.c ${INCLS}
155 testit.o: testit.c ${INCLS}
156 des.o: s_table.h p_table.h ip.c p.c fp.c ${INCLS}
157 cbc_encrypt.o: cbc_encrypt.c ${INCLS}
158 verify.o: verify.c ${INCLS}
159 read_pssword.o: read_pssword.c ${INCLS}
160 pcbc_encrypt.o: pcbc_encrypt.c ${INCLS}
161 cksum.o: cksum.c ${INCLS}
162 quad_cksum.o: quad_cksum.c ${INCLS}
163 key_parity.o: key_parity.c odd.h ${INCLS}
164 weak_key.o: weak_key.c ${INCLS}
165 new_rnd_key.o: new_rnd_key.c ${INCLS}
166 util.o: util.c ${INCLS}
167 strng_to_key.o: strng_to_key.c ${INCLS}
168 debug_decl.o: debug_decl.c ${INCLS}
169 make_e.o: make_e.c ${INCLS}
170
171 #
172 # Install targets
173 #
174 install:  ${DESTDIR}${libdir}/libdes.a ${DESTDIR}${includedir}/des.h ${DESTDIR}${includedir}/des_conf.h ${DESTDIR}${includedir}/mit-cpyright.h ${DESTDIR}${includedir}/des_odd.h
175
176 ${DEST}/lib/libdes.a: libdes.a
177         ${INSTALL} $? $@
178
179 ${DEST}/include/des.h: des.h
180         ${INSTALL} $? $@
181
182 ${DEST}/include/des_conf.h: des_conf.h
183         ${INSTALL} $? $@
184
185 ${DEST}/include/mit-cpyright.h: mit-cpyright.h
186         ${INSTALL} $? $@
187
188 ${DEST}/include/des_odd.h: odd.h
189         ${INSTALL} $? $@
190
191 ukinstall: \
192         ${UKERNELDIR}/des/libdes.a \
193         ${UKERNELDIR}/des/des.h \
194         ${UKERNELDIR}/des/mit-cpyright.h 
195         
196 ${UKERNELDIR}/des:
197         mkdir -p $?
198
199 ${UKERNELDIR}/des/libdes.a: libdes.a
200         ${INSTALL} $? $@
201
202 ${UKERNELDIR}/des/des.h: des.h
203         ${INSTALL} $? $@
204
205 ${UKERNELDIR}/des/mit-cpyright.h: mit-cpyright.h
206         ${INSTALL} $? $@
207
208 #
209 # Misc. targets
210 #
211 test: libdes.a
212         cd test; $(MAKE)
213
214 clean:
215         $(RM) -f *.a *.s *.o *.b core *~ *.com *.ld
216         $(RM) -f make_fp make_ip make_keyperm make_odd make_p \
217                 make_p_table make_s_table key_perm.h p_table.h \
218                 s_table.h odd.h p.c s.c fp.c ip.c AFS_component_version_number.c
219         cd test; $(MAKE) clean
220
221 include ../config/Makefile.version
222
223 ${DESTDIR}${libdir}/libdes.a: libdes.a
224         ${INSTALL} $? $@
225
226 ${TOP_LIBDIR}/libdes.a: libdes.a
227         ${INSTALL} $? $@
228
229 ${DESTDIR}${includedir}/des.h: des.h
230         ${INSTALL} $? $@
231
232 ${TOP_INCDIR}/des.h: des.h
233         ${INSTALL} $? $@
234
235 ${DESTDIR}${includedir}/des_conf.h: des_conf.h
236         ${INSTALL} $? $@
237
238 ${TOP_INCDIR}/des_conf.h: des_conf.h
239         ${INSTALL} $? $@
240
241 ${DESTDIR}${includedir}/mit-cpyright.h: mit-cpyright.h
242         ${INSTALL} $? $@
243
244 ${TOP_INCDIR}/mit-cpyright.h: mit-cpyright.h
245         ${INSTALL} $? $@
246
247 ${DESTDIR}${includedir}/des_odd.h: odd.h
248         ${INSTALL} $? $@
249
250 ${TOP_INCDIR}/des_odd.h: odd.h
251         ${INSTALL} $? $@
252
253 dest:  ${DEST}/lib/libdes.a ${DEST}/include/des.h ${DEST}/include/des_conf.h ${DEST}/include/mit-cpyright.h ${DEST}/include/des_odd.h
254