diff options
-rw-r--r-- | CC/foreign/cmake/EXPRESSIONS | 20 | ||||
-rw-r--r-- | CC/foreign/cmake/RULES | 16 | ||||
-rw-r--r-- | CC/foreign/make/EXPRESSIONS | 17 | ||||
-rw-r--r-- | CC/foreign/make/RULES | 18 |
4 files changed, 56 insertions, 15 deletions
diff --git a/CC/foreign/cmake/EXPRESSIONS b/CC/foreign/cmake/EXPRESSIONS index be345c2..bdb05ce 100644 --- a/CC/foreign/cmake/EXPRESSIONS +++ b/CC/foreign/cmake/EXPRESSIONS @@ -1,6 +1,7 @@ { "cmake-build": { "vars": [ "source_dir" + , "cmake_subdir" , "cmake_options" , "cmake_defines" , "cmake_jobs" @@ -143,6 +144,12 @@ ] } ] + , [ "CMAKE_SUBDIR" + , { "type": "join" + , "separator": "/" + , "$1": {"type": "var", "name": "cmake_subdir", "default": []} + } + ] , [ "script" , { "type": "singleton_map" , "key": "run_cmake.sh" @@ -169,9 +176,10 @@ ] } } - , [ "readonly CMAKE_AR=$(which $1)" - , "shift" - , "cmake \"$@\" -Ssource -Bbuild -DCMAKE_AR=${CMAKE_AR} -DCMAKE_INSTALL_PREFIX=./install >configure.log || (cat configure.log && exit 1)" + , [ "readonly CMAKE_SUBDIR=\"$1\"" + , "readonly CMAKE_AR=$(which $2)" + , "shift 2" + , "cmake \"$@\" -S\"source/${CMAKE_SUBDIR}\" -Bbuild -DCMAKE_AR=${CMAKE_AR} -DCMAKE_INSTALL_PREFIX=./install >configure.log || (cat configure.log && exit 1)" ] , [ { "type": "join" , "separator": " " @@ -222,7 +230,11 @@ , "cmd": { "type": "++" , "$1": - [ ["/bin/sh", "run_cmake.sh", {"type": "var", "name": "AR"}] + [ [ "/bin/sh" + , "run_cmake.sh" + , {"type": "var", "name": "CMAKE_SUBDIR"} + , {"type": "var", "name": "AR"} + ] , {"type": "var", "name": "CMAKE_FLAGS"} ] } diff --git a/CC/foreign/cmake/RULES b/CC/foreign/cmake/RULES index 8651f4e..e5c7706 100644 --- a/CC/foreign/cmake/RULES +++ b/CC/foreign/cmake/RULES @@ -2,7 +2,8 @@ { "doc": ["Data produced by CMake configure, build, and install."] , "target_fields": ["project"] , "string_fields": - [ "options" + [ "subdir" + , "options" , "defines" , "jobs" , "pre_cmds" @@ -27,6 +28,10 @@ , "field_doc": { "project": ["The CMake project directory. It should contain a single tree artifact"] + , "subdir": + [ "The subdirectory that contains the entry CMakeLists.txt. Individual" + , "directory components are joined with \"/\"." + ] , "options": [ "CMake options for the configuration phase." , "(e.g., [\"-GNinja\", \"-Ax64\"])" @@ -162,6 +167,7 @@ } } ] + , ["cmake_subdir", {"type": "FIELD", "name": "subdir"}] , ["cmake_options", {"type": "FIELD", "name": "options"}] , ["cmake_defines", {"type": "FIELD", "name": "defines"}] , ["cmake_jobs", {"type": "FIELD", "name": "jobs"}] @@ -218,7 +224,8 @@ { "doc": ["Library produced by CMake configure, build, and install."] , "target_fields": ["project", "deps"] , "string_fields": - [ "name" + [ "subdir" + , "name" , "version" , "stage" , "options" @@ -256,6 +263,10 @@ , "field_doc": { "project": ["The CMake project directory. It should contain a single tree artifact"] + , "subdir": + [ "The subdirectory that contains the entry CMakeLists.txt. Individual" + , "directory components are joined with \"/\"." + ] , "name": [ "The name of the library (without leading \"lib\" or trailing file name" , "extension), also used as name for pkg-config files." @@ -509,6 +520,7 @@ ] } ] + , ["cmake_subdir", {"type": "FIELD", "name": "subdir"}] , ["cmake_options", {"type": "FIELD", "name": "options"}] , ["cmake_defines", {"type": "FIELD", "name": "defines"}] , ["cmake_jobs", {"type": "FIELD", "name": "jobs"}] diff --git a/CC/foreign/make/EXPRESSIONS b/CC/foreign/make/EXPRESSIONS index 3f04bbd..abe072d 100644 --- a/CC/foreign/make/EXPRESSIONS +++ b/CC/foreign/make/EXPRESSIONS @@ -1,7 +1,7 @@ { "make-build": { "vars": [ "source_dir" - , "make_target" + , "subdir" , "make_prefix" , "make_options" , "make_jobs" @@ -203,6 +203,12 @@ ] } ] + , [ "SUBDIR" + , { "type": "join" + , "separator": "/" + , "$1": {"type": "var", "name": "subdir", "default": []} + } + ] , [ "script" , { "type": "singleton_map" , "key": "run_make.sh" @@ -229,9 +235,11 @@ ] } } - , [ "readonly VAR_DESTDIR=$1" - , "shift" - , "make \"$@\" -C source ${VAR_DESTDIR}=$(pwd)/install >build.log || (cat build.log && exit 1)" + , [ "readonly SUBDIR=\"$1\"" + , "readonly VAR_DESTDIR=$2" + , "shift 2" + ] + , [ "make \"$@\" -C \"source/${SUBDIR}\" ${VAR_DESTDIR}=$(pwd)/install >build.log || (cat build.log && exit 1)" , "find ./install -type l -delete" ] , { "type": "if" @@ -266,6 +274,7 @@ { "type": "++" , "$1": [ ["/bin/sh", "run_make.sh"] + , [{"type": "var", "name": "SUBDIR"}] , { "type": "if" , "cond": {"type": "var", "name": "var_destdir"} , "then": diff --git a/CC/foreign/make/RULES b/CC/foreign/make/RULES index 9c8c738..7ae684f 100644 --- a/CC/foreign/make/RULES +++ b/CC/foreign/make/RULES @@ -2,7 +2,7 @@ { "doc": ["Data produced by Make build and install."] , "target_fields": ["project"] , "string_fields": - [ "target" + [ "subdir" , "prefix" , "options" , "jobs" @@ -37,7 +37,10 @@ , "field_doc": { "project": ["The Make project directory. It should contain a single tree artifact"] - , "target": ["The Make target to build (default: [\"install\"])."] + , "subdir": + [ "The subdirectory that contains the configure and Makefile. Individual" + , "directory components are joined with \"/\"." + ] , "prefix": [ "The prefix used for the Make target. The path will be made absolute" , "and individual directory components are joined with \"/\". If no" @@ -195,7 +198,7 @@ } } ] - , ["make_target", {"type": "FIELD", "name": "target"}] + , ["subdir", {"type": "FIELD", "name": "subdir"}] , ["make_prefix", {"type": "FIELD", "name": "prefix"}] , ["make_options", {"type": "FIELD", "name": "options"}] , ["make_jobs", {"type": "FIELD", "name": "jobs"}] @@ -258,7 +261,8 @@ { "doc": ["Library produced by Make build and install."] , "target_fields": ["project", "deps"] , "string_fields": - [ "name" + [ "subdir" + , "name" , "version" , "stage" , "target" @@ -306,6 +310,10 @@ , "field_doc": { "project": ["The Make project directory. It should contain a single tree artifact"] + , "subdir": + [ "The subdirectory that contains the configure and Makefile. Individual" + , "directory components are joined with \"/\"." + ] , "name": [ "The name of the library (without leading \"lib\" or trailing file name" , "extension), also used as name for pkg-config files." @@ -581,7 +589,7 @@ ] } ] - , ["make_target", {"type": "FIELD", "name": "target"}] + , ["subdir", {"type": "FIELD", "name": "subdir"}] , ["make_prefix", {"type": "FIELD", "name": "prefix"}] , ["make_options", {"type": "FIELD", "name": "options"}] , ["make_jobs", {"type": "FIELD", "name": "jobs"}] |