head	1.2;
access;
symbols
	perseant-exfatfs-base-20250801:1.2
	perseant-exfatfs-base-20240630:1.2
	perseant-exfatfs:1.2.0.38
	perseant-exfatfs-base:1.2
	cjep_sun2x:1.2.0.36
	cjep_sun2x-base:1.2
	cjep_staticlib_x-base1:1.2
	cjep_staticlib_x:1.2.0.34
	cjep_staticlib_x-base:1.2
	phil-wifi-20200421:1.2
	phil-wifi-20200411:1.2
	phil-wifi-20200406:1.2
	pgoyette-compat-merge-20190127:1.2
	pgoyette-compat-20190127:1.2
	pgoyette-compat-20190118:1.2
	pgoyette-compat-1226:1.2
	pgoyette-compat-1126:1.2
	pgoyette-compat-1020:1.2
	pgoyette-compat-0930:1.2
	pgoyette-compat-0906:1.2
	pgoyette-compat-0728:1.2
	pgoyette-compat-0625:1.2
	pgoyette-compat-0521:1.2
	pgoyette-compat-0502:1.2
	pgoyette-compat-0422:1.2
	pgoyette-compat-0415:1.2
	pgoyette-compat-0407:1.2
	pgoyette-compat-0330:1.2
	pgoyette-compat-0322:1.2
	pgoyette-compat-0315:1.2
	pgoyette-compat:1.2.0.32
	pgoyette-compat-base:1.2
	perseant-stdc-iso10646:1.2.0.30
	perseant-stdc-iso10646-base:1.2
	prg-localcount2-base3:1.2
	prg-localcount2-base2:1.2
	prg-localcount2-base1:1.2
	prg-localcount2:1.2.0.28
	prg-localcount2-base:1.2
	pgoyette-localcount-20170426:1.2
	bouyer-socketcan-base1:1.2
	pgoyette-localcount-20170320:1.2
	bouyer-socketcan:1.2.0.26
	bouyer-socketcan-base:1.2
	pgoyette-localcount-20170107:1.2
	pgoyette-localcount-20161104:1.2
	localcount-20160914:1.2
	pgoyette-localcount-20160806:1.2
	pgoyette-localcount-20160726:1.2
	pgoyette-localcount:1.2.0.24
	pgoyette-localcount-base:1.2
	netbsd-5-2-3-RELEASE:1.2
	netbsd-5-1-5-RELEASE:1.2
	yamt-pagecache-base9:1.2
	yamt-pagecache-tag8:1.2
	tls-earlyentropy:1.2.0.20
	tls-earlyentropy-base:1.2
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.2
	riastradh-drm2-base3:1.2
	netbsd-5-2-2-RELEASE:1.2
	netbsd-5-1-4-RELEASE:1.2
	netbsd-5-2-1-RELEASE:1.2
	netbsd-5-1-3-RELEASE:1.2
	agc-symver:1.2.0.22
	agc-symver-base:1.2
	tls-maxphys-base:1.2
	yamt-pagecache-base8:1.2
	netbsd-5-2:1.2.0.18
	yamt-pagecache-base7:1.2
	netbsd-5-2-RELEASE:1.2
	netbsd-5-2-RC1:1.2
	yamt-pagecache-base6:1.2
	yamt-pagecache-base5:1.2
	yamt-pagecache-base4:1.2
	netbsd-5-1-2-RELEASE:1.2
	netbsd-5-1-1-RELEASE:1.2
	yamt-pagecache-base3:1.2
	yamt-pagecache-base2:1.2
	yamt-pagecache:1.2.0.4
	yamt-pagecache-base:1.2
	bouyer-quota2-nbase:1.2
	bouyer-quota2:1.2.0.16
	bouyer-quota2-base:1.2
	matt-nb5-pq3:1.2.0.14
	matt-nb5-pq3-base:1.2
	netbsd-5-1:1.2.0.12
	netbsd-5-1-RELEASE:1.2
	netbsd-5-1-RC4:1.2
	netbsd-5-1-RC3:1.2
	netbsd-5-1-RC2:1.2
	netbsd-5-1-RC1:1.2
	netbsd-5-0-2-RELEASE:1.2
	netbsd-5-0-1-RELEASE:1.2
	jym-xensuspend-nbase:1.2
	netbsd-5-0:1.2.0.10
	netbsd-5-0-RELEASE:1.2
	netbsd-5-0-RC4:1.2
	netbsd-5-0-RC3:1.2
	netbsd-5-0-RC2:1.2
	jym-xensuspend:1.2.0.8
	jym-xensuspend-base:1.2
	netbsd-5-0-RC1:1.2
	netbsd-5:1.2.0.6
	netbsd-5-base:1.2
	matt-mips64:1.1.1.1.0.36
	netbsd-4-0-1-RELEASE:1.1.1.1
	wrstuden-fixsa-newbase:1.1.1.1
	yamt-pf42-base4:1.2
	yamt-pf42-base3:1.2
	hpcarm-cleanup-nbase:1.2
	yamt-pf42-base2:1.2
	yamt-pf42:1.2.0.2
	yamt-pf42-base:1.2
	keiichi-mipv6:1.1.1.1.0.34
	keiichi-mipv6-base:1.1.1.1
	matt-armv6-nbase:1.1.1.1
	matt-armv6-prevmlocking:1.1.1.1
	wrstuden-fixsa-base-1:1.1.1.1
	netbsd-4-0:1.1.1.1.0.32
	netbsd-4-0-RELEASE:1.1.1.1
	cube-autoconf:1.1.1.1.0.30
	cube-autoconf-base:1.1.1.1
	netbsd-4-0-RC5:1.1.1.1
	netbsd-4-0-RC4:1.1.1.1
	netbsd-4-0-RC3:1.1.1.1
	netbsd-4-0-RC2:1.1.1.1
	netbsd-4-0-RC1:1.1.1.1
	matt-armv6:1.1.1.1.0.28
	matt-armv6-base:1.1.1.1
	matt-mips64-base:1.1.1.1
	hpcarm-cleanup:1.1.1.1.0.26
	hpcarm-cleanup-base:1.1.1.1
	netbsd-3-1-1-RELEASE:1.1.1.1
	netbsd-3-0-3-RELEASE:1.1.1.1
	wrstuden-fixsa:1.1.1.1.0.24
	wrstuden-fixsa-base:1.1.1.1
	abandoned-netbsd-4-base:1.1.1.1
	abandoned-netbsd-4:1.1.1.1.0.18
	netbsd-3-1:1.1.1.1.0.20
	netbsd-3-1-RELEASE:1.1.1.1
	netbsd-3-0-2-RELEASE:1.1.1.1
	netbsd-3-1-RC4:1.1.1.1
	netbsd-3-1-RC3:1.1.1.1
	netbsd-3-1-RC2:1.1.1.1
	netbsd-3-1-RC1:1.1.1.1
	netbsd-4:1.1.1.1.0.22
	netbsd-4-base:1.1.1.1
	netbsd-3-0-1-RELEASE:1.1.1.1
	netbsd-3-0:1.1.1.1.0.16
	netbsd-3-0-RELEASE:1.1.1.1
	netbsd-3-0-RC6:1.1.1.1
	netbsd-3-0-RC5:1.1.1.1
	netbsd-3-0-RC4:1.1.1.1
	netbsd-3-0-RC3:1.1.1.1
	netbsd-3-0-RC2:1.1.1.1
	netbsd-3-0-RC1:1.1.1.1
	netbsd-2-0-3-RELEASE:1.1.1.1
	netbsd-2-1:1.1.1.1.0.14
	netbsd-2-1-RELEASE:1.1.1.1
	netbsd-2-1-RC6:1.1.1.1
	netbsd-2-1-RC5:1.1.1.1
	netbsd-2-1-RC4:1.1.1.1
	netbsd-2-1-RC3:1.1.1.1
	netbsd-2-1-RC2:1.1.1.1
	netbsd-2-1-RC1:1.1.1.1
	netbsd-2-0-2-RELEASE:1.1.1.1
	netbsd-3:1.1.1.1.0.12
	netbsd-3-base:1.1.1.1
	netbsd-2-0-1-RELEASE:1.1.1.1
	netbsd-2:1.1.1.1.0.10
	netbsd-2-base:1.1.1.1
	netbsd-2-0-RELEASE:1.1.1.1
	netbsd-2-0-RC5:1.1.1.1
	netbsd-2-0-RC4:1.1.1.1
	netbsd-2-0-RC3:1.1.1.1
	netbsd-2-0-RC2:1.1.1.1
	netbsd-2-0-RC1:1.1.1.1
	heimdal-1-6-3-merge-to-netbsd-2-0-top:1.1.1.1
	heimdal-0-6-3:1.1.1.1
	heimdal-0-6-2-merge-to-netbsd-2-0:1.1.1.1
	heimdal-0-6-2:1.1.1.1
	heimdal-1-6-1-merge-to-netbsd-2-0:1.1.1.1
	heimdal-0-6-1:1.1.1.1
	netbsd-2-0:1.1.1.1.0.8
	netbsd-2-0-base:1.1.1.1
	netbsd-1-6-PATCH002-RELEASE:1.1.1.1
	netbsd-1-6-PATCH002:1.1.1.1
	netbsd-1-6-PATCH002-RC4:1.1.1.1
	netbsd-1-6-PATCH002-RC3:1.1.1.1
	netbsd-1-6-PATCH002-RC2:1.1.1.1
	netbsd-1-6-PATCH002-RC1:1.1.1.1
	heimdal-0-6:1.1.1.1
	netbsd-1-6-PATCH001:1.1.1.1
	netbsd-1-6-PATCH001-RELEASE:1.1.1.1
	netbsd-1-6-PATCH001-RC3:1.1.1.1
	netbsd-1-6-PATCH001-RC2:1.1.1.1
	netbsd-1-6-PATCH001-RC1:1.1.1.1
	fvdl_fs64_base:1.1.1.1
	heimdal-0-5:1.1.1.1
	netbsd-1-6-RELEASE:1.1.1.1
	netbsd-1-6-RC3:1.1.1.1
	netbsd-1-6-RC2:1.1.1.1
	netbsd-1-6-RC1:1.1.1.1
	netbsd-1-6:1.1.1.1.0.6
	netbsd-1-6-base:1.1.1.1
	netbsd-1-5-PATCH003:1.1.1.1
	v0-4e:1.1.1.1
	netbsd-1-5-PATCH002:1.1.1.1
	v0-3f:1.1.1.1
	netbsd-1-5-PATCH001:1.1.1.1
	v0-3e:1.1.1.1
	netbsd-1-5-RELEASE:1.1.1.1
	netbsd-1-5-BETA2:1.1.1.1
	netbsd-1-5-BETA:1.1.1.1
	netbsd-1-5-ALPHA2:1.1.1.1
	v0-3a:1.1.1.1
	minoura-xpg4dl:1.1.1.1.0.4
	minoura-xpg4dl-base:1.1.1.1
	netbsd-1-5:1.1.1.1.0.2
	netbsd-1-5-base:1.1.1.1
	v0-2t-netbsd-cryptosrc-intl:1.1.1.1
	HEIMDAL:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2008.03.22.08.37.07;	author mlelstv;	state dead;
branches;
next	1.1;

1.1
date	2000.06.16.18.32.22;	author thorpej;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.06.16.18.32.22;	author thorpej;	state Exp;
branches
	1.1.1.1.4.1;
next	;

1.1.1.1.4.1
date	2000.06.16.18.32.22;	author thorpej;	state dead;
branches;
next	1.1.1.1.4.2;

1.1.1.1.4.2
date	2000.06.16.18.32.23;	author thorpej;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Import Heimdal-1.1
@
text
@# You must select the correct terminal control system to be used to
# turn character echo off when reading passwords.  There a 5 systems
# SGTTY   - the old BSD system
# TERMIO  - most system V boxes
# TERMIOS - SGI (ala IRIX).
# VMS     - the DEC operating system
# MSDOS   - we all know what it is :-)
# read_pwd.c makes a reasonable guess at what is correct.

# If you are on a DEC Alpha, edit des.h and change the DES_LONG
# define to 'unsigned int'.  I have seen this give a %20 speedup.

OPTS0= -DRAND -DTERMIO #-DNOCONST

# Version 1.94 has changed the strings_to_key function so that it is
# now compatible with MITs when the string is longer than 8 characters.
# If you wish to keep the old version, uncomment the following line.
# This will affect the -E/-D options on des(1).
#OPTS1= -DOLD_STR_TO_KEY

