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.
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
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.
22 OPTS0= -DRAND -DTERMIO #-DNOCONST
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
30 # There are 4 possible performance options
33 # -DDES_RISC2 (only one of DES_RISC1 and DES_RISC2)
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
38 #OPTS3= -DDES_RISC1 # or DES_RISC2
41 OPTS= $(OPTS0) $(OPTS1) $(OPTS2) $(OPTS3) $(OPTS4)
48 #CFLAG= -O4 -funroll-loops -fomit-frame-pointer
49 CFLAG= -O3 -fomit-frame-pointer
51 CFLAGS=$(OPTS) $(CFLAG)
55 # Assember version of des_encrypt*().
56 DES_ENC=des_enc.o fcrypt_b.o # normal C version
57 #DES_ENC=asm/dx86-elf.o asm/cx86-elf.o # elf format x86
58 #DES_ENC=asm/dx86-out.o asm/cx86-out.o # a.out format x86
59 #DES_ENC=asm/dx86-sol.o asm/cx86-sol.o # solaris format x86
60 #DES_ENC=asm/dx86bsdi.o asm/cx86basi.o # bsdi format x86
64 INCDIR=/usr/local/include
69 OBJ_LIT=ede_enc.o cbc_enc.o ncbc_enc.o ecb_enc.o $(DES_ENC) fcrypt.o set_key.o
70 OBJ_FULL=cbc3_enc.o cbc_cksm.o $(OBJ_LIT) pcbc_enc.o \
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
76 GENERAL_LIT=COPYRIGHT INSTALL README VERSION Makefile des_crypt.man \
77 des.doc options.txt asm
78 GENERAL_FULL=$(GENERAL_LIT) FILES Imakefile times vms.com KERBEROS MODES.DES \
79 GNUmakefile des.man DES.pm DES.pod DES.xs Makefile.PL \
80 Makefile.uni typemap t Makefile.ssl makefile.bc Makefile.lit \
82 TESTING_LIT= destest speed des_opts
83 TESTING_FULL= destest speed des_opts $(TESTING_LIT)
84 TESTING_SRC_LIT=destest.c speed.c des_opts.c
85 TESTING_SRC_FULL=rpw.c $(TESTING_SRC_LIT)
86 HEADERS_LIT=des_ver.h des.h des_locl.h podd.h sk.h spr.h
87 HEADERS_FULL= $(HEADERS_LIT) rpc_des.h
88 LIBDES_LIT=ede_enc.c cbc_enc.c ncbc_enc.c ecb_enc.c fcrypt.c set_key.c \
90 LIBDES_FULL= cbc_cksm.c pcbc_enc.c qud_cksm.c \
91 cfb64ede.c cfb64enc.c cfb_enc.c ecb3_enc.c cbc3_enc.c \
92 enc_read.c enc_writ.c ofb64ede.c ofb64enc.c ofb_enc.c \
93 rand_key.c rpc_enc.c str2key.c supp.c \
94 xcbc_enc.c $(LIBDES_LIT) read_pwd.c read2pwd.c
96 PERL= des.pl testdes.pl doIP doPC1 doPC2 PC1 PC2 shifts.pl
99 GENERAL=$(GENERAL_FULL)
100 TESTING=$(TESTING_FULL)
101 TESTING_SRC=$(TESTING_SRC_FULL)
102 HEADERS=$(HEADERS_FULL)
103 LIBDES= $(LIBDES_FULL)
105 ALL= $(GENERAL) $(TESTING_SRC) $(LIBDES) $(PERL) $(HEADERS)
109 all: $(DLIB) $(TESTING)
112 $(MAKE) CC=cc CFLAGS="-O $(OPTS) $(CFLAG)" all
115 $(MAKE) CC=gcc CFLAGS="-O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all
118 $(MAKE) DES_ENC='asm/dx86-elf.o asm/cx86-elf.o' CC=$(CC) CFLAGS="-DELF $(OPTS) $(CFLAG)" all
121 $(MAKE) DES_ENC='asm/dx86-out.o asm/cx86-out.o' CC=$(CC) CFLAGS="-DOUT $(OPTS) $(CFLAG)" all
124 $(MAKE) DES_ENC='asm/dx86-sol.o asm/cx86-sol.o' CC=$(CC) CFLAGS="-DSOL $(OPTS) $(CFLAG)" all
127 $(MAKE) DES_ENC='asm/dx86bsdi.o asm/cx86bsdi.o' CC=$(CC) CFLAGS="-DBSDI $(OPTS) $(CFLAG)" all
130 asm/dx86-elf.o: asm/dx86-cpp.s asm/dx86unix.cpp
131 $(CPP) -DELF asm/dx86unix.cpp | $(AS) -o asm/dx86-elf.o
133 asm/cx86-elf.o: asm/cx86-cpp.s asm/cx86unix.cpp
134 $(CPP) -DELF asm/cx86unix.cpp | $(AS) -o asm/cx86-elf.o
137 asm/dx86-sol.o: asm/dx86-cpp.s asm/dx86unix.cpp
138 $(CC) -E -DSOL asm/dx86unix.cpp | sed 's/^#.*//' > asm/dx86-sol.s
139 as -o asm/dx86-sol.o asm/dx86-sol.s
142 asm/cx86-sol.o: asm/cx86-cpp.s asm/cx86unix.cpp
143 $(CC) -E -DSOL asm/cx86unix.cpp | sed 's/^#.*//' > asm/cx86-sol.s
144 as -o asm/cx86-sol.o asm/cx86-sol.s
148 asm/dx86-out.o: asm/dx86-cpp.s asm/dx86unix.cpp
149 $(CPP) -DOUT asm/dx86unix.cpp | $(AS) -o asm/dx86-out.o
151 asm/cx86-out.o: asm/cx86-cpp.s asm/cx86unix.cpp
152 $(CPP) -DOUT asm/cx86unix.cpp | $(AS) -o asm/cx86-out.o
155 asm/dx86bsdi.o: asm/dx86-cpp.s asm/dx86unix.cpp
156 $(CPP) -DBSDI asm/dx86unix.cpp | $(AS) -o asm/dx86bsdi.o
158 asm/cx86bsdi.o: asm/cx86-cpp.s asm/cx86unix.cpp
159 $(CPP) -DBSDI asm/cx86unix.cpp | $(AS) -o asm/cx86bsdi.o
167 -if test -s /bin/ranlib; then /bin/ranlib $(DLIB); \
168 else if test -s /usr/bin/ranlib; then /usr/bin/ranlib $(DLIB); \
171 des_opts: des_opts.o $(DLIB)
172 $(CC) $(CFLAGS) -o des_opts des_opts.o $(DLIB)
174 destest: destest.o $(DLIB)
175 $(CC) $(CFLAGS) -o destest destest.o $(DLIB)
178 $(CC) $(CFLAGS) -o rpw rpw.o $(DLIB)
180 speed: speed.o $(DLIB)
181 $(CC) $(CFLAGS) -o speed speed.o $(DLIB)
184 $(CC) $(CFLAGS) -o des des.o $(DLIB)
187 ctags $(TESTING_SRC) $(LIBDES)
190 /bin/mv Makefile Makefile.tmp
191 /bin/cp Makefile.lit Makefile
192 tar chf libdes-l.tar $(LIBDES_LIT) $(HEADERS_LIT) \
193 $(GENERAL_LIT) $(TESTING_SRC_LIT)
195 /bin/mv Makefile.tmp Makefile
198 tar chf libdes.tar $(ALL)
201 shar $(ALL) >libdes.shar
204 makedepend $(LIBDES) $(TESTING_SRC)
207 /bin/rm -f *.o tags core $(TESTING) $(DLIB) .nfs* *.old *.bak asm/*.o
210 sed -e '/^# DO NOT DELETE THIS LINE/ q' Makefile >Makefile.new
211 mv -f Makefile.new Makefile
213 # Eric is probably going to choke when he next looks at this --tjh
215 if test $(INSTALLTOP); then \
216 echo SSL style install; \
217 cp $(DLIB) $(INSTALLTOP)/lib; \
218 if test -s /bin/ranlib; then \
219 /bin/ranlib $(INSTALLTOP)/lib/$(DLIB); \
221 if test -s /usr/bin/ranlib; then \
222 /usr/bin/ranlib $(INSTALLTOP)/lib/$(DLIB); \
224 chmod 644 $(INSTALLTOP)/lib/$(DLIB); \
225 cp des.h $(INSTALLTOP)/include; \
226 chmod 644 $(INSTALLTOP)/include/des.h; \
227 cp des $(INSTALLTOP)/bin; \
228 chmod 755 $(INSTALLTOP)/bin/des; \
230 echo Standalone install; \
231 cp $(DLIB) $(LIBDIR)/$(DLIB); \
232 if test -s /bin/ranlib; then \
233 /bin/ranlib $(LIBDIR)/$(DLIB); \
235 if test -s /usr/bin/ranlib; then \
236 /usr/bin/ranlib $(LIBDIR)/$(DLIB); \
239 chmod 644 $(LIBDIR)/$(DLIB); \
240 cp des $(BINDIR)/des; \
241 chmod 711 $(BINDIR)/des; \
242 cp des_crypt.man $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
243 chmod 644 $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
244 cp des.man $(MANDIR)/man$(MAN1)/des.$(MAN1); \
245 chmod 644 $(MANDIR)/man$(MAN1)/des.$(MAN1); \
246 cp des.h $(INCDIR)/des.h; \
247 chmod 644 $(INCDIR)/des.h; \
249 # DO NOT DELETE THIS LINE -- make depend depends on it.