See the code below: How do I send a parameter BASE_NAME = myfile to the command line without typing BASE_NAME. I want to enter only
$make pdf myfile
BASE_NAME = myfile
LATEX = latex
PDFLATEX = pdflatex
BIBTEX = bibtex
MAKEINDEX = makeindex
DVIPS = dvips
PS2PDF = ps2pdf
pdf: $(BASE_NAME).pdf
ps: $(BASE_NAME).ps
$(BASE_NAME).ps: $(BASE_NAME).tex
$(LATEX) $<
$(BIBTEX) $(BASE_NAME)
$(LATEX) $<
$(LATEX) $<
$(DVIPS) -Ppdf $(BASE_NAME)
$(BASE_NAME).pdf: $(BASE_NAME).tex
$(PDFLATEX) $<
clean:
rm -f $(BASE_NAME)*.ps $(BASE_NAME)*.dvi *.log \
*.aux *.blg *.toc \
missfont.log $(BASE_NAME)*.bbl $(BASE_NAME)*.out \
$(BASE_NAME)*.lof $(BASE_NAME)*.lot
open:
acroread $(BASE_NAME).pdf
Also, how do I use an option-type
$make pdf -o myfile
to generate the PDF and then open it from the option -o?
This is not a TeX question per se, but nevertheless…
You are much better if you specifiy generic rules instead of specific ones. Besides, if you want to open your files,
Makefileconventions suggest the commandmake openrather thanmake -o.I usually do it like this