Mercurial > pub > dyncall > dyncall
annotate configure.bat @ 635:840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
author | Tassilo Philipp |
---|---|
date | Sun, 20 Nov 2022 22:14:39 +0100 |
parents | ed19b429a152 |
children |
rev | line source |
---|---|
0 | 1 @ECHO OFF |
2 REM /////////////////////////////////////////////////////////////////////////// | |
3 REM | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
4 REM Copyright (c) 2007-2022 Daniel Adler <dadler@uni-goettingen.de>, |
0 | 5 REM Tassilo Philipp <tphilipp@potion-studios.com> |
6 REM | |
7 REM Permission to use, copy, modify, and distribute this software for any | |
8 REM purpose with or without fee is hereby granted, provided that the above | |
9 REM copyright notice and this permission notice appear in all copies. | |
10 REM | |
11 REM THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
12 REM WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
13 REM MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
14 REM ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
15 REM WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
16 REM ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
17 REM OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
18 REM | |
19 REM /////////////////////////////////////////////////////////////////////////// | |
20 | |
21 | |
22 SETLOCAL | |
23 | |
24 REM Set default values. | |
25 SET PACKAGE=dyncall | |
26 SET CONFIG_HOST=windows | |
27 SET CONFIG_OS=windows | |
28 SET CONFIG_TOOL=msvc | |
29 SET CONFIG_ASM=ml | |
30 IF [%PROCESSOR_ARCHITECTURE%] == [AMD64] ( | |
31 SET CONFIG_ARCH=x64 | |
32 ) ELSE IF [%PROCESSOR_ARCHITEW6432%] == [AMD64] ( | |
33 SET CONFIG_ARCH=x64 | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
34 ) ELSE IF [%PROCESSOR_ARCHITECTURE%] == [ARM64] ( |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
35 SET CONFIG_ARCH=arm64 |
0 | 36 ) ELSE ( |
37 SET CONFIG_ARCH=x86 | |
38 ) | |
635
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
39 SET CONFIG_MAKE=nmake |
0 | 40 |
41 REM Scan arguments. | |
42 :MAIN_LOOP | |
43 | |
44 | |
45 REM Help. | |
46 IF [%1]==[] ( | |
47 GOTO DONE | |
48 ) ELSE IF [%1]==[/?] ( | |
49 ECHO. | |
50 ECHO.dyncall configuration shell-script | |
51 ECHO.Usage: | |
52 ECHO. configure.bat [ options ] | |
53 ECHO. | |
54 ECHO.Options: | |
55 ECHO. /? print this page | |
56 ECHO. | |
352
f5e9f7f8a932
- removed misleading help test in configure.bat
Tassilo Philipp
parents:
0
diff
changeset
|
57 ECHO. /target-x86 build for x86 architecture |
0 | 58 ECHO. /target-x64 build for x64 architecture |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
59 ECHO. /target-arm64 build for arm64 architecture |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
60 ECHO. /target-psp cross-build for PlayStation Portable ^(homebrew SDK^) |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
61 ECHO. /target-nds-arm cross-build for Nintendo DS ^(devkitPro, ARM mode^) |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
62 ECHO. /target-nds-thumb cross-build for Nintendo DS ^(devkitPro, THUMB mode^) |
0 | 63 ECHO. |
64 ECHO. /tool-msvc use Microsoft Visual C++ compiler ^(default^) | |
65 ECHO. /tool-gcc use GNU Compiler Collection | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
66 ECHO. /tool-clang use LLVM clang compiler |
0 | 67 ECHO. |
68 ECHO. /asm-ml use Microsoft Macro Assembler ^(default^) | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
69 ECHO. /asm-as use the GNU or LLVM Assembler |
0 | 70 ECHO. /asm-nasm use NASM Assembler |
635
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
71 ECHO. |
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
72 ECHO. /make-nmake configure for use with cmd.exe/NMAKE env ^(default^) |
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
73 ECHO. /make-make configure for use with sh/make env |
0 | 74 GOTO:EOF |
75 ) ELSE IF [%1]==[/target-x86] ( | |
76 SET CONFIG_ARCH=x86 | |
77 ) ELSE IF [%1]==[/target-x64] ( | |
78 SET CONFIG_ARCH=x64 | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
79 ) ELSE IF [%1]==[/target-arm64] ( |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
80 SET CONFIG_ARCH=arm64 |
0 | 81 ) ELSE IF [%1]==[/target-psp] ( |
82 SET CONFIG_ARCH=mips32 | |
83 SET CONFIG_OS=psp | |
84 ) ELSE IF [%1]==[/target-nds-arm] ( | |
85 SET CONFIG_ARCH=arm32_arm | |
86 SET CONFIG_OS=nds | |
87 ) ELSE IF [%1]==[/target-nds-thumb] ( | |
88 SET CONFIG_ARCH=arm32_thumb | |
89 SET CONFIG_OS=nds | |
90 ) ELSE IF [%1]==[/tool-gcc] ( | |
91 SET CONFIG_TOOL=gcc | |
92 SET CONFIG_ASM=as | |
93 ) ELSE IF [%1]==[/tool-msvc] ( | |
94 SET CONFIG_TOOL=msvc | |
95 SET CONFIG_ASM=ml | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
96 ) ELSE IF [%1]==[/tool-clang] ( |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
97 SET CONFIG_TOOL=clang |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
98 SET CONFIG_ASM=as |
0 | 99 ) ELSE IF [%1]==[/asm-as] ( |
100 SET CONFIG_ASM=as | |
101 ) ELSE IF [%1]==[/asm-nasm] ( | |
102 SET CONFIG_ASM=nasm | |
103 ) ELSE IF [%1]==[/asm-ml] ( | |
104 SET CONFIG_ASM=ml | |
635
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
105 ) ELSE IF [%1]==[/make-make] ( |
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
106 SET CONFIG_MAKE=make |
0 | 107 ) ELSE ( |
108 ECHO Unknown parameter '%1'. | |
109 GOTO DONE | |
110 ) | |
111 | |
112 SHIFT | |
113 GOTO MAIN_LOOP | |
114 :DONE | |
115 | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
116 ECHO # auto-generated by configure.bat >Makefile.config |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
117 ECHO CONFIG_PACKAGE=%PACKAGE%#>>Makefile.config |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
118 ECHO CONFIG_HOST=%CONFIG_HOST%#>>Makefile.config |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
119 ECHO CONFIG_OS=%CONFIG_OS%#>>Makefile.config |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
120 ECHO CONFIG_ARCH=%CONFIG_ARCH%#>>Makefile.config |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
121 ECHO CONFIG_TOOL=%CONFIG_TOOL%#>>Makefile.config |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
122 ECHO CONFIG_ASM=%CONFIG_ASM%#>>Makefile.config |
635
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
123 ECHO CONFIG_MAKE=%CONFIG_MAKE%#>>Makefile.config |
0 | 124 |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
125 ECHO Writing following configuration to Makefile.config: |
0 | 126 ECHO. |
127 ECHO Host OS: %CONFIG_HOST% | |
128 ECHO Target OS: %CONFIG_OS% | |
129 ECHO Target Architecture: %CONFIG_ARCH% | |
130 ECHO Compiler: %CONFIG_TOOL% | |
131 ECHO Assembler: %CONFIG_ASM% | |
635
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
132 ECHO Make: %CONFIG_MAKE% |
0 | 133 |
134 | |
135 REM We have to transform some pathes for the nds/devkitPro build. | |
136 IF [%CONFIG_OS%]==[nds] ( | |
137 REM Check if DEVKITPRO is set. | |
138 IF [%DEVKITPRO%]==[] ( | |
139 ECHO ERROR: Environment variable DEVKITPRO must be set to absolute devkitPro path. | |
140 ) ELSE ( | |
141 buildsys\scripts\conf-nds.bat | |
142 ) | |
143 ) | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
144 |
635
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
145 REM Generate *nix style make files? @@@ maybe we should just always do that |
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
146 IF [%CONFIG_MAKE%]==[make] ( |
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
147 FOR /F "USEBACKQ TOKENS=*" %%X IN (`CD`) DO ( |
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
148 FOR /R %%F IN (Makefile.generic) DO IF EXIST %%F ( |
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
149 ECHO VPATH = %%~dF%%~pF.>%%~pF%%~nF |
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
150 ECHO include %%X\Makefile.config>>%%~pF%%~nF |
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
151 ECHO include ${VPATH}\Makefile.generic>>%%~pF%%~nF |
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
152 ) |
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
153 ) |
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
154 ) |
840a870c093c
- add flag to configure.bat to generate *nix makefiles (can be used to gen a mostly working *nix make build env run with batch, not logical but useful in some zombie setups)
Tassilo Philipp
parents:
632
diff
changeset
|
155 |