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

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -