|
@@ -3855,7 +3855,7 @@ macro _PY3_COMPILE_BYTECODE(SrcX, Src, Dst) {
|
|
|
}
|
|
|
|
|
|
macro _ARCHIVE_SEM_HELPER(FLAGS[], OUT, Files...) {
|
|
|
- .SEM=target_commands-ITEM && target_commands-macro add_custom_command && target_commands-args OUTPUT ${OUT} DEPENDS $ARCH_TOOL ${join= :Files} COMMAND $ARCH_TOOL $FLAGS ${join=\: :Files}: -o ${OUT}
|
|
|
+ .SEM=custom_runs-ITEM && custom_runs-outputs ${OUT} && custom_runs-depends $ARCH_TOOL ${join= :Files} && custom_runs-command $ARCH_TOOL $FLAGS ${join=\: :Files}: -o ${OUT}
|
|
|
}
|
|
|
|
|
|
### @usage: ARCHIVE_ASM(NAME archive_name files...)
|
|
@@ -4375,51 +4375,6 @@ macro SYMLINK(From, To) {
|
|
|
.CMD=$YMAKE_PYTHON ${input:"build/scripts/symlink.py"} ${input;dirallowed:From} ${noauto;output:To} ${hide;kv:"p LN"} ${hide;kv:"pc light-cyan"}
|
|
|
}
|
|
|
|
|
|
-# tag:internal
|
|
|
-### @usage: _SEM_TARGET_SOURCES_FOR_HEADERS(Args...) # internal
|
|
|
-### Generate prefix if Args is not empty
|
|
|
-_SEM_TARGET_SOURCES_FOR_HEADERS_PRE=
|
|
|
-when ($EXPORT_CMAKE == "yes") {
|
|
|
- _SEM_TARGET_SOURCES_FOR_HEADERS_PRE=&& target_options-privates-ITEM && target_options-privates-option target_sources && target_options-privates-args
|
|
|
-}
|
|
|
-elsewhen ($EXPORT_GRADLE == "yes") {
|
|
|
- _SEM_TARGET_SOURCES_FOR_HEADERS_PRE=&& custom_runs-outputs
|
|
|
-}
|
|
|
-macro _SEM_TARGET_SOURCES_FOR_HEADERS_IMPL(Args...) {
|
|
|
- .SEM=${pre=$_SEM_TARGET_SOURCES_FOR_HEADERS_PRE :Args}
|
|
|
-}
|
|
|
-macro _SEM_TARGET_SOURCES_FOR_HEADERS(Args...) {
|
|
|
- .SEM=$_SEM_TARGET_SOURCES_FOR_HEADERS_IMPL(${output;ext=.h:Args} ${output;ext=.hh:Args} ${output;ext=.hpp:Args} ${output;ext=.inc:Args} ${output;ext=.i:Args})
|
|
|
-}
|
|
|
-
|
|
|
-# tag:internal
|
|
|
-### @usage: _SEM_SET_ENV_FOR_CUSTOM_COMMAND(Args...) # internal
|
|
|
-### Generate prefix before $Args if Args is not empty
|
|
|
-_SEM_SET_ENV_FOR_CUSTOM_COMMAND_PRE=
|
|
|
-when ($EXPORT_CMAKE == "yes") {
|
|
|
- _SEM_SET_ENV_FOR_CUSTOM_COMMAND_PRE=${CMAKE_COMMAND} -E env
|
|
|
-}
|
|
|
-elsewhen ($EXPORT_GRADLE == "yes") {
|
|
|
- _SEM_SET_ENV_FOR_CUSTOM_COMMAND_PRE=&& custom_runs-env
|
|
|
-}
|
|
|
-macro _SEM_SET_ENV_FOR_CUSTOM_COMMAND(Args...) {
|
|
|
- .SEM=${pre=$_SEM_SET_ENV_FOR_CUSTOM_COMMAND_PRE :Args}
|
|
|
-}
|
|
|
-
|
|
|
-# tag:internal
|
|
|
-### @usage: _SEM_SET_CWD(Args...) # internal
|
|
|
-### Generate prefix before $Args if Args is not empty
|
|
|
-_SEM_SET_CWD_SEM=
|
|
|
-when ($EXPORT_CMAKE == "yes") {
|
|
|
- _SEM_SET_CWD_PRE=WORKING_DIRECTORY
|
|
|
-}
|
|
|
-elsewhen ($EXPORT_GRADLE == "yes") {
|
|
|
- _SEM_SET_CWD_PRE=&& custom_runs-cwd
|
|
|
-}
|
|
|
-macro _SEM_SET_CWD(Args...) {
|
|
|
- .SEM=${pre=$_SEM_SET_CWD_PRE :Args}
|
|
|
-}
|
|
|
-
|
|
|
macro _FMT_INDUCED_DEPS(For, Deps...) {
|
|
|
.CMD=${induced_deps=$For;hide:Deps}
|
|
|
}
|
|
@@ -4548,30 +4503,9 @@ macro DECLARE_IN_DIRS(var_prefix, PATTERN, SRCDIR="", RECURSIVE?"**/":"", EXCLUD
|
|
|
### For absolute paths use ${ARCADIA_ROOT} and ${ARCADIA_BUILD_ROOT}, or
|
|
|
### ${CURDIR} and ${BINDIR} which are expanded where the outputs are used.
|
|
|
### Note that Tool is always built for the host platform, so be careful to provide that tool can be built for all Arcadia major host platforms (Linux, MacOS and Windows).
|
|
|
-_RUN_PROGRAM_SEM=
|
|
|
-when ($EXPORT_CMAKE == "yes") {
|
|
|
- _RUN_PROGRAM_SEM=target_commands-ITEM \
|
|
|
- && target_commands-macro add_custom_command \
|
|
|
- && target_commands-args \
|
|
|
- $_SEM_SET_ENV_FOR_CUSTOM_COMMAND($ENV) \
|
|
|
- OUTPUT ${output:OUT} ${noauto;output:OUT_NOAUTO} ${output:STDOUT} ${noauto;output:STDOUT_NOAUTO} \
|
|
|
- DEPENDS ${input:IN} ${context=TEXT;input:IN_NOPARSE} ${tool:Tool} ${tool:TOOL} \
|
|
|
- $_SEM_SET_CWD($CWD) \
|
|
|
- COMMAND ${tool:Tool} $Args ${pre=> :STDOUT} ${pre=> :STDOUT_NOAUTO} \
|
|
|
- $_SEM_TARGET_SOURCES_FOR_HEADERS($OUT $OUT_NOAUTO $STDOUT $STDOUT_NOAUTO)
|
|
|
-}
|
|
|
-elsewhen ($EXPORT_GRADLE == "yes") {
|
|
|
- _RUN_PROGRAM_SEM=custom_runs-ITEM \
|
|
|
- && custom_runs-depends ${input:IN} ${context=TEXT;input:IN_NOPARSE} ${tool:Tool} ${tool:TOOL} \
|
|
|
- $_SEM_SET_ENV_FOR_CUSTOM_COMMAND($ENV) \
|
|
|
- && custom_runs-command ${tool:Tool} $Args ${pre=> :STDOUT} ${pre=> :STDOUT_NOAUTO} \
|
|
|
- && custom_runs-outputs ${output:OUT} ${noauto;output:OUT_NOAUTO} ${output:STDOUT} ${noauto;output:STDOUT_NOAUTO} \
|
|
|
- $_SEM_TARGET_SOURCES_FOR_HEADERS($OUT $OUT_NOAUTO $STDOUT $STDOUT_NOAUTO) \
|
|
|
- $_SEM_SET_CWD($CWD)
|
|
|
-}
|
|
|
macro RUN_PROGRAM(Tool, IN{input}[], IN_NOPARSE{input}[], OUT{output}[], OUT_NOAUTO{output}[], TOOL{tool}[], OUTPUT_INCLUDES[], INDUCED_DEPS[], IN_DEPS[], STDOUT="", STDOUT_NOAUTO="", CWD="", ENV[], Args...) {
|
|
|
.CMD=${cwd:CWD} ${env:ENV} ${tool:Tool} $Args ${hide;input:IN} ${hide;context=TEXT;input:IN_NOPARSE} ${hide;input:IN_DEPS} ${hide;output_include:OUTPUT_INCLUDES} $INDUCED_DEPS ${hide;tool:TOOL} ${hide;output:OUT} ${hide;noauto;output:OUT_NOAUTO} ${stdout;output:STDOUT} ${stdout;noauto;output:STDOUT_NOAUTO} ${hide;kv:"p PR"} ${hide;kv:"pc yellow"} ${hide;kv:"show_out"}
|
|
|
- .SEM=${hide;tool:Tool} ${hide;tool:TOOL} $_RUN_PROGRAM_SEM
|
|
|
+ .SEM=custom_runs-ITEM && custom_runs-depends ${input:IN} ${context=TEXT;input:IN_NOPARSE} ${tool:Tool} ${tool:TOOL} ${pre=&& custom_runs-env :ENV} && custom_runs-command ${tool:Tool} $Args ${pre=> :STDOUT} ${pre=> :STDOUT_NOAUTO} && custom_runs-outputs ${output:OUT} ${noauto;output:OUT_NOAUTO} ${output:STDOUT} ${noauto;output:STDOUT_NOAUTO} ${pre=&& custom_runs-cwd :CWD}
|
|
|
}
|
|
|
|
|
|
# tag:lua-specific
|
|
@@ -4620,58 +4554,16 @@ macro RUN_LUA(ScriptPath, IN{input}[], IN_NOPARSE{input}[], OUT{output}[], OUT_N
|
|
|
###
|
|
|
### For absolute paths use ${ARCADIA_ROOT} and ${ARCADIA_BUILD_ROOT}, or
|
|
|
### ${CURDIR} and ${BINDIR} which are expanded where the outputs are used.
|
|
|
-_RUN_PYTHON3_SEM=
|
|
|
-when ($EXPORT_CMAKE == "yes") {
|
|
|
- _RUN_PYTHON3_SEM=packages-ITEM \
|
|
|
- && packages-name Python3 \
|
|
|
- && mpackages-ITEM \
|
|
|
- && mpackages-name Python3 \
|
|
|
- && target_commands-ITEM \
|
|
|
- && target_commands-macro add_custom_command \
|
|
|
- && target_commands-args \
|
|
|
- $_SEM_SET_ENV_FOR_CUSTOM_COMMAND($ENV) \
|
|
|
- OUTPUT ${output:OUT} ${noauto;output:OUT_NOAUTO} ${output:STDOUT} ${noauto;output:STDOUT_NOAUTO} \
|
|
|
- DEPENDS ${input:IN} ${context=TEXT;input:IN_NOPARSE} ${input:ScriptPath} ${tool:TOOL} \
|
|
|
- $_SEM_SET_CWD($CWD) \
|
|
|
- COMMAND Python3::Interpreter ${input:ScriptPath} $Args ${pre=> :STDOUT} ${pre=> :STDOUT_NOAUTO} \
|
|
|
- $_SEM_TARGET_SOURCES_FOR_HEADERS($OUT $OUT_NOAUTO $STDOUT $STDOUT_NOAUTO)
|
|
|
-}
|
|
|
-elsewhen ($EXPORT_GRADLE == "yes") {
|
|
|
- _RUN_PYTHON3_SEM=custom_runs-ITEM \
|
|
|
- && custom_runs-depends ${input:IN} ${context=TEXT;input:IN_NOPARSE} ${input:ScriptPath} ${tool:TOOL} \
|
|
|
- $_SEM_SET_ENV_FOR_CUSTOM_COMMAND($ENV) \
|
|
|
- && custom_runs-command python3 ${input:ScriptPath} $Args ${pre=> :STDOUT} ${pre=> :STDOUT_NOAUTO} \
|
|
|
- && custom_runs-outputs ${output:OUT} ${noauto;output:OUT_NOAUTO} ${output:STDOUT} ${noauto;output:STDOUT_NOAUTO} \
|
|
|
- $_SEM_TARGET_SOURCES_FOR_HEADERS($OUT $OUT_NOAUTO $STDOUT $STDOUT_NOAUTO) \
|
|
|
- $_SEM_SET_CWD($CWD)
|
|
|
-}
|
|
|
macro RUN_PYTHON3(ScriptPath, IN{input}[], IN_NOPARSE{input}[], OUT{output}[], OUT_NOAUTO{output}[], TOOL{tool}[], OUTPUT_INCLUDES[], INDUCED_DEPS[], STDOUT="", STDOUT_NOAUTO="", CWD="", ENV[], Args...) {
|
|
|
.CMD=${cwd:CWD} ${env:ENV} $YMAKE_PYTHON3 ${input:ScriptPath} $Args ${hide;input:IN} ${hide;context=TEXT;input:IN_NOPARSE} ${hide;output_include:OUTPUT_INCLUDES} $INDUCED_DEPS ${hide;tool:TOOL} ${hide;output:OUT} ${hide;noauto;output:OUT_NOAUTO} ${stdout;output:STDOUT} ${stdout;noauto;output:STDOUT_NOAUTO} ${hide;kv:"p PY"} ${hide;kv:"pc yellow"} ${hide;kv:"show_out"}
|
|
|
- .SEM=$_RUN_PYTHON3_SEM
|
|
|
+ .SEM=custom_runs-ITEM && custom_runs-depends ${input:IN} ${context=TEXT;input:IN_NOPARSE} ${input:ScriptPath} ${tool:TOOL} ${pre=&& custom_runs-env :ENV} && custom_runs-command python3 ${input:ScriptPath} $Args ${pre=> :STDOUT} ${pre=> :STDOUT_NOAUTO} && custom_runs-outputs ${output:OUT} ${noauto;output:OUT_NOAUTO} ${output:STDOUT} ${noauto;output:STDOUT_NOAUTO} ${pre=&& custom_runs-cwd :CWD} && custom_runs-cmake_packages-ITEM && custom_runs-cmake_packages-name Python3
|
|
|
}
|
|
|
|
|
|
# tag:java-specific
|
|
|
-_RUN_ANTLR_BASE_SEM=
|
|
|
-when ($EXPORT_CMAKE == "yes") {
|
|
|
- _RUN_ANTLR_BASE_SEM=target_commands-ITEM \
|
|
|
- && target_commands-macro $SEM \
|
|
|
- && target_commands-args \
|
|
|
- OUTPUT ${output:OUT} ${noauto;output:OUT_NOAUTO} \
|
|
|
- DEPENDS ${input:IN} \
|
|
|
- $_SEM_SET_CWD($CWD) \
|
|
|
- $SEM_ARGS_PREFIX $Args
|
|
|
-}
|
|
|
-elsewhen ($EXPORT_GRADLE == "yes") {
|
|
|
- _RUN_ANTLR_BASE_SEM=custom_runs-ITEM \
|
|
|
- && custom_runs-depends ${input:IN} \
|
|
|
- && custom_runs-command $SEM $Args \
|
|
|
- && custom_runs-outputs ${output:OUT} ${noauto;output:OUT_NOAUTO} \
|
|
|
- $_SEM_SET_CWD($CWD)
|
|
|
-}
|
|
|
macro _RUN_ANTLR_BASE(IN{input}[], IN_NOPARSE{input}[], OUT{output}[], OUT_NOAUTO{output}[], OUTPUT_INCLUDES[], INDUCED_DEPS[], TOOL[], STDOUT="", STDOUT_NOAUTO="", CWD="", JAR[], SEM="run_java", SEM_ARGS_PREFIX="", ENV[], HIDE_OUTPUT?"stderr2stdout":"stdout2stderr", Args...) {
|
|
|
PEERDIR(build/platform/java/jdk $JDK_RESOURCE_PEERDIR)
|
|
|
.CMD=${cwd:CWD} ${env:ENV} $YMAKE_PYTHON ${input;pre=build/scripts/:HIDE_OUTPUT.py} $JDK_RESOURCE/bin/java $JAR $Args ${hide;tool:TOOL} ${hide;input:IN} ${hide;context=TEXT;input:IN_NOPARSE} ${hide;output_include:OUTPUT_INCLUDES} $INDUCED_DEPS ${hide;output:OUT} ${hide;noauto;output:OUT_NOAUTO} ${stdout;output:STDOUT} ${stdout;noauto;output:STDOUT_NOAUTO} ${hide;kv:"p JV"} ${hide;kv:"pc light-blue"} ${hide;kv:"show_out"}
|
|
|
- .SEM=$_RUN_ANTLR_BASE_SEM
|
|
|
+ .SEM=custom_runs-ITEM && custom_runs-depends ${input:IN} && custom_runs-command $SEM $Args && custom_runs-outputs ${output:OUT} ${noauto;output:OUT_NOAUTO} ${pre=&& custom_runs-cwd :CWD}
|
|
|
}
|
|
|
|
|
|
### @usage: FROM_SANDBOX([FILE] resource_id [AUTOUPDATED script] [RENAME <resource files>] OUT_[NOAUTO] <output files> [EXECUTABLE] [OUTPUT_INCLUDES <include files>] [INDUCED_DEPS $VARs...])
|
|
@@ -4834,18 +4726,9 @@ macro BPF_STATIC(Input, Output, Opts...) {
|
|
|
###
|
|
|
### Compile LLVM bytecode to object representation.
|
|
|
### Note: Output name is used as is, no extension added.
|
|
|
-_LLVM_COMPILE_LL_SEM=
|
|
|
-when ($EXPORT_CMAKE == "yes") {
|
|
|
- _LLVM_COMPILE_LL_SEM=target_commands-ITEM \
|
|
|
- && target_commands-macro add_custom_command \
|
|
|
- && target_commands-args \
|
|
|
- OUTPUT ${noauto;output:Output} \
|
|
|
- DEPENDS ${input:Input} \
|
|
|
- COMMAND ${LLVMAS} ${input:Input} -o ${noauto;output:Output}
|
|
|
-}
|
|
|
macro LLVM_COMPILE_LL(Input, Output, Opts...) {
|
|
|
.CMD=${CLANG_BC_ROOT}/bin/llvm-as ${input:Input} -o ${noauto;output:Output} ${hide;kv:"p BC"} ${hide;kv:"pc light-green"}
|
|
|
- .SEM=$_LLVM_COMPILE_LL_SEM
|
|
|
+ .SEM=custom_runs-ITEM && custom_runs-depends ${input:Input} && custom_runs-command ${LLVMAS} ${input:Input} -o ${noauto;output:Output} && custom_runs-outputs ${noauto;output:Output}
|
|
|
PEERDIR(build/platform/clang)
|
|
|
}
|
|
|
|
|
@@ -4853,18 +4736,9 @@ macro LLVM_COMPILE_LL(Input, Output, Opts...) {
|
|
|
###
|
|
|
### Call llvm-link on set of Inputs to produce Output.
|
|
|
### Note: Unlike many other macros output argument goes first. Output name is used as is, no extension added.
|
|
|
-_LLVM_LINK_SEM=
|
|
|
-when ($EXPORT_CMAKE == "yes") {
|
|
|
- _LLVM_LINK_SEM=target_commands-ITEM \
|
|
|
- && target_commands-macro add_custom_command \
|
|
|
- && target_commands-args \
|
|
|
- OUTPUT ${noauto;output:Output} \
|
|
|
- DEPENDS ${input:Inputs} \
|
|
|
- COMMAND ${LLVMLINK} ${input:Inputs} -o ${noauto;output:Output}
|
|
|
-}
|
|
|
macro LLVM_LINK(Output, Inputs...) {
|
|
|
.CMD=${CLANG_BC_ROOT}/bin/llvm-link ${input:Inputs} -o ${noauto;output:Output} ${hide;kv:"p LD"} ${hide;kv:"pc light-red"}
|
|
|
- .SEM=$_LLVM_LINK_SEM
|
|
|
+ .SEM=custom_runs-ITEM && custom_runs-depends ${input:Inputs} && custom_runs-command ${LLVMLINK} ${input:Inputs} -o ${noauto;output:Output} && custom_runs-outputs ${noauto;output:Output}
|
|
|
PEERDIR(build/platform/clang)
|
|
|
}
|
|
|
|
|
@@ -4872,18 +4746,9 @@ macro LLVM_LINK(Output, Inputs...) {
|
|
|
###
|
|
|
### Call llvm-opt with set of Opts on Input to produce Output.
|
|
|
### Note: Output name is used as is, no extension added.
|
|
|
-_LLVM_OPT_SEM=
|
|
|
-when ($EXPORT_CMAKE == "yes") {
|
|
|
- _LLVM_OPT_SEM=target_commands-ITEM \
|
|
|
- && target_commands-macro add_custom_command \
|
|
|
- && target_commands-args \
|
|
|
- OUTPUT ${noauto;output:Output} \
|
|
|
- DEPENDS ${input:Input} \
|
|
|
- COMMAND ${LLVMOPT} ${input:Input} -o ${noauto;output:Output} $Opts
|
|
|
-}
|
|
|
macro LLVM_OPT(Input, Output, Opts...) {
|
|
|
.CMD=$YMAKE_PYTHON ${input:"build/scripts/llvm_opt_wrapper.py"} ${CLANG_BC_ROOT}/bin/opt ${input:Input} -o ${noauto;output:Output} $Opts ${hide;kv:"p OP"} ${hide;kv:"pc yellow"}
|
|
|
- .SEM=$_LLVM_OPT_SEM
|
|
|
+ .SEM=custom_runs-ITEM && custom_runs-depends ${input:Input} && custom_runs-command ${LLVMOPT} ${input:Input} -o ${noauto;output:Output} $Opts && custom_runs-outputs ${noauto;output:Output}
|
|
|
PEERDIR(build/platform/clang)
|
|
|
}
|
|
|
|
|
@@ -4892,18 +4757,9 @@ macro LLVM_OPT(Input, Output, Opts...) {
|
|
|
### Call llvm-llc with set of Opts on Src to produce object file.
|
|
|
###
|
|
|
### Note: Output name is calculated as concatenation of Src name and platform specific object file extension.
|
|
|
-_LLVM_LLC_SEM=
|
|
|
-when ($EXPORT_CMAKE == "yes") {
|
|
|
- _LLVM_LLC_SEM=target_commands-ITEM \
|
|
|
- && target_commands-macro add_custom_command \
|
|
|
- && target_commands-args \
|
|
|
- OUTPUT ${output;suf=$OBJECT_SUF;noauto:Src} \
|
|
|
- DEPENDS ${input:Src} \
|
|
|
- COMMAND ${LLVMLLC} --filetype obj ${input:Src} -o ${output;suf=$OBJECT_SUF;noauto:Src} $Opts
|
|
|
-}
|
|
|
macro LLVM_LLC(Src, Opts...) {
|
|
|
.CMD=${tool:LLVM_LLC_TOOL} ${input:Src} --filetype obj -o ${output;suf=$OBJECT_SUF;noauto:Src} $Opts ${hide;kv:"p LC"} ${hide;kv:"pc yellow"}
|
|
|
- .SEM=$_LLVM_LLC_SEM
|
|
|
+ .SEM=custom_runs-ITEM && custom_runs-depends ${input:Src} && custom_runs-command ${LLVMLLC} --filetype obj ${input:Src} -o ${output;suf=$OBJECT_SUF;noauto:Src} $Opts && custom_runs-outputs ${output;suf=$OBJECT_SUF;noauto:Src}
|
|
|
PEERDIR(build/platform/clang)
|
|
|
}
|
|
|
|