ruki 4 mesi fa
parent
commit
64d3dc8c25
3 ha cambiato i file con 16 aggiunte e 15 eliminazioni
  1. 2 2
      README.md
  2. 12 11
      configure
  3. 2 2
      src/xmake.sh

+ 2 - 2
README.md

@@ -140,8 +140,8 @@ target "demo"
     add_files "*.cpp"
     add_includedirs "foo" "bar"
     add_configfiles "config.h.in"
-    set_configdir "${buildir}/include"
-    add_headerfiles "${buildir}/include/config.h" "hello"
+    set_configdir "${builddir}/include"
+    add_headerfiles "${builddir}/include/config.h" "hello"
     add_headerfiles "(bar/*.h)" "hello"
     add_headerfiles "foo/(*.h)" "hello"
     add_installfiles "res/(png/**.png)" "share"

+ 12 - 11
configure

@@ -23,12 +23,12 @@
 # some constants
 #
 xmake_sh_projectdir=$(X= cd -- "$(dirname -- "$0")" && pwd -P)
-xmake_sh_buildir="build"
+xmake_sh_builddir="build"
 xmake_sh_version="1.0.5"
 xmake_sh_verbose=false
 xmake_sh_diagnosis=false
 xmake_sh_copyright="Copyright (C) 2022-present Ruki Wang, tboox.org, xmake.io."
-xmake_sh_makefile="${xmake_sh_projectdir}/makefile"
+xmake_sh_makefile="${xmake_sh_projectdir}/Makefile"
 
 #-----------------------------------------------------------------------------
 # some helper functions
@@ -1499,7 +1499,7 @@ _get_targetdir() {
     local name="${1}"
     _get_target_item "${name}" "targetdir"; local targetdir="${_ret}"
     if test_z "${targetdir}"; then
-        targetdir="${xmake_sh_buildir}/${_target_plat}/${_target_arch}/${_target_mode}"
+        targetdir="${xmake_sh_builddir}/${_target_plat}/${_target_arch}/${_target_mode}"
     fi
     _ret="${targetdir}"
 }
@@ -1509,7 +1509,7 @@ _get_target_objectdir() {
     local name="${1}"
     _get_target_item "${name}" "objectdir"; local objectdir="${_ret}"
     if test_z "${objectdir}"; then
-        objectdir="${xmake_sh_buildir}/.objs/${name}/${_target_plat}/${_target_arch}/${_target_mode}"
+        objectdir="${xmake_sh_builddir}/.objs/${name}/${_target_plat}/${_target_arch}/${_target_mode}"
     fi
     _ret="${objectdir}"
 }
@@ -2786,7 +2786,7 @@ Common options:
                             - emcc
                             - tinycc
                             - cosmocc
-  --buildir=DIR           Set build directory. (default: '"${xmake_sh_buildir}"')
+  --builddir=DIR           Set build directory. (default: '"${xmake_sh_builddir}"')
 
 Autoconf options:
   --build=BUILD           Configure for building on BUILD [guessed]
@@ -2882,8 +2882,8 @@ _handle_option() {
     elif test_eq "${name}" "includedir"; then
         _install_includedir_default="${value}"
         return 0
-    elif test_eq "${name}" "buildir"; then
-        xmake_sh_buildir="${value}"
+    elif test_eq "${name}" "builddir" || test_eq "${name}" "buildir"; then
+        xmake_sh_builddir="${value}"
         return 0
     elif test_eq "${name}" "build"; then
         _autoconf_build_type="${value}"
@@ -3780,14 +3780,15 @@ _check_all() {
 _check_all
 
 #-----------------------------------------------------------------------------
-# init builtin variables, e.g. add_headerfiles "${buildir}/config.h"
+# init builtin variables, e.g. add_headerfiles "${builddir}/config.h"
 #
 projectdir="${xmake_sh_projectdir}"
-if path_is_absolute "${xmake_sh_buildir}"; then
-    buildir="${xmake_sh_buildir}"
+if path_is_absolute "${xmake_sh_builddir}"; then
+    builddir="${xmake_sh_builddir}"
 else
-    buildir="${xmake_sh_projectdir}/${xmake_sh_buildir}"
+    builddir="${xmake_sh_projectdir}/${xmake_sh_builddir}"
 fi
+buildir=${builddir} # deprecated
 plat="${_target_plat}"
 arch="${_target_arch}"
 mode="${_target_mode}"

+ 2 - 2
src/xmake.sh

@@ -47,8 +47,8 @@ target "demo"
     add_files "*.cpp"
     add_includedirs "foo" "bar"
     add_configfiles "config.h.in"
-    set_configdir "${buildir}/include"
-    add_headerfiles "${buildir}/include/config.h" "hello"
+    set_configdir "${builddir}/include"
+    add_headerfiles "${builddir}/include/config.h" "hello"
     add_headerfiles "(bar/*.h)" "hello"
     add_headerfiles "foo/(*.h)" "hello"
     add_installfiles "res/(png/**.png)" "share"