Merge from vendor branch CVS:
[dragonfly.git] / crypto / heimdal-0.6.3 / lib / des / Makefile.uni
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 # If you are on a DEC Alpha, edit des.h and change the DES_LONG
11 # define to 'unsigned int'.  I have seen this give a %20 speedup.
12
13 OPTS0= -DRAND -DTERMIO #-DNOCONST
14
15 # Version 1.94 has changed the strings_to_key function so that it is
16 # now compatible with MITs when the string is longer than 8 characters.
17 # If you wish to keep the old version, uncomment the following line.
18 # This will affect the -E/-D options on des(1).
19 #OPTS1= -DOLD_STR_TO_KEY
20
21 # There are 4 possible performance options
22 # -DDES_PTR
23 # -DDES_RISC1
24 # -DDES_RISC2 (only one of DES_RISC1 and DES_RISC2)
25 # -DDES_UNROLL
26 # after the initial build, run 'des_opts' to see which options are best
27 # for your platform.  There are some listed in options.txt
28 #OPTS2= -DDES_PTR 
29 #OPTS3= -DDES_RISC1 # or DES_RISC2
30 OPTS4= -DDES_UNROLL
31
32 OPTS= $(OPTS0) $(OPTS1) $(OPTS2) $(OPTS3) $(OPTS4)
33
34 CC=cc
35 CFLAGS= -D_HPUX_SOURCE -Aa +O2 $(OPTS) $(CFLAG)
36
37 #CC=gcc
38 #CFLAGS= -O3 -fomit-frame-pointer $(OPTS) $(CFLAG)
39
40 CPP=$(CC) -E
41
42 DES_ENC=des_enc.o       # normal C version
43 #DES_ENC=asm/dx86-elf.o # elf format x86
44 #DES_ENC=asm/dx86-out.o # a.out format x86
45 #DES_ENC=asm/dx86-sol.o # solaris format x86 
46 #DES_ENC=asm/dx86bsdi.o # bsdi format x86 
47
48 LIBDIR=/usr/local/lib
49 BINDIR=/usr/local/bin
50 INCDIR=/usr/local/include
51 MANDIR=/usr/local/man
52 MAN1=1
53 MAN3=3
54 SHELL=/bin/sh
55 OBJS=   cbc3_enc.o cbc_cksm.o cbc_enc.o ncbc_enc.o pcbc_enc.o qud_cksm.o \
56         cfb64ede.o cfb64enc.o cfb_enc.o ecb3_enc.o ecb_enc.o  ede_enc.o  \
57         enc_read.o enc_writ.o fcrypt.o  ofb64ede.o ofb64enc.o ofb_enc.o  \
58         rand_key.o read_pwd.o set_key.o rpc_enc.o  str2key.o supp.o \
59         $(DES_ENC) xcbc_enc.o
60
61 GENERAL=$(GENERAL_LIT) FILES Imakefile times vms.com KERBEROS MODES.DES \
62         GNUmakefile des.man DES.pm DES.pod DES.xs Makefile.PL \
63         Makefile.uni typemap t Makefile.ssl makefile.bc Makefile.lit \
64         des.org des_locl.org
65 DES=    des.c
66 TESTING=rpw.c $(TESTING_LIT)
67 HEADERS= $(HEADERS_LIT) rpc_des.h
68 LIBDES= cbc_cksm.c pcbc_enc.c qud_cksm.c \
69         cfb64ede.c cfb64enc.c cfb_enc.c ecb3_enc.c  cbc3_enc.c  \
70         enc_read.c enc_writ.c ofb64ede.c ofb64enc.c ofb_enc.c  \
71         rand_key.c rpc_enc.c  str2key.c  supp.c \
72         xcbc_enc.c $(LIBDES_LIT) read_pwd.c
73
74 TESTING_LIT=destest.c speed.c des_opts.c
75 GENERAL_LIT=COPYRIGHT INSTALL README VERSION Makefile des_crypt.man \
76         des.doc options.txt asm
77 HEADERS_LIT=des_ver.h des.h des_locl.h podd.h sk.h spr.h
78 LIBDES_LIT=ede_enc.c cbc_enc.c ncbc_enc.c ecb_enc.c fcrypt.c set_key.c des_enc.c
79
80 PERL=   des.pl testdes.pl doIP doIP2 doPC1 doPC2 PC1 PC2 shifts.pl
81
82 ALL=    $(GENERAL) $(DES) $(TESTING) $(LIBDES) $(PERL) $(HEADERS)
83
84 DLIB=   libdes.a
85
86 all: $(DLIB) destest rpw des speed des_opts
87
88 cc:
89         make CC=cc CFLAGS="-O $(OPTS) $(CFLAG)" all
90
91 gcc:
92         make CC=gcc CFLAGS="-O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all
93
94 x86-elf:
95         make DES_ENC=asm/dx86-elf.o CC=gcc CFLAGS="-DELF -O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all
96
97 x86-out:
98         make DES_ENC=asm/dx86-out.o CC=gcc CFLAGS="-DOUT -O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all
99
100 x86-solaris:
101         make DES_ENC=asm/dx86-sol.o CFLAGS="-DSOL -O  $(OPTS) $(CFLAG)" all
102
103 x86-bsdi:
104         make DES_ENC=asm/dx86bsdi.o CC=gcc CFLAGS="-DBSDI -O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all
105
106 asm/dx86-elf.o: asm/dx86-cpp.s asm/dx86unix.cpp
107         $(CPP) -DELF asm/dx86unix.cpp | as -o asm/dx86-elf.o
108
109 asm/dx86-sol.o: asm/dx86-cpp.s asm/dx86unix.cpp
110         $(CPP) -DSOL asm/dx86unix.cpp | as -o asm/dx86-sol.o
111
112 asm/dx86-out.o: asm/dx86-cpp.s asm/dx86unix.cpp
113         $(CPP) -DOUT asm/dx86unix.cpp | as -o asm/dx86-out.o
114
115 asm/dx86bsdi.o: asm/dx86-cpp.s asm/dx86unix.cpp
116         $(CPP) -DBSDI asm/dx86unix.cpp | as -o asm/dx86bsdi.o
117
118 test:   all
119         ./destest
120
121 $(DLIB): $(OBJS)
122         /bin/rm -f $(DLIB)
123         ar cr $(DLIB) $(OBJS)
124         -if test -s /bin/ranlib; then /bin/ranlib $(DLIB); \
125         else if test -s /usr/bin/ranlib; then /usr/bin/ranlib $(DLIB); \
126         else exit 0; fi; fi
127
128 des_opts: des_opts.o libdes.a
129         $(CC) $(CFLAGS) -o des_opts des_opts.o libdes.a
130
131 destest: destest.o libdes.a
132         $(CC) $(CFLAGS) -o destest destest.o libdes.a
133
134 rpw: rpw.o libdes.a
135         $(CC) $(CFLAGS) -o rpw rpw.o libdes.a
136
137 speed: speed.o libdes.a
138         $(CC) $(CFLAGS) -o speed speed.o libdes.a
139
140 des: des.o libdes.a
141         $(CC) $(CFLAGS) -o des des.o libdes.a
142
143 tags:
144         ctags $(DES) $(TESTING) $(LIBDES)
145
146 tar_lit:
147         /bin/mv Makefile Makefile.tmp
148         /bin/cp Makefile.lit Makefile
149         tar chf libdes-l.tar $(LIBDES_LIT) $(HEADERS_LIT) \
150                 $(GENERAL_LIT) $(TESTING_LIT)
151         /bin/rm -f Makefile
152         /bin/mv Makefile.tmp Makefile
153
154 tar:
155         tar chf libdes.tar $(ALL)
156
157 shar:
158         shar $(ALL) >libdes.shar
159
160 depend:
161         makedepend $(LIBDES) $(DES) $(TESTING)
162
163 clean:
164         /bin/rm -f *.o tags core rpw destest des speed $(DLIB) .nfs* *.old \
165         *.bak destest rpw des_opts asm/*.o 
166
167 dclean:
168         sed -e '/^# DO NOT DELETE THIS LINE/ q' Makefile >Makefile.new
169         mv -f Makefile.new Makefile
170
171 # Eric is probably going to choke when he next looks at this --tjh
172 install: $(DLIB) des
173         if test $(INSTALLTOP); then \
174             echo SSL style install; \
175             cp $(DLIB) $(INSTALLTOP)/lib; \
176             if test -s /bin/ranlib; then \
177                 /bin/ranlib $(INSTALLTOP)/lib/$(DLIB); \
178             else \
179                 if test -s /usr/bin/ranlib; then \
180                 /usr/bin/ranlib $(INSTALLTOP)/lib/$(DLIB); \
181             fi; fi; \
182             chmod 644 $(INSTALLTOP)/lib/$(DLIB); \
183             cp des.h $(INSTALLTOP)/include; \
184             chmod 644 $(INSTALLTOP)/include/des.h; \
185             cp des $(INSTALLTOP)/bin; \
186             chmod 755 $(INSTALLTOP)/bin/des; \
187         else \
188             echo Standalone install; \
189             cp $(DLIB) $(LIBDIR)/$(DLIB); \
190             if test -s /bin/ranlib; then \
191               /bin/ranlib $(LIBDIR)/$(DLIB); \
192             else \
193               if test -s /usr/bin/ranlib; then \
194                 /usr/bin/ranlib $(LIBDIR)/$(DLIB); \
195               fi; \
196             fi; \
197             chmod 644 $(LIBDIR)/$(DLIB); \
198             cp des $(BINDIR)/des; \
199             chmod 711 $(BINDIR)/des; \
200             cp des_crypt.man $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
201             chmod 644 $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
202             cp des.man $(MANDIR)/man$(MAN1)/des.$(MAN1); \
203             chmod 644 $(MANDIR)/man$(MAN1)/des.$(MAN1); \
204             cp des.h $(INCDIR)/des.h; \
205             chmod 644 $(INCDIR)/des.h; \
206         fi
207 # DO NOT DELETE THIS LINE -- make depend depends on it.