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