I am working on a project that has a directory structure that looks a bit like this:
inputs/ a.txt b.txt c.txt outputs/ a.out b.out c.out makefile The files in the outputs folder are generated from the files in the inputs folder and I want to automatically update them whenever one of the input files changes.
I tried to do this by creating a makefile with a pattern rule. (To keep this question simple, I'm just copying the input file instead of transforming it)
outputs/%.txt: inputs/%.out cp $< $@ However, this makefile didn't quite do what I want. If I run make outputs/a.txt it will apply the rule that I wrote and regenerate the output file if it is outdated but if I just run make then nothing happens:
make: *** No targets. Stop. Is there a way to tell make that by default I want to generate an output file for every file in the inputs folder?
edit: made the output files have a different file suffix than the input files.