]> git.ipfire.org Git - thirdparty/openssl.git/blame - crypto/des/Makefile.lit
Import of old SSLeay release: SSLeay 0.9.0b
[thirdparty/openssl.git] / crypto / des / Makefile.lit
CommitLineData
d02b48c6
RE
1# You must select the correct terminal control system to be used to
2# turn character echo off when reading passwords. There a 5 systems
3# SGTTY - the old BSD system
4# TERMIO - most system V boxes
5# TERMIOS - SGI (ala IRIX).
6# VMS - the DEC operating system
7# MSDOS - we all know what it is :-)
8# read_pwd.c makes a reasonable guess at what is correct.
9
10# Targets
11# make - twidle the options yourself :-)
12# make cc - standard cc options
13# make gcc - standard gcc options
14# make x86-elf - linux-elf etc
15# make x86-out - linux-a.out, FreeBSD etc
16# make x86-solaris
17# make x86-bdsi
18
19# If you are on a DEC Alpha, edit des.h and change the DES_LONG
20# define to 'unsigned int'. I have seen this give a %20 speedup.
21
22OPTS0= -DLIBDES_LIT -DRAND -DTERMIO #-DNOCONST
23
24# Version 1.94 has changed the strings_to_key function so that it is
25# now compatible with MITs when the string is longer than 8 characters.
26# If you wish to keep the old version, uncomment the following line.
27# This will affect the -E/-D options on des(1).
28#OPTS1= -DOLD_STR_TO_KEY
29
30# There are 4 possible performance options
31# -DDES_PTR
32# -DDES_RISC1
33# -DDES_RISC2 (only one of DES_RISC1 and DES_RISC2)
34# -DDES_UNROLL
35# after the initial build, run 'des_opts' to see which options are best
36# for your platform. There are some listed in options.txt
37#OPTS2= -DDES_PTR
38#OPTS3= -DDES_RISC1 # or DES_RISC2
39#OPTS4= -DDES_UNROLL
40
41OPTS= $(OPTS0) $(OPTS1) $(OPTS2) $(OPTS3) $(OPTS4)
42
43MAKE=make -f Makefile
44#CC=cc
45#CFLAG= -O
46
47CC=gcc
48#CFLAG= -O4 -funroll-loops -fomit-frame-pointer
49CFLAG= -O3 -fomit-frame-pointer
50
51CFLAGS=$(OPTS) $(CFLAG)
52CPP=$(CC) -E
53AS=as
54
55# Assember version of des_encrypt*().
56DES_ENC=des_enc.o fcrypt_b.o # normal C version
58964a49
RE
57#DES_ENC=asm/dx86-elf.o asm/yx86-elf.o # elf format x86
58#DES_ENC=asm/dx86-out.o asm/yx86-out.o # a.out format x86
59#DES_ENC=asm/dx86-sol.o asm/yx86-sol.o # solaris format x86
60#DES_ENC=asm/dx86bsdi.o asm/yx86basi.o # bsdi format x86
d02b48c6
RE
61
62LIBDIR=/usr/local/lib
63BINDIR=/usr/local/bin
64INCDIR=/usr/local/include
65MANDIR=/usr/local/man
66MAN1=1
67MAN3=3
68SHELL=/bin/sh
58964a49
RE
69OBJ_LIT=cbc_enc.o ecb_enc.o $(DES_ENC) fcrypt.o set_key.o
70OBJ_FULL=cbc_cksm.o $(OBJ_LIT) pcbc_enc.o \
d02b48c6
RE
71 xcbc_enc.o qud_cksm.o \
72 cfb64ede.o cfb64enc.o cfb_enc.o ecb3_enc.o \
73 enc_read.o enc_writ.o ofb64ede.o ofb64enc.o ofb_enc.o \
74 rand_key.o read_pwd.o read2pwd.o rpc_enc.o str2key.o supp.o
75
76GENERAL_LIT=COPYRIGHT INSTALL README VERSION Makefile des_crypt.man \
77 des.doc options.txt asm
78GENERAL_FULL=$(GENERAL_LIT) FILES Imakefile times vms.com KERBEROS MODES.DES \
58964a49 79 des.man DES.pm DES.pod DES.xs Makefile.PL dess.cpp des3s.cpp \
d02b48c6
RE
80 Makefile.uni typemap t Makefile.ssl makefile.bc Makefile.lit \
81 des.org des_locl.org
82TESTING_LIT= destest speed des_opts
58964a49 83TESTING_FULL= rpw $(TESTING_LIT)
d02b48c6
RE
84TESTING_SRC_LIT=destest.c speed.c des_opts.c
85TESTING_SRC_FULL=rpw.c $(TESTING_SRC_LIT)
86HEADERS_LIT=des_ver.h des.h des_locl.h podd.h sk.h spr.h
87HEADERS_FULL= $(HEADERS_LIT) rpc_des.h
58964a49 88LIBDES_LIT=cbc_enc.c ecb_enc.c fcrypt.c set_key.c des_enc.c fcrypt_b.c
d02b48c6 89LIBDES_FULL= cbc_cksm.c pcbc_enc.c qud_cksm.c \
58964a49 90 cfb64ede.c cfb64enc.c cfb_enc.c ecb3_enc.c \
d02b48c6
RE
91 enc_read.c enc_writ.c ofb64ede.c ofb64enc.c ofb_enc.c \
92 rand_key.c rpc_enc.c str2key.c supp.c \
58964a49 93 xcbc_enc.c $(LIBDES_LIT) read_pwd.c read2pwd.c
d02b48c6
RE
94
95PERL= des.pl testdes.pl doIP doPC1 doPC2 PC1 PC2 shifts.pl
96
97OBJ= $(OBJ_LIT)
98GENERAL=$(GENERAL_LIT)
99TESTING=$(TESTING_LIT)
100TESTING_SRC=$(TESTING_SRC_LIT)
101HEADERS=$(HEADERS_LIT)
102LIBDES= $(LIBDES_LIT)
103
104ALL= $(GENERAL) $(TESTING_SRC) $(LIBDES) $(PERL) $(HEADERS)
105
106DLIB= libdes.a
107
108all: $(DLIB) $(TESTING)
109
110cc:
111 $(MAKE) CC=cc CFLAGS="-O $(OPTS) $(CFLAG)" all
112
113gcc:
114 $(MAKE) CC=gcc CFLAGS="-O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all
115
116x86-elf:
58964a49 117 $(MAKE) DES_ENC='asm/dx86-elf.o asm/yx86-elf.o' CC=$(CC) CFLAGS="-DELF $(OPTS) $(CFLAG)" all
d02b48c6
RE
118
119x86-out:
58964a49 120 $(MAKE) DES_ENC='asm/dx86-out.o asm/yx86-out.o' CC=$(CC) CFLAGS="-DOUT $(OPTS) $(CFLAG)" all
d02b48c6
RE
121
122x86-solaris:
58964a49 123 $(MAKE) DES_ENC='asm/dx86-sol.o asm/yx86-sol.o' CC=$(CC) CFLAGS="-DSOL $(OPTS) $(CFLAG)" all
d02b48c6
RE
124
125x86-bsdi:
58964a49 126 $(MAKE) DES_ENC='asm/dx86bsdi.o asm/yx86bsdi.o' CC=$(CC) CFLAGS="-DBSDI $(OPTS) $(CFLAG)" all
d02b48c6
RE
127
128# elf
58964a49 129asm/dx86-elf.o: asm/dx86unix.cpp
d02b48c6
RE
130 $(CPP) -DELF asm/dx86unix.cpp | $(AS) -o asm/dx86-elf.o
131
58964a49
RE
132asm/yx86-elf.o: asm/yx86unix.cpp
133 $(CPP) -DELF asm/yx86unix.cpp | $(AS) -o asm/yx86-elf.o
d02b48c6
RE
134
135# solaris
58964a49 136asm/dx86-sol.o: asm/dx86unix.cpp
d02b48c6
RE
137 $(CC) -E -DSOL asm/dx86unix.cpp | sed 's/^#.*//' > asm/dx86-sol.s
138 as -o asm/dx86-sol.o asm/dx86-sol.s
139 rm -f asm/dx86-sol.s
140
58964a49
RE
141asm/yx86-sol.o: asm/yx86unix.cpp
142 $(CC) -E -DSOL asm/yx86unix.cpp | sed 's/^#.*//' > asm/yx86-sol.s
143 as -o asm/yx86-sol.o asm/yx86-sol.s
144 rm -f asm/yx86-sol.s
d02b48c6
RE
145
146# a.out
58964a49 147asm/dx86-out.o: asm/dx86unix.cpp
d02b48c6
RE
148 $(CPP) -DOUT asm/dx86unix.cpp | $(AS) -o asm/dx86-out.o
149
58964a49
RE
150asm/yx86-out.o: asm/yx86unix.cpp
151 $(CPP) -DOUT asm/yx86unix.cpp | $(AS) -o asm/yx86-out.o
d02b48c6
RE
152
153# bsdi
58964a49 154asm/dx86bsdi.o: asm/dx86unix.cpp
d02b48c6
RE
155 $(CPP) -DBSDI asm/dx86unix.cpp | $(AS) -o asm/dx86bsdi.o
156
58964a49
RE
157asm/yx86bsdi.o: asm/yx86unix.cpp
158 $(CPP) -DBSDI asm/yx86unix.cpp | $(AS) -o asm/yx86bsdi.o
159
160asm/dx86unix.cpp:
161 (cd asm; perl des-586.pl cpp >dx86unix.cpp)
162
163asm/yx86unix.cpp:
164 (cd asm; perl crypt586.pl cpp >yx86unix.cpp)
d02b48c6
RE
165
166test: all
167 ./destest
168
169$(DLIB): $(OBJ)
170 /bin/rm -f $(DLIB)
171 ar cr $(DLIB) $(OBJ)
172 -if test -s /bin/ranlib; then /bin/ranlib $(DLIB); \
173 else if test -s /usr/bin/ranlib; then /usr/bin/ranlib $(DLIB); \
174 else exit 0; fi; fi
175
176des_opts: des_opts.o $(DLIB)
177 $(CC) $(CFLAGS) -o des_opts des_opts.o $(DLIB)
178
179destest: destest.o $(DLIB)
180 $(CC) $(CFLAGS) -o destest destest.o $(DLIB)
181
182rpw: rpw.o $(DLIB)
183 $(CC) $(CFLAGS) -o rpw rpw.o $(DLIB)
184
185speed: speed.o $(DLIB)
186 $(CC) $(CFLAGS) -o speed speed.o $(DLIB)
187
188des: des.o $(DLIB)
189 $(CC) $(CFLAGS) -o des des.o $(DLIB)
190
191tags:
192 ctags $(TESTING_SRC) $(LIBDES)
193
194tar_lit:
195 /bin/mv Makefile Makefile.tmp
196 /bin/cp Makefile.lit Makefile
197 tar chf libdes-l.tar $(LIBDES_LIT) $(HEADERS_LIT) \
198 $(GENERAL_LIT) $(TESTING_SRC_LIT)
199 /bin/rm -f Makefile
200 /bin/mv Makefile.tmp Makefile
201
202tar:
203 tar chf libdes.tar $(ALL)
204
205shar:
206 shar $(ALL) >libdes.shar
207
208depend:
209 makedepend $(LIBDES) $(TESTING_SRC)
210
211clean:
212 /bin/rm -f *.o tags core $(TESTING) $(DLIB) .nfs* *.old *.bak asm/*.o
213
214dclean:
215 sed -e '/^# DO NOT DELETE THIS LINE/ q' Makefile >Makefile.new
216 mv -f Makefile.new Makefile
217
218# Eric is probably going to choke when he next looks at this --tjh
58964a49 219install:
d02b48c6
RE
220 if test $(INSTALLTOP); then \
221 echo SSL style install; \
222 cp $(DLIB) $(INSTALLTOP)/lib; \
223 if test -s /bin/ranlib; then \
224 /bin/ranlib $(INSTALLTOP)/lib/$(DLIB); \
225 else \
226 if test -s /usr/bin/ranlib; then \
227 /usr/bin/ranlib $(INSTALLTOP)/lib/$(DLIB); \
228 fi; fi; \
229 chmod 644 $(INSTALLTOP)/lib/$(DLIB); \
230 cp des.h $(INSTALLTOP)/include; \
231 chmod 644 $(INSTALLTOP)/include/des.h; \
d02b48c6
RE
232 else \
233 echo Standalone install; \
234 cp $(DLIB) $(LIBDIR)/$(DLIB); \
235 if test -s /bin/ranlib; then \
236 /bin/ranlib $(LIBDIR)/$(DLIB); \
237 else \
238 if test -s /usr/bin/ranlib; then \
239 /usr/bin/ranlib $(LIBDIR)/$(DLIB); \
240 fi; \
241 fi; \
242 chmod 644 $(LIBDIR)/$(DLIB); \
d02b48c6
RE
243 cp des_crypt.man $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
244 chmod 644 $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
245 cp des.man $(MANDIR)/man$(MAN1)/des.$(MAN1); \
246 chmod 644 $(MANDIR)/man$(MAN1)/des.$(MAN1); \
247 cp des.h $(INCDIR)/des.h; \
248 chmod 644 $(INCDIR)/des.h; \
249 fi
250# DO NOT DELETE THIS LINE -- make depend depends on it.