• 0 Posts
  • 104 Comments
Joined 3 years ago
cake
Cake day: July 1st, 2023

help-circle


















  • This breaks down when there are more than one SOURCE file, since each DESTINATION file depends on all source files. This means that $< will always be the first file in SOURCE. For example, if source contains the files 0001-01-01-some-file-name.md and 0002-02-02-some-file-name.md:

    $ make -n
    mkdir -p destination/0001/01/01/  
    /bin/bash ./myscript.sh source/0001-01-01-some-file-name.md > destination/0001/01/01/some-file-name.md  
    mkdir -p destination/0002/02/02/  
    /bin/bash ./myscript.sh source/0001-01-01-some-file-name.md > destination/0002/02/02/some-file-name.md  
    

    OP is probably better off using a scripting language to automate this kind of thing

    EDIT: Fixed example filenames