make/common/Execute.gmk
branchihse-setupexecute-branch
changeset 57158 003703d03633
parent 57155 ba61956ea598
child 57159 0258a6f7d03f
equal deleted inserted replaced
57155:ba61956ea598 57158:003703d03633
    54 define SetupExecuteBody
    54 define SetupExecuteBody
    55   ifeq ($$($1_COMMAND), )
    55   ifeq ($$($1_COMMAND), )
    56     $$(error COMMAND is missing in SetupExecute $1)
    56     $$(error COMMAND is missing in SetupExecute $1)
    57   endif
    57   endif
    58 
    58 
       
    59   ifneq ($$($1_OUTPUT_FILE), )
       
    60     ifneq ($$($1_OUTPUT_DIR), )
       
    61       $$(error Cannot specify both OUTPUT_DIR and OUTPUT_FILE in SetupExecute $1)
       
    62     endif
       
    63     $1_OUTPUT_DIR := $$(patsubst %/,%, $$(dir $$($1_OUTPUT_FILE)))
       
    64   else ifeq ($$($1_OUTPUT_DIR), )
       
    65     $$(error OUTPUT_DIR or OUTPUT_FILE is required in SetupExecute $1)
       
    66   endif
       
    67 
    59   $1_BASE := $$($1_OUTPUT_DIR)/_$1
    68   $1_BASE := $$($1_OUTPUT_DIR)/_$1
    60   $1_MARKER := $$($1_BASE).marker
    69   $1_MARKER := $$($1_BASE).marker
    61 
    70 
    62   ifeq ($$($1_INFO), )
    71   ifeq ($$($1_OUTPUT_FILE), )
    63     $1_INFO := Running commands for $1
       
    64   endif
       
    65 
       
    66   ifeq ($$($1_OUTPUT_DIR)$$($1_OUTPUT_FILE), )
       
    67     $$(error OUTPUT_DIR or OUTPUT_FILE is required in SetupExecute $1)
       
    68   endif
       
    69 
       
    70   ifneq ($$($1_OUTPUT_DIR), )
       
    71     ifneq ($$($1_OUTPUT_FILE), )
       
    72       $$(error Cannot specify both OUTPUT_DIR and OUTPUT_FILE in SetupExecute $1)
       
    73     endif
       
    74     $1_RESULT := $$($1_MARKER)
    72     $1_RESULT := $$($1_MARKER)
    75   else
    73   else
    76     # If we have a single output file, we don't need a separate marker
    74     # If we have a single output file, we don't need a separate marker
    77     $1_RESULT := $$($1_OUTPUT_FILE)
    75     $1_RESULT := $$($1_OUTPUT_FILE)
       
    76   endif
       
    77 
       
    78   ifeq ($$($1_INFO), )
       
    79     $1_INFO := Running commands for $1
    78   endif
    80   endif
    79 
    81 
    80   $$($1_RESULT): $$($1_DEPS)
    82   $$($1_RESULT): $$($1_DEPS)
    81 	$$(call LogInfo, $$($1_INFO))
    83 	$$(call LogInfo, $$($1_INFO))
    82 	$$(call MakeDir, $$(@D))
    84 	$$(call MakeDir, $$(@D))