After the latest round of header-hacking, regenerate the dependencies in
[openssl.git] / Netware / build.bat
1 @echo off
2
3 rem ========================================================================
4 rem   Batch file to automate building OpenSSL for NetWare.
5 rem
6 rem   usage:
7 rem      build [target] [debug opts] [assembly opts] [configure opts]
8 rem
9 rem      target        - "netware-clib" - CLib NetWare build
10 rem                    - "netware-libc" - LibC NKS NetWare build
11 rem 
12 rem      debug opts    - "debug"  - build debug
13 rem
14 rem      assembly opts - "nw-mwasm" - use Metrowerks assembler
15 rem      "nw-nasm"  - use NASM assembler
16 rem      "no-asm"   - don't use assembly
17 rem
18 rem      configure opts- all unrecognized arguments are passed to the
19 rem                       perl configure script
20 rem
21 rem   If no arguments are specified the default is to build non-debug with
22 rem   no assembly.  NOTE: there is no default BLD_TARGET.
23 rem
24
25
26
27 rem   No assembly is the default - Uncomment section below to change
28 rem   the assembler default
29 set ASM_MODE=
30 set ASSEMBLER=
31 set NO_ASM=no-asm
32
33 rem   Uncomment to default to the Metrowerks assembler
34 rem set ASM_MODE=nw-mwasm
35 rem set ASSEMBLER=Metrowerks
36 rem set NO_ASM=
37
38 rem   Uncomment to default to the NASM assembler
39 rem set ASM_MODE=nw-nasm
40 rem set ASSEMBLER=NASM
41 rem set NO_ASM=
42
43 rem   No default Bld target
44 set BLD_TARGET=no_target
45 rem set BLD_TARGET=netware-clib
46 rem set BLD_TARGET=netware-libc
47
48
49 rem   Default to build non-debug
50 set DEBUG=
51                                     
52 rem   Uncomment to default to debug build
53 rem set DEBUG=debug
54
55
56 set CONFIG_OPTS=
57 set ARG_PROCESSED=NO
58
59
60 rem   Process command line args
61 :opts
62 if "a%1" == "a" goto endopt
63 if "%1" == "no-asm"   set NO_ASM=no-asm
64 if "%1" == "no-asm"   set ARG_PROCESSED=YES
65 if "%1" == "debug"    set DEBUG=debug
66 if "%1" == "debug"    set ARG_PROCESSED=YES
67 if "%1" == "nw-nasm"  set ASM_MODE=nw-nasm
68 if "%1" == "nw-nasm"  set ASSEMBLER=NASM
69 if "%1" == "nw-nasm"  set NO_ASM=
70 if "%1" == "nw-nasm"  set ARG_PROCESSED=YES
71 if "%1" == "nw-mwasm" set ASM_MODE=nw-mwasm
72 if "%1" == "nw-mwasm" set ASSEMBLER=Metrowerks
73 if "%1" == "nw-mwasm"  set NO_ASM=
74 if "%1" == "nw-mwasm" set ARG_PROCESSED=YES
75 if "%1" == "netware-clib" set BLD_TARGET=netware-clib
76 if "%1" == "netware-clib" set ARG_PROCESSED=YES
77 if "%1" == "netware-libc" set BLD_TARGET=netware-libc
78 if "%1" == "netware-libc" set ARG_PROCESSED=YES
79
80 rem   If we didn't recognize the argument, consider it an option for config
81 if "%ARG_PROCESSED%" == "NO" set CONFIG_OPTS=%CONFIG_OPTS% %1
82 if "%ARG_PROCESSED%" == "YES" set ARG_PROCESSED=NO
83
84 shift
85 goto opts
86 :endopt
87
88 rem make sure a valid BLD_TARGET was specified
89 if "%BLD_TARGET%" == "no_target" goto no_target
90
91 rem build the nlm make file name which includes target and debug info
92 set NLM_MAKE=
93 if "%BLD_TARGET%" == "netware-clib" set NLM_MAKE=netware\nlm_clib
94 if "%BLD_TARGET%" == "netware-libc" set NLM_MAKE=netware\nlm_libc
95 if "%DEBUG%" == "" set NLM_MAKE=%NLM_MAKE%.mak
96 if "%DEBUG%" == "debug" set NLM_MAKE=%NLM_MAKE%_dbg.mak
97
98 if "%NO_ASM%" == "no-asm" set ASM_MODE=
99 if "%NO_ASM%" == "no-asm" set ASSEMBLER=
100 if "%NO_ASM%" == "no-asm" set CONFIG_OPTS=%CONFIG_OPTS% no-asm
101 if "%NO_ASM%" == "no-asm" goto do_config
102
103
104 rem ==================================================
105 echo Generating x86 for %ASSEMBLER% assembler
106
107 echo Bignum
108 cd crypto\bn\asm
109 perl x86.pl %ASM_MODE% > bn-nw.asm
110 cd ..\..\..
111
112 echo DES
113 cd crypto\des\asm
114 perl des-586.pl %ASM_MODE% > d-nw.asm
115 cd ..\..\..
116
117 echo "crypt(3)"
118
119 cd crypto\des\asm
120 perl crypt586.pl %ASM_MODE% > y-nw.asm
121 cd ..\..\..
122
123 echo Blowfish
124
125 cd crypto\bf\asm
126 perl bf-586.pl %ASM_MODE% > b-nw.asm
127 cd ..\..\..
128
129 echo CAST5
130 cd crypto\cast\asm
131 perl cast-586.pl %ASM_MODE% > c-nw.asm
132 cd ..\..\..
133
134 echo RC4
135 cd crypto\rc4\asm
136 perl rc4-586.pl %ASM_MODE% > r4-nw.asm
137 cd ..\..\..
138
139 echo MD5
140 cd crypto\md5\asm
141 perl md5-586.pl %ASM_MODE% > m5-nw.asm
142 cd ..\..\..
143
144 echo SHA1
145 cd crypto\sha\asm
146 perl sha1-586.pl %ASM_MODE% > s1-nw.asm
147 cd ..\..\..
148
149 echo RIPEMD160
150 cd crypto\ripemd\asm
151 perl rmd-586.pl %ASM_MODE% > rm-nw.asm
152 cd ..\..\..
153
154 echo RC5\32
155 cd crypto\rc5\asm
156 perl rc5-586.pl %ASM_MODE% > r5-nw.asm
157 cd ..\..\..
158
159 rem ===============================================================
160 rem
161 :do_config
162
163 echo .
164 echo configure options: %CONFIG_OPTS% %BLD_TARGET%
165 echo .
166 perl configure %CONFIG_OPTS% %BLD_TARGET%
167
168 perl util\mkfiles.pl >MINFO
169
170 echo .
171 echo mk1mf.pl options: %DEBUG% %ASM_MODE% %CONFIG_OPTS% %BLD_TARGET%
172 echo .
173 perl util\mk1mf.pl %DEBUG% %ASM_MODE% %CONFIG_OPTS% %BLD_TARGET% >%NLM_MAKE%
174
175 echo The makefile "%NLM_MAKE%" has been created use your maketool to
176 echo build (ex: gmake -f %NLM_MAKE%)
177 goto end
178
179 rem ===============================================================
180 rem
181 :no_target
182 echo .
183 echo .  No build target specified!!!
184 echo .
185 echo .  usage: build [target] [debug opts] [assembly opts] [configure opts]
186 echo .
187 echo .     target        - "netware-clib" - CLib NetWare build
188 echo .                   - "netware-libc" - LibC NKS NetWare build
189 echo .
190 echo .     debug opts    - "debug"  - build debug
191 echo .
192 echo .     assembly opts - "nw-mwasm" - use Metrowerks assembler
193 echo .                     "nw-nasm"  - use NASM assembler
194 echo .                     "no-asm"   - don't use assembly
195 echo .
196 echo .     configure opts- all unrecognized arguments are passed to the
197 echo .                      perl configure script
198 echo .
199 echo .  If no debug or assembly opts are specified the default is to build
200 echo .  non-debug without assembly
201 echo .
202
203         
204 :end