wildcard - Create rule in makefile for just a set of files -
i writing makefile, , want use generic rule wildcards, like
%: bkp/% cp $< $@
but wanted rule valid few specific files. wanted define variable list, example
file_list = foo.c bar.c zzz.c
and configure rule valid files listed in variable. how do that?
you want static pattern rule:
file_list = foo.c bar.c zzz.c $(file_list): %: bkp/% cp $< $@
the syntax similar implicit pattern rule using. , yes, it's safer (more predictable).
Comments
Post a Comment