I wanna use automatic variables to prepare a Makefile for several latex documents.
In other words, i have foo.tex, bar.tex, bee.tex, otherdoc.tex ...
I wanna use a single Makefile to process all of them in the same manner, say process with latex, dvips, ps2pdf ...
I do not want to process all of them at once, but individually.
The base name of my project, say foo.tex, will be supplied at the command line when running make. Reading this basename from the command line is my problem at the moment.
How do i do that?
Sure i can write a Makefile for each document, but it sucks ...
Thx a lot
SRC_BASE_NAME := default-namein yourMakefile(with stuff such asSRC := $(SRC_BASE_NAME).texand$(SRC_BASE_NAME).pdf: $(SRC) etc.← rule that describes how to produce a PDF file from$(SRC)). Then you can call Make like this:make SRC_BASE_NAME=foobarin order to producefoobar.pdffromfoobar.tex. Not sure the Make-fu is on topic here, though. – frougon Jul 15 '19 at 13:02make SRC_BASE_NAME=foobaron the command line in my example, this just sets theSRC_BASE_NAMEMake variable and builds the default target of theMakefile; but I didn't say what the default target is. This is the first target in theMakefile. Therefore, with my notations, you could start yourMakefilewith, for instance,.PHONY: allandall: $(SRC_BASE_NAME).pdfor, in case you also defined rules following the same pattern to produce, say, DVI output:all: $(SRC_BASE_NAME).pdf $(SRC_BASE_NAME).dvi. – frougon Jul 15 '19 at 13:14Makefileillustrating this on pastebin.com (it has other improvements I didn't describe here), but you'll have to recover the tab characters: they have all been destroyed by the stupid site (or HTML browser). AFAIK, sites from the stackexchange network also eat tabs in the Markdown, so there wouldn't be that much to gain by posting it here. With thisMakefile, you can write on the command linemake,make SRC_BASE_NAME=foobar,make pdf,make SRC_BASE_NAME=foobar pdf ps, etc. – frougon Jul 15 '19 at 13:24