I have a makefile to create HTML publication lists for different authors out of one BibTex file. The export is done using bibtex2html and works like a charm. But I'm stuck at the rule naming. I want to have the makefile as generic as possible to only adapt the results list when a new colleague starts or someone finishes his PhD.
The workflow is the following:
- bib.bib is given
- Extract the publications from all authors in
results
into seperate files: `bib2bib -c 'author : "$*"' bib.bib' - Now there are files for every author, e.g. bib-Author1.bib, bib-Author2.bib, ...
- Convert the files to html:
bibtex2html -d -r -o [email protected] [email protected]
- Now there are file called bib-Author1.html, bib-Author2.html, ....
Here is the current makefile I'm stuck with:
objects = bib-*.bib
results = Author1 Author2
.PHONY : clean cleanall all $(results)
.INTERMEDIATE : bib-*.bib
all : $(results)
$(results) : % : bib-%.html
bib-%.bib :
TMPDIR=. bib2bib -c 'author : "$*"' bib.bib
bib-%.html : %.html : %.bib
TMPDIR=. bibtex2html -d -r -o [email protected] [email protected]
#Left the clean and cleanall targets out to shorten the code snippet
Right now I call this makefile with a simple make
, which executes the all target. This calls the $(result)
target, which calls the bib-%.html target for every author in result.
And here comes the problem: When called, make stops with the error mixed implicit and static pattern rules.
What I wanted to do here is take the rule name with the static pattern %.html and have this converted to the prerequisite %.bib. But apparently, I'm doing something wrong. Any help appreciated.
make -rR
say? – reinierpost%
) in all three parts of a static pattern rule. It is not entirely clear to me what you are trying to achieve with the static pattern rule. Could you expand a bit by giving an example of some filenames you are looking to apply this static rule to? – Reinier Torenbeekbib2bib -c 'author : "Authorname"' bib.bib
into a file called bib-Authorname.bib. Use this file as input for bibtex2html to have it converted into html usingbibtex2html -o bib-Authorname.html bib-Authorname.bib
– PVitt