node_any: check attribute presence
[protos/libecoli.git] / mk / ecoli-copy-rules.mk
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright 2015, Olivier MATZ <zer0@droids-corp.org>
3
4 # dump some infos if debug is enabled
5 ifeq ($(D),1)
6 $(call disp_list,------ all-copy,$(all-copy))
7 $(foreach copy,$(all-copy),\
8         $(info,out-$(copy): $(out-$(copy))) \
9         $(call disp_list,pre-$(copy),$(pre-$(copy))) \
10 )
11 endif
12
13 # include dependencies and commands files if they exist
14 $(foreach copy,$(all-copy),\
15         $(eval -include $(call depfile,$(copy))) \
16         $(eval -include $(call cmdfile,$(copy))) \
17 )
18
19 # remove duplicates
20 filtered-all-copy := $(sort $(all-copy))
21
22 # convert format of executable
23 $(filtered-all-copy): $$(pre-$$@) $$(wildcard $$(dep-$$@)) FORCE
24         @[ -d $(dir $@) ] || mkdir -p $(dir $@)
25         @$(call display_deps,$(pre-$(@)),$@,\
26                 $(call copy_cmd,$(pre-$(@)),$@),$?)
27         @$(if $(call check_deps,$@,$(call copy_cmd,$(pre-$(@)),$@),$?),\
28                 $(call copy_print_cmd,$(pre-$(@)),$@) && \
29                 $(call copy_cmd,$(pre-$(@)),$@) && \
30                 $(call save_cmd,$(call copy_cmd,$(pre-$(@)),$@),$@) && \
31                 $(call create_empty_depfile,$@))