I split a big file using the split command in a Makefile
recipe.
trails : $(OBJ)
sort -m $? | accumulate.py --threshold 30 | split -C 10MB -d -a 3 - trail.
I then rename the resulting files to have the .acc
extension. The idea is to have an implicit rule applied on this extension later.
The issue I face is that variable expansion happens before the .acc
files are generated. For example the following rule doesn't produce anything:
all: $(wildcard *.acc) trails
@echo $?
Using the patsubst
function doesn't work either because I don't know in advance how many output files split
will generate.
PS. I split the files to take advantage of the ability of make to parallel the jobs: make -j 16
for example.