# There are 4 possible performance options
# -DDES_PTR
# -DDES_RISC1
# -DDES_RISC2 (only one of DES_RISC1 and DES_RISC2)
# -DDES_UNROLL
# after the initial build, run 'des_opts' to see which options are best
# for your platform.  There are some listed in options.txt
#OPTS2= -DDES_PTR 
#OPTS3= -DDES_RISC1 # or DES_RISC2
OPTS4= -DDES_UNROLL

OPTS= $(OPTS0) $(OPTS1) $(OPTS2) $(OPTS3) $(OPTS4)

CC=cc
CFLAGS= -D_HPUX_SOURCE -Aa +O2 $(OPTS) $(CFLAG)

#CC=gcc
#CFLAGS= -O3 -fomit-frame-pointer $(OPTS) $(CFLAG)

CPP=$(CC) -E

DES_ENC=des_enc.o	# normal C version
#DES_ENC=asm/dx86-elf.o	# elf format x86
#DES_ENC=asm/dx86-out.o	# a.out format x86
#DES_ENC=asm/dx86-sol.o	# solaris format x86 
#DES_ENC=asm/dx86bsdi.o	# bsdi format x86 

LIBDIR=/usr/local/lib
BINDIR=/usr/local/bin
INCDIR=/usr/local/include
MANDIR=/usr/local/man
MAN1=1
MAN3=3
SHELL=/bin/sh
OBJS=	cbc3_enc.o cbc_cksm.o cbc_enc.o ncbc_enc.o pcbc_enc.o qud_cksm.o \
	cfb64ede.o cfb64enc.o cfb_enc.o ecb3_enc.o ecb_enc.o  ede_enc.o  \
	enc_read.o enc_writ.o fcrypt.o  ofb64ede.o ofb64enc.o ofb_enc.o  \
	rand_key.o read_pwd.o set_key.o rpc_enc.o  str2key.o supp.o \
	$(DES_ENC) xcbc_enc.o

GENERAL=$(GENERAL_LIT) FILES Imakefile times vms.com KERBEROS MODES.DES \
	GNUmakefile des.man DES.pm DES.pod DES.xs Makefile.PL \
	Makefile.uni typemap t Makefile.ssl makefile.bc Makefile.lit \
	des.org des_locl.org
DES=	des.c
TESTING=rpw.c $(TESTING_LIT)
HEADERS= $(HEADERS_LIT) rpc_des.h
LIBDES= cbc_cksm.c pcbc_enc.c qud_cksm.c \
	cfb64ede.c cfb64enc.c cfb_enc.c ecb3_enc.c  cbc3_enc.c  \
	enc_read.c enc_writ.c ofb64ede.c ofb64enc.c ofb_enc.c  \
	rand_key.c rpc_enc.c  str2key.c  supp.c \
	xcbc_enc.c $(LIBDES_LIT) read_pwd.c

TESTING_LIT=destest.c speed.c des_opts.c
GENERAL_LIT=COPYRIGHT INSTALL README VERSION Makefile des_crypt.man \
	des.doc options.txt asm
HEADERS_LIT=des_ver.h des.h des_locl.h podd.h sk.h spr.h
LIBDES_LIT=ede_enc.c cbc_enc.c ncbc_enc.c ecb_enc.c fcrypt.c set_key.c des_enc.c

PERL=	des.pl testdes.pl doIP doIP2 doPC1 doPC2 PC1 PC2 shifts.pl

ALL=	$(GENERAL) $(DES) $(TESTING) $(LIBDES) $(PERL) $(HEADERS)

DLIB=	libdes.a

all: $(DLIB) destest rpw des speed des_opts

cc:
	make CC=cc CFLAGS="-O $(OPTS) $(CFLAG)" all

gcc:
	make CC=gcc CFLAGS="-O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all

x86-elf:
	make DES_ENC=asm/dx86-elf.o CC=gcc CFLAGS="-DELF -O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all

x86-out:
	make DES_ENC=asm/dx86-out.o CC=gcc CFLAGS="-DOUT -O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all

x86-solaris:
	make DES_ENC=asm/dx86-sol.o CFLAGS="-DSOL -O  $(OPTS) $(CFLAG)" all

x86-bsdi:
	make DES_ENC=asm/dx86bsdi.o CC=gcc CFLAGS="-DBSDI -O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all

asm/dx86-elf.o: asm/dx86-cpp.s asm/dx86unix.cpp
	$(CPP) -DELF asm/dx86unix.cpp | as -o asm/dx86-elf.o

asm/dx86-sol.o: asm/dx86-cpp.s asm/dx86unix.cpp
	$(CPP) -DSOL asm/dx86unix.cpp | as -o asm/dx86-sol.o

asm/dx86-out.o: asm/dx86-cpp.s asm/dx86unix.cpp
	$(CPP) -DOUT asm/dx86unix.cpp | as -o asm/dx86-out.o

asm/dx86bsdi.o: asm/dx86-cpp.s asm/dx86unix.cpp
	$(CPP) -DBSDI asm/dx86unix.cpp | as -o asm/dx86bsdi.o

test:	all
	./destest

$(DLIB): $(OBJS)
	/bin/rm -f $(DLIB)
	ar cr $(DLIB) $(OBJS)
	-if test -s /bin/ranlib; then /bin/ranlib $(DLIB); \
	else if test -s /usr/bin/ranlib; then /usr/bin/ranlib $(DLIB); \
	else exit 0; fi; fi

des_opts: des_opts.o libdes.a
	$(CC) $(CFLAGS) -o des_opts des_opts.o libdes.a

destest: destest.o libdes.a
	$(CC) $(CFLAGS) -o destest destest.o libdes.a

rpw: rpw.o libdes.a
	$(CC) $(CFLAGS) -o rpw rpw.o libdes.a

speed: speed.o libdes.a
	$(CC) $(CFLAGS) -o speed speed.o libdes.a

des: des.o libdes.a
	$(CC) $(CFLAGS) -o des des.o libdes.a

tags:
	ctags $(DES) $(TESTING) $(LIBDES)

tar_lit:
	/bin/mv Makefile Makefile.tmp
	/bin/cp Makefile.lit Makefile
	tar chf libdes-l.tar $(LIBDES_LIT) $(HEADERS_LIT) \
		$(GENERAL_LIT) $(TESTING_LIT)
	/bin/rm -f Makefile
	/bin/mv Makefile.tmp Makefile

tar:
	tar chf libdes.tar $(ALL)

shar:
	shar $(ALL) >libdes.shar

depend:
	makedepend $(LIBDES) $(DES) $(TESTING)

clean:
	/bin/rm -f *.o tags core rpw destest des speed $(DLIB) .nfs* *.old \
	*.bak destest rpw des_opts asm/*.o 

dclean:
	sed -e '/^# DO NOT DELETE THIS LINE/ q' Makefile >Makefile.new
	mv -f Makefile.new Makefile

# Eric is probably going to choke when he next looks at this --tjh
install: $(DLIB) des
	if test $(INSTALLTOP); then \
	    echo SSL style install; \
	    cp $(DLIB) $(INSTALLTOP)/lib; \
	    if test -s /bin/ranlib; then \
	        /bin/ranlib $(INSTALLTOP)/lib/$(DLIB); \
	    else \
		if test -s /usr/bin/ranlib; then \
		/usr/bin/ranlib $(INSTALLTOP)/lib/$(DLIB); \
	    fi; fi; \
	    chmod 644 $(INSTALLTOP)/lib/$(DLIB); \
	    cp des.h $(INSTALLTOP)/include; \
	    chmod 644 $(INSTALLTOP)/include/des.h; \
	    cp des $(INSTALLTOP)/bin; \
	    chmod 755 $(INSTALLTOP)/bin/des; \
	else \
	    echo Standalone install; \
	    cp $(DLIB) $(LIBDIR)/$(DLIB); \
	    if test -s /bin/ranlib; then \
	      /bin/ranlib $(LIBDIR)/$(DLIB); \
	    else \
	      if test -s /usr/bin/ranlib; then \
		/usr/bin/ranlib $(LIBDIR)/$(DLIB); \
	      fi; \
	    fi; \
	    chmod 644 $(LIBDIR)/$(DLIB); \
	    cp des $(BINDIR)/des; \
	    chmod 711 $(BINDIR)/des; \
	    cp des_crypt.man $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
	    chmod 644 $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
	    cp des.man $(MANDIR)/man$(MAN1)/des.$(MAN1); \
	    chmod 644 $(MANDIR)/man$(MAN1)/des.$(MAN1); \
	    cp des.h $(INCDIR)/des.h; \
	    chmod 644 $(INCDIR)/des.h; \
	fi
# DO NOT DELETE THIS LINE -- make depend depends on it.
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@Import Heimdal Kerberos 5 from cryptosrc-intl.
@
text
@@


1.1.1.1.4.1
log
@file Makefile.uni was added on branch minoura-xpg4dl on 2000-06-16 18:32:23 +0000
@
text
@d1 207
@


1.1.1.1.4.2
log
@Import Heimdal Kerberos 5 from cryptosrc-intl.
@
text
@a0 207
# You must select the correct terminal control system to be used to
# turn character echo off when reading passwords.  There a 5 systems
# SGTTY   - the old BSD system
# TERMIO  - most system V boxes
# TERMIOS - SGI (ala IRIX).
# VMS     - the DEC operating system
# MSDOS   - we all know what it is :-)
# read_pwd.c makes a reasonable guess at what is correct.

# If you are on a DEC Alpha, edit des.h and change the DES_LONG
# define to 'unsigned int'.  I have seen this give a %20 speedup.

OPTS0= -DRAND -DTERMIO #-DNOCONST

# Version 1.94 has changed the strings_to_key function so that it is
# now compatible with MITs when the string is longer than 8 characters.
# If you wish to keep the old version, uncomment the following line.
# This will affect the -E/-D options on des(1).
#OPTS1= -DOLD_STR_TO_KEY

# There are 4 possible performance options
# -DDES_PTR
# -DDES_RISC1
# -DDES_RISC2 (only one of DES_RISC1 and DES_RISC2)
# -DDES_UNROLL
# after the initial build, run 'des_opts' to see which options are best
# for your platform.  There are some listed in options.txt
#OPTS2= -DDES_PTR 
#OPTS3= -DDES_RISC1 # or DES_RISC2
OPTS4= -DDES_UNROLL

OPTS= $(OPTS0) $(OPTS1) $(OPTS2) $(OPTS3) $(OPTS4)

CC=cc
CFLAGS= -D_HPUX_SOURCE -Aa +O2 $(OPTS) $(CFLAG)

#CC=gcc
#CFLAGS= -O3 -fomit-frame-pointer $(OPTS) $(CFLAG)

CPP=$(CC) -E

DES_ENC=des_enc.o	# normal C version
#DES_ENC=asm/dx86-elf.o	# elf format x86
#DES_ENC=asm/dx86-out.o	# a.out format x86
#DES_ENC=asm/dx86-sol.o	# solaris format x86 
#DES_ENC=asm/dx86bsdi.o	# bsdi format x86 

LIBDIR=/usr/local/lib
BINDIR=/usr/local/bin
INCDIR=/usr/local/include
MANDIR=/usr/local/man
MAN1=1
MAN3=3
SHELL=/bin/sh
OBJS=	cbc3_enc.o cbc_cksm.o cbc_enc.o ncbc_enc.o pcbc_enc.o qud_cksm.o \
	cfb64ede.o cfb64enc.o cfb_enc.o ecb3_enc.o ecb_enc.o  ede_enc.o  \
	enc_read.o enc_writ.o fcrypt.o  ofb64ede.o ofb64enc.o ofb_enc.o  \
	rand_key.o read_pwd.o set_key.o rpc_enc.o  str2key.o supp.o \
	$(DES_ENC) xcbc_enc.o

GENERAL=$(GENERAL_LIT) FILES Imakefile times vms.com KERBEROS MODES.DES \
	GNUmakefile des.man DES.pm DES.pod DES.xs Makefile.PL \
	Makefile.uni typemap t Makefile.ssl makefile.bc Makefile.lit \
	des.org des_locl.org
DES=	des.c
TESTING=rpw.c $(TESTING_LIT)
HEADERS= $(HEADERS_LIT) rpc_des.h
LIBDES= cbc_cksm.c pcbc_enc.c qud_cksm.c \
	cfb64ede.c cfb64enc.c cfb_enc.c ecb3_enc.c  cbc3_enc.c  \
	enc_read.c enc_writ.c ofb64ede.c ofb64enc.c ofb_enc.c  \
	rand_key.c rpc_enc.c  str2key.c  supp.c \
	xcbc_enc.c $(LIBDES_LIT) read_pwd.c

TESTING_LIT=destest.c speed.c des_opts.c
GENERAL_LIT=COPYRIGHT INSTALL README VERSION Makefile des_crypt.man \
	des.doc options.txt asm
HEADERS_LIT=des_ver.h des.h des_locl.h podd.h sk.h spr.h
LIBDES_LIT=ede_enc.c cbc_enc.c ncbc_enc.c ecb_enc.c fcrypt.c set_key.c des_enc.c

PERL=	des.pl testdes.pl doIP doIP2 doPC1 doPC2 PC1 PC2 shifts.pl

ALL=	$(GENERAL) $(DES) $(TESTING) $(LIBDES) $(PERL) $(HEADERS)

DLIB=	libdes.a

all: $(DLIB) destest rpw des speed des_opts

cc:
	make CC=cc CFLAGS="-O $(OPTS) $(CFLAG)" all

gcc:
	make CC=gcc CFLAGS="-O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all

x86-elf:
	make DES_ENC=asm/dx86-elf.o CC=gcc CFLAGS="-DELF -O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all

x86-out:
	make DES_ENC=asm/dx86-out.o CC=gcc CFLAGS="-DOUT -O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all

x86-solaris:
	make DES_ENC=asm/dx86-sol.o CFLAGS="-DSOL -O  $(OPTS) $(CFLAG)" all

x86-bsdi:
	make DES_ENC=asm/dx86bsdi.o CC=gcc CFLAGS="-DBSDI -O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all

asm/dx86-elf.o: asm/dx86-cpp.s asm/dx86unix.cpp
	$(CPP) -DELF asm/dx86unix.cpp | as -o asm/dx86-elf.o

asm/dx86-sol.o: asm/dx86-cpp.s asm/dx86unix.cpp
	$(CPP) -DSOL asm/dx86unix.cpp | as -o asm/dx86-sol.o

asm/dx86-out.o: asm/dx86-cpp.s asm/dx86unix.cpp
	$(CPP) -DOUT asm/dx86unix.cpp | as -o asm/dx86-out.o

asm/dx86bsdi.o: asm/dx86-cpp.s asm/dx86unix.cpp
	$(CPP) -DBSDI asm/dx86unix.cpp | as -o asm/dx86bsdi.o

test:	all
	./destest

$(DLIB): $(OBJS)
	/bin/rm -f $(DLIB)
	ar cr $(DLIB) $(OBJS)
	-if test -s /bin/ranlib; then /bin/ranlib $(DLIB); \
	else if test -s /usr/bin/ranlib; then /usr/bin/ranlib $(DLIB); \
	else exit 0; fi; fi

des_opts: des_opts.o libdes.a
	$(CC) $(CFLAGS) -o des_opts des_opts.o libdes.a

destest: destest.o libdes.a
	$(CC) $(CFLAGS) -o destest destest.o libdes.a

rpw: rpw.o libdes.a
	$(CC) $(CFLAGS) -o rpw rpw.o libdes.a

speed: speed.o libdes.a
	$(CC) $(CFLAGS) -o speed speed.o libdes.a

des: des.o libdes.a
	$(CC) $(CFLAGS) -o des des.o libdes.a

tags:
	ctags $(DES) $(TESTING) $(LIBDES)

tar_lit:
	/bin/mv Makefile Makefile.tmp
	/bin/cp Makefile.lit Makefile
	tar chf libdes-l.tar $(LIBDES_LIT) $(HEADERS_LIT) \
		$(GENERAL_LIT) $(TESTING_LIT)
	/bin/rm -f Makefile
	/bin/mv Makefile.tmp Makefile

tar:
	tar chf libdes.tar $(ALL)

shar:
	shar $(ALL) >libdes.shar

depend:
	makedepend $(LIBDES) $(DES) $(TESTING)

clean:
	/bin/rm -f *.o tags core rpw destest des speed $(DLIB) .nfs* *.old \
	*.bak destest rpw des_opts asm/*.o 

dclean:
	sed -e '/^# DO NOT DELETE THIS LINE/ q' Makefile >Makefile.new
	mv -f Makefile.new Makefile

# Eric is probably going to choke when he next looks at this --tjh
install: $(DLIB) des
	if test $(INSTALLTOP); then \
	    echo SSL style install; \
	    cp $(DLIB) $(INSTALLTOP)/lib; \
	    if test -s /bin/ranlib; then \
	        /bin/ranlib $(INSTALLTOP)/lib/$(DLIB); \
	    else \
		if test -s /usr/bin/ranlib; then \
		/usr/bin/ranlib $(INSTALLTOP)/lib/$(DLIB); \
	    fi; fi; \
	    chmod 644 $(INSTALLTOP)/lib/$(DLIB); \
	    cp des.h $(INSTALLTOP)/include; \
	    chmod 644 $(INSTALLTOP)/include/des.h; \
	    cp des $(INSTALLTOP)/bin; \
	    chmod 755 $(INSTALLTOP)/bin/des; \
	else \
	    echo Standalone install; \
	    cp $(DLIB) $(LIBDIR)/$(DLIB); \
	    if test -s /bin/ranlib; then \
	      /bin/ranlib $(LIBDIR)/$(DLIB); \
	    else \
	      if test -s /usr/bin/ranlib; then \
		/usr/bin/ranlib $(LIBDIR)/$(DLIB); \
	      fi; \
	    fi; \
	    chmod 644 $(LIBDIR)/$(DLIB); \
	    cp des $(BINDIR)/des; \
	    chmod 711 $(BINDIR)/des; \
	    cp des_crypt.man $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
	    chmod 644 $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
	    cp des.man $(MANDIR)/man$(MAN1)/des.$(MAN1); \
	    chmod 644 $(MANDIR)/man$(MAN1)/des.$(MAN1); \
	    cp des.h $(INCDIR)/des.h; \
	    chmod 644 $(INCDIR)/des.h; \
	fi
# DO NOT DELETE THIS LINE -- make depend depends on it.
@
