(no commit message)
[strongswan.git] / src / libfreeswan / libcrypto / libdes / Makefile
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
22 OPTS0= -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
41 OPTS= $(OPTS0) $(OPTS1) $(OPTS2) $(OPTS3) $(OPTS4)
42
43 MAKE=make -f Makefile
44 #CC=cc
45 #CFLAG= -O
46
47 #CC=gcc
48 #CFLAG= -O4 -funroll-loops -fomit-frame-pointer
49 # normally overridden by FreeS/WAN Makefiles anyway
50 CFLAG= -O3 -fomit-frame-pointer # -I${KLIPSD}/include -I${SRCDIR}
51
52 CFLAGS=$(OPTS) $(CFLAG) $(USERCOMPILE)
53 CPP=$(CC) -E
54
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/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
61
62 LIBDIR=$(DESTDIR)$(INC_USRLOCAL)/lib
63 INCDIR=$(DESTDIR)$(INC_USRLOCAL)/include
64 MANDIR=$(MANTREE)
65 MAN1=1
66 MAN3=3
67 SHELL=/bin/sh
68 MAN1=1
69 MAN3=3
70 SHELL=/bin/sh
71 OBJ_LIT=cbc_enc.o ecb_enc.o $(DES_ENC) fcrypt.o set_key.o
72 OBJ_FULL=cbc_cksm.o $(OBJ_LIT) pcbc_enc.o \
73 xcbc_enc.o qud_cksm.o \
74 cfb64ede.o cfb64enc.o cfb_enc.o ecb3_enc.o \
75 enc_read.o enc_writ.o ofb64ede.o ofb64enc.o ofb_enc.o \
76 rand_key.o read_pwd.o read2pwd.o rpc_enc.o str2key.o supp.o
77
78 GENERAL_LIT=COPYRIGHT INSTALL README VERSION Makefile des_crypt.man \
79 des.doc options.txt asm
80
81 GENERAL_FULL=$(GENERAL_LIT) FILES Imakefile times vms.com KERBEROS MODES.DES \
82 des.man DES.pm DES.pod DES.xs Makefile.PL dess.S des3s.S \
83 Makefile.uni typemap t Makefile.ssl makefile.bc Makefile.lit \
84 des.org des_locl.org
85
86 TESTING_LIT= destest speed des_opts
87 TESTING_FULL= rpw $(TESTING_LIT)
88 TESTING_SRC_LIT=destest.c speed.c des_opts.c
89 TESTING_SRC_FULL=rpw.c $(TESTING_SRC_LIT)
90 HEADERS_LIT=des_ver.h des.h des_locl.h podd.h sk.h spr.h
91 HEADERS_FULL= $(HEADERS_LIT) rpc_des.h
92 LIBDES_LIT=cbc_enc.c ecb_enc.c fcrypt.c set_key.c des_enc.c fcrypt_b.c
93
94 LIBDES_FULL= cbc_cksm.c pcbc_enc.c qud_cksm.c \
95 cfb64ede.c cfb64enc.c cfb_enc.c ecb3_enc.c \
96 enc_read.c enc_writ.c ofb64ede.c ofb64enc.c ofb_enc.c \
97 rand_key.c rpc_enc.c str2key.c supp.c \
98 xcbc_enc.c $(LIBDES_LIT) read_pwd.c read2pwd.c
99
100 PERL= des.pl testdes.pl doIP doPC1 doPC2 PC1 PC2 shifts.pl
101
102 OBJ= $(OBJ_LIT)
103 GENERAL=$(GENERAL_LIT)
104 TESTING=$(TESTING_LIT)
105 TESTING_SRC=$(TESTING_SRC_LIT)
106 HEADERS=$(HEADERS_LIT)
107 LIBDES= $(LIBDES_LIT)
108
109 ALL= $(GENERAL) $(TESTING_SRC) $(LIBDES) $(PERL) $(HEADERS)
110
111 DLIB= libdes.a
112
113 .PHONY: all cc gcc x86-elf x86-out x86-solaris x86-bsdi test tar_lit \
114 tar shar depend clean dclean install check checkprograms
115
116 all: $(DLIB)
117 programs: $(DLIB)
118
119 cc:
120 $(MAKE) CC=cc CFLAGS="-O $(OPTS) $(CFLAG)" all
121
122 gcc:
123 $(MAKE) CC=gcc CFLAGS="-O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all
124
125 x86-elf:
126 $(MAKE) DES_ENC='asm/dx86-elf.o asm/yx86-elf.o' CC='$(CC)' CFLAGS="-DELF $(OPTS) $(CFLAG)" all
127
128 x86-out:
129 $(MAKE) DES_ENC='asm/dx86-out.o asm/yx86-out.o' CC='$(CC)' CFLAGS="-DOUT $(OPTS) $(CFLAG)" all
130
131 x86-solaris:
132 $(MAKE) DES_ENC='asm/dx86-sol.o asm/yx86-sol.o' CC='$(CC)' CFLAGS="-DSOL $(OPTS) $(CFLAG)" all
133
134 x86-bsdi:
135 $(MAKE) DES_ENC='asm/dx86bsdi.o asm/yx86bsdi.o' CC='$(CC)' CFLAGS="-DBSDI $(OPTS) $(CFLAG)" all
136
137 # elf
138 asm/dx86-elf.o: asm/dx86unix.S
139 $(CPP) -DELF asm/dx86unix.S | $(AS) -o asm/dx86-elf.o
140
141 asm/yx86-elf.o: asm/yx86unix.S
142 $(CPP) -DELF asm/yx86unix.S | $(AS) -o asm/yx86-elf.o
143
144 # solaris
145 asm/dx86-sol.o: asm/dx86unix.S
146 $(CC) -E -DSOL asm/dx86unix.S | sed 's/^#.*//' > asm/dx86-sol.s
147 as -o asm/dx86-sol.o asm/dx86-sol.s
148 rm -f asm/dx86-sol.s
149
150 asm/yx86-sol.o: asm/yx86unix.S
151 $(CC) -E -DSOL asm/yx86unix.S | sed 's/^#.*//' > asm/yx86-sol.s
152 as -o asm/yx86-sol.o asm/yx86-sol.s
153 rm -f asm/yx86-sol.s
154
155 # a.out
156 asm/dx86-out.o: asm/dx86unix.S
157 $(CPP) -DOUT asm/dx86unix.S | $(AS) -o asm/dx86-out.o
158
159 asm/yx86-out.o: asm/yx86unix.S
160 $(CPP) -DOUT asm/yx86unix.S | $(AS) -o asm/yx86-out.o
161
162 # bsdi
163 asm/dx86bsdi.o: asm/dx86unix.S
164 $(CPP) -DBSDI asm/dx86unix.S | $(AS) -o asm/dx86bsdi.o
165
166 asm/yx86bsdi.o: asm/yx86unix.S
167 $(CPP) -DBSDI asm/yx86unix.S | $(AS) -o asm/yx86bsdi.o
168
169 asm/dx86unix.S:
170 (cd asm; perl des-586.pl cpp >dx86unix.S)
171
172 asm/yx86unix.S:
173 (cd asm; perl crypt586.pl cpp >yx86unix.S)
174
175 test: all $(TESTING)
176 ./destest
177
178 $(DLIB): $(OBJ)
179 rm -f $(DLIB)
180 $(AR) crs $(DLIB) $(OBJ)
181
182 des_opts: des_opts.o $(DLIB)
183 $(CC) $(CFLAGS) -o des_opts des_opts.o $(DLIB)
184
185 destest: destest.o $(DLIB)
186 $(CC) $(CFLAGS) -o destest destest.o $(DLIB)
187
188 rpw: rpw.o $(DLIB)
189 $(CC) $(CFLAGS) -o rpw rpw.o $(DLIB)
190
191 speed: speed.o $(DLIB)
192 $(CC) $(CFLAGS) -o speed speed.o $(DLIB)
193
194 des: des.o $(DLIB)
195 $(CC) $(CFLAGS) -o des des.o $(DLIB)
196
197 tags:
198 ctags $(TESTING_SRC) $(LIBDES)
199
200 tar_lit:
201 /bin/mv Makefile Makefile.tmp
202 /bin/cp Makefile.lit Makefile
203 tar chf libdes-l.tar $(LIBDES_LIT) $(HEADERS_LIT) \
204 $(GENERAL_LIT) $(TESTING_SRC_LIT)
205 /bin/rm -f Makefile
206 /bin/mv Makefile.tmp Makefile
207
208 tar:
209 tar chf libdes.tar $(ALL)
210
211 shar:
212 shar $(ALL) >libdes.shar
213
214 depend:
215 makedepend $(LIBDES) $(TESTING_SRC)
216
217 clean:
218 /bin/rm -f *.o tags core $(TESTING) $(DLIB) .nfs* *.old *.bak asm/*.o \
219 asm/*.S
220
221 dclean:
222 sed -e '/^# DO NOT DELETE THIS LINE/ q' Makefile >Makefile.new
223 mv -f Makefile.new Makefile
224
225 install install_file_list:
226 @true
227
228 check:
229 echo no checks in lib right now.
230
231 checkprograms:
232
233 # DO NOT DELETE THIS LINE -- make depend depends on it.
234