"[email protected]" <[email protected]> writes:
> Could you please help me on translate on working example.
>
> What I want to obtain is execute the python script on file present on
> my folder and output on RESHAPE2. thanks in advance for any help
How about something like this:
INDIR=indir
INFILES:=$(wildcard $(INDIR)/*.txt)
OUTDIR=outdir
OUTFILES=$(patsubst $(INDIR)/%.txt,$(OUTDIR)/%.xls,$(INFILES))
SCRIPT=python_script.py
$(OUTDIR)/%.xls: $(INDIR)/%.txt
$(SCRIPT) -i $^ -o $@
all: $(OUTFILES)
This creates a pattern rule to convrert your *.txt files to *.xls, and
then makes all the output *.xls files a prerequisite of "all".
Some advantages of this approach (compared with your attempt that used a
shell loop) is that multiple script invocations can be done in parallel
(using GNU make's -j flag). And that each conversion will only be done
if the corresponding *.txt file is updated (as there is now a dependency
relationship between the *.xls and *.txt files).
--jtc
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make