summaryrefslogtreecommitdiffstats
path: root/secure/lib/libdes/Makefile.uni
blob: 972a84505af2beb05dfb741e9b3b8850866e25b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# 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.

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

# This #define specifies the use of an alternative D_ENCRYPT macro in
# ecb_encrypt.  The choice of macro can make a %20 difference in the
# speed.  Unfortunatly the choise of the best macro appears to be very
# dependant on the compiler and the machine in question.
# For the following combinations use the ALT_ECB option.
# Sparc 2 (cc -O4), sun 3/260 (cc -O4)
# For the following combinations do not use the ALT_ECB option.
# Sparc 2 (gcc2 -O2), sun 3/260 (cc -O2), mvax2 (cc -O), MSDOS (Turbo Cv2)
# For other machines, experiment with changing the option and run
# ./speed to see which is faster.
# DO NOT TURN THIS OPTION ON WHEN COMPILING THIS CODE ON A 64 BIT MACHINE
#OPTS2= -DDES_USE_PTR

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

#CC=cc
#CFLAGS= -O $(OPTS) $(CFLAG)

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

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

GENERAL=COPYRIGHT FILES INSTALL Imakefile README VERSION Makefile \
	times vms.com KERBEROS MODES.DES  GNUmakefile des.man \
	DES.pm DES.pod DES.xs Makefile.PL Makefile.uni typemap t \
	des_crypt.man Makefile.ssl des.doc makefile.bc
DES=	des.c
TESTING=destest.c speed.c rpw.c
HEADERS=version.h des.h des_locl.h podd.h sk.h spr.h rpc_des.h
LIBDES= cbc3_enc.c cbc_cksm.c cbc_enc.c ncbc_enc.c pcbc_enc.c qud_cksm.c \
	cfb64ede.c cfb64enc.c cfb_enc.c ecb3_enc.c ecb_enc.c  ede_enc.c  \
	enc_read.c enc_writ.c fcrypt.c  ofb64ede.c ofb64enc.c ofb_enc.c  \
	rand_key.c read_pwd.c set_key.c rpc_enc.c  str2key.c  supp.c

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

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

DLIB=	libdes.a

all: $(DLIB) destest rpw des speed

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

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:
	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 speed

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.
OpenPOWER on IntegriCloud