how to fix gnu make rule using vpath to copy files into a different directory when that directory is ./? -
based on beta's answer in gnu make copy many files single location, had working rule copy figures different paths ./figures/ subdir in build directory
orig_file_dirs += .. local_files += figures/myfig.png destdir := figures : $(local_files) vpath %.png $(orig_file_dirs) $(destdir)/%.png: %.png mkdir -p $(destdir) cp $< $@ this works nicely provided figures not ./ -- example, modifying attempt copy latex .sty files (which need in current working directory) alternate path, i'd tried:
orig_file_dirs += .. local_files += mycommon.sty destdir := ./ : $(local_files) vpath %.sty $(orig_file_dirs) $(filter %.sty,$(local_files)) : $(destdir)/%.sty: %.sty mkdir -p $(destdir) cp $< $@ (the filter attempt explicit since have few other .sty files in ./)
this gives me
make: circular mycommon.sty <- mycommon.sty dependency dropped. make: nothing done `all'. i'm unsure how resolve this. i'd tried explicit path dependency:
$(filter %.sty,$(local_files)) : $(destdir)/%.sty: ../%.sty mkdir -p $(destdir) cp $< $@ but still circular dependency (for ../mycommon.sty) doing so.
i can rename originals: give them different suffix, , use plain old suffix rule.
Comments
Post a Comment