- fixed build
[strongswan.git] / src / libfreeswan / libcrypto / libdes / Makefile
1 #ifndef FREESWANSRCDIR
2 #FREESWANSRCDIR=../..
3 #endif
4 #
5 #include ${FREESWANSRCDIR}/Makefile.inc
6 #
7 #KLIPSD=${FREESWANSRCDIR}/linux
8 #SRCDIR=${KLIPSD}/crypto/ciphers/des
9 #
10 #VPATH =${SRCDIR}
11
12 # You must select the correct terminal control system to be used to
13 # turn character echo off when reading passwords. There a 5 systems
14 # SGTTY - the old BSD system
15 # TERMIO - most system V boxes
16 # TERMIOS - SGI (ala IRIX).
17 # VMS - the DEC operating system
18 # MSDOS - we all know what it is :-)
19 # read_pwd.c makes a reasonable guess at what is correct.
20
21 # Targets
22 # make - twidle the options yourself :-)
23 # make cc - standard cc options
24 # make gcc - standard gcc options
25 # make x86-elf - linux-elf etc
26 # make x86-out - linux-a.out, FreeBSD etc
27 # make x86-solaris
28 # make x86-bdsi
29
30 # If you are on a DEC Alpha, edit des.h and change the DES_LONG
31 # define to 'unsigned int'. I have seen this give a %20 speedup.
32
33 OPTS0= -DLIBDES_LIT -DRAND -DTERMIO #-DNOCONST
34
35 # Version 1.94 has changed the strings_to_key function so that it is
36 # now compatible with MITs when the string is longer than 8 characters.
37 # If you wish to keep the old version, uncomment the following line.
38 # This will affect the -E/-D options on des(1).
39 #OPTS1= -DOLD_STR_TO_KEY
40
41 # There are 4 possible performance options
42 # -DDES_PTR
43 # -DDES_RISC1
44 # -DDES_RISC2 (only one of DES_RISC1 and DES_RISC2)
45 # -DDES_UNROLL
46 # after the initial build, run 'des_opts' to see which options are best
47 # for your platform. There are some listed in options.txt
48 #OPTS2= -DDES_PTR
49 #OPTS3= -DDES_RISC1 # or DES_RISC2
50 #OPTS4= -DDES_UNROLL
51
52 OPTS= $(OPTS0) $(OPTS1) $(OPTS2) $(OPTS3) $(OPTS4)
53
54 MAKE=make -f Makefile
55 #CC=cc
56 #CFLAG= -O
57
58 #CC=gcc
59 #CFLAG= -O4 -funroll-loops -fomit-frame-pointer
60 # normally overridden by FreeS/WAN Makefiles anyway
61 CFLAG= -O3 -fomit-frame-pointer -I${KLIPSD}/include -I${SRCDIR}
62
63 CFLAGS=$(OPTS) $(CFLAG) $(USERCOMPILE)
64 CPP=$(CC) -E
65
66 # Assember version of des_encrypt*().
67 DES_ENC=des_enc.o fcrypt_b.o # normal C version
68 #DES_ENC=asm/dx86-elf.o asm/yx86-elf.o # elf format x86
69 #DES_ENC=asm/dx86-out.o asm/yx86-out.o # a.out format x86
70 #DES_ENC=asm/dx86-sol.o asm/yx86-sol.o # solaris format x86
71 #DES_ENC=asm/dx86bsdi.o asm/yx86basi.o # bsdi format x86
72
73 LIBDIR=$(DESTDIR)$(INC_USRLOCAL)/lib
74 INCDIR=$(DESTDIR)$(INC_USRLOCAL)/include
75 MANDIR=$(MANTREE)
76 MAN1=1
77 MAN3=3
78 SHELL=/bin/sh
79 MAN1=1
80 MAN3=3
81 SHELL=/bin/sh
82 OBJ_LIT=cbc_enc.o ecb_enc.o $(DES_ENC) fcrypt.o set_key.o
83 OBJ_FULL=cbc_cksm.o $(OBJ_LIT) pcbc_enc.o \
84 xcbc_enc.o qud_cksm.o \
85 cfb64ede.o cfb64enc.o cfb_enc.o ecb3_enc.o \
86 enc_read.o enc_writ.o ofb64ede.o ofb64enc.o ofb_enc.o \
87 rand_key.o read_pwd.o read2pwd.o rpc_enc.o str2key.o supp.o
88
89 GENERAL_LIT=COPYRIGHT INSTALL README VERSION Makefile des_crypt.man \
90 des.doc options.txt asm
91
92 GENERAL_FULL=$(GENERAL_LIT) FILES Imakefile times vms.com KERBEROS MODES.DES \
93 des.man DES.pm DES.pod DES.xs Makefile.PL dess.S des3s.S \
94 Makefile.uni typemap t Makefile.ssl makefile.bc Makefile.lit \
95 des.org des_locl.org
96
97 TESTING_LIT= destest speed des_opts
98 TESTING_FULL= rpw $(TESTING_LIT)
99 TESTING_SRC_LIT=destest.c speed.c des_opts.c
100 TESTING_SRC_FULL=rpw.c $(TESTING_SRC_LIT)
101 HEADERS_LIT=des_ver.h des.h des_locl.h podd.h sk.h spr.h
102 HEADERS_FULL= $(HEADERS_LIT) rpc_des.h
103 LIBDES_LIT=cbc_enc.c ecb_enc.c fcrypt.c set_key.c des_enc.c fcrypt_b.c
104
105 LIBDES_FULL= cbc_cksm.c pcbc_enc.c qud_cksm.c \
106 cfb64ede.c cfb64enc.c cfb_enc.c ecb3_enc.c \
107 enc_read.c enc_writ.c ofb64ede.c ofb64enc.c ofb_enc.c \
108 rand_key.c rpc_enc.c str2key.c supp.c \
109 xcbc_enc.c $(LIBDES_LIT) read_pwd.c read2pwd.c
110
111 PERL= des.pl testdes.pl doIP doPC1 doPC2 PC1 PC2 shifts.pl
112
113 OBJ= $(OBJ_LIT)
114 GENERAL=$(GENERAL_LIT)
115 TESTING=$(TESTING_LIT)
116 TESTING_SRC=$(TESTING_SRC_LIT)
117 HEADERS=$(HEADERS_LIT)
118 LIBDES= $(LIBDES_LIT)
119
120 ALL= $(GENERAL) $(TESTING_SRC) $(LIBDES) $(PERL) $(HEADERS)
121
122 DLIB= libdes.a
123
124 .PHONY: all cc gcc x86-elf x86-out x86-solaris x86-bsdi test tar_lit \
125 tar shar depend clean dclean install check checkprograms
126
127 all: $(DLIB) $(TESTING)
128 programs: $(DLIB)
129
130 cc:
131 $(MAKE) CC=cc CFLAGS="-O $(OPTS) $(CFLAG)" all
132
133 gcc:
134 $(MAKE) CC=gcc CFLAGS="-O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all
135
136 x86-elf:
137 $(MAKE) DES_ENC='asm/dx86-elf.o asm/yx86-elf.o' CC='$(CC)' CFLAGS="-DELF $(OPTS) $(CFLAG)" all
138
139 x86-out:
140 $(MAKE) DES_ENC='asm/dx86-out.o asm/yx86-out.o' CC='$(CC)' CFLAGS="-DOUT $(OPTS) $(CFLAG)" all
141
142 x86-solaris:
143 $(MAKE) DES_ENC='asm/dx86-sol.o asm/yx86-sol.o' CC='$(CC)' CFLAGS="-DSOL $(OPTS) $(CFLAG)" all
144
145 x86-bsdi:
146 $(MAKE) DES_ENC='asm/dx86bsdi.o asm/yx86bsdi.o' CC='$(CC)' CFLAGS="-DBSDI $(OPTS) $(CFLAG)" all
147
148 # elf
149 asm/dx86-elf.o: asm/dx86unix.S
150 $(CPP) -DELF asm/dx86unix.S | $(AS) -o asm/dx86-elf.o
151
152 asm/yx86-elf.o: asm/yx86unix.S
153 $(CPP) -DELF asm/yx86unix.S | $(AS) -o asm/yx86-elf.o
154
155 # solaris
156 asm/dx86-sol.o: asm/dx86unix.S
157 $(CC) -E -DSOL asm/dx86unix.S | sed 's/^#.*//' > asm/dx86-sol.s
158 as -o asm/dx86-sol.o asm/dx86-sol.s
159 rm -f asm/dx86-sol.s
160
161 asm/yx86-sol.o: asm/yx86unix.S
162 $(CC) -E -DSOL asm/yx86unix.S | sed 's/^#.*//' > asm/yx86-sol.s
163 as -o asm/yx86-sol.o asm/yx86-sol.s
164 rm -f asm/yx86-sol.s
165
166 # a.out
167 asm/dx86-out.o: asm/dx86unix.S
168 $(CPP) -DOUT asm/dx86unix.S | $(AS) -o asm/dx86-out.o
169
170 asm/yx86-out.o: asm/yx86unix.S
171 $(CPP) -DOUT asm/yx86unix.S | $(AS) -o asm/yx86-out.o
172
173 # bsdi
174 asm/dx86bsdi.o: asm/dx86unix.S
175 $(CPP) -DBSDI asm/dx86unix.S | $(AS) -o asm/dx86bsdi.o
176
177 asm/yx86bsdi.o: asm/yx86unix.S
178 $(CPP) -DBSDI asm/yx86unix.S | $(AS) -o asm/yx86bsdi.o
179
180 asm/dx86unix.S:
181 (cd asm; perl des-586.pl cpp >dx86unix.S)
182
183 asm/yx86unix.S:
184 (cd asm; perl crypt586.pl cpp >yx86unix.S)
185
186 test: all
187 ./destest
188
189 $(DLIB): $(OBJ)
190 rm -f $(DLIB)
191 $(AR) crs $(DLIB) $(OBJ)
192
193 des_opts: des_opts.o $(DLIB)
194 $(CC) $(CFLAGS) -o des_opts des_opts.o $(DLIB)
195
196 destest: destest.o $(DLIB)
197 $(CC) $(CFLAGS) -o destest destest.o $(DLIB)
198
199 rpw: rpw.o $(DLIB)
200 $(CC) $(CFLAGS) -o rpw rpw.o $(DLIB)
201
202 speed: speed.o $(DLIB)
203 $(CC) $(CFLAGS) -o speed speed.o $(DLIB)
204
205 des: des.o $(DLIB)
206 $(CC) $(CFLAGS) -o des des.o $(DLIB)
207
208 tags:
209 ctags $(TESTING_SRC) $(LIBDES)
210
211 tar_lit:
212 /bin/mv Makefile Makefile.tmp
213 /bin/cp Makefile.lit Makefile
214 tar chf libdes-l.tar $(LIBDES_LIT) $(HEADERS_LIT) \
215 $(GENERAL_LIT) $(TESTING_SRC_LIT)
216 /bin/rm -f Makefile
217 /bin/mv Makefile.tmp Makefile
218
219 tar:
220 tar chf libdes.tar $(ALL)
221
222 shar:
223 shar $(ALL) >libdes.shar
224
225 depend:
226 makedepend $(LIBDES) $(TESTING_SRC)
227
228 clean:
229 /bin/rm -f *.o tags core $(TESTING) $(DLIB) .nfs* *.old *.bak asm/*.o \
230 asm/*.S
231
232 dclean:
233 sed -e '/^# DO NOT DELETE THIS LINE/ q' Makefile >Makefile.new
234 mv -f Makefile.new Makefile
235
236 install install_file_list:
237 @true
238
239 check:
240 echo no checks in lib right now.
241
242 checkprograms:
243
244 # DO NOT DELETE THIS LINE -- make depend depends on it.
245