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