Pregunta

I have a directory with the following files

➜  hrrep git:(master) ✗ ls -l
total 1000
drwxrwxrwx  22 zmjones  staff    748 May 28 23:28 data
-rw-rw-rw-   1 zmjones  staff   7180 May 20 16:17 data.R
drwxrwxrwx   9 zmjones  staff    306 May 28 23:38 figures
-rw-r--r--   1 zmjones  staff  85841 May 28 23:23 hill_jones_hr.bib
-rw-r--r--   1 zmjones  staff  29193 May 28 22:23 hill_jones_hr.tex
-rw-r--r--   1 zmjones  staff    572 May 28 23:46 makefile
-rw-rw-rw-   1 zmjones  staff   9588 May 28 22:47 models.R
drwxrwxrwx   3 zmjones  staff    102 May 28 23:28 papers
drwxrwxrwx   9 zmjones  staff    306 May 28 23:28 tex
-rw-r--r--   1 zmjones  staff   1483 May 20 12:58 un_data.py

These files are described by a makefile (using GNU Make 3.81)

all: ./data/cat_un_data.csv ./data/rep.csv ./figures/*.png ./hj-hr.pdf

./data/cat_un_data.csv: un_data.py #refreshing one will refresh all
        python un_data.py

./data/rep.csv: data.R ./data/cat_un_data.csv
        R CMD BATCH --no-save --no-restore data.R

./figures/*.png: models.R ./data/rep.csv
        R CMD BATCH --no-save --no-restore models.R

TEXMCD := pdflatex -interaction=batchmode

hill_jones_hr.pdf: hill_jones_hr.tex ./figures/*.png
    $(TEXCMD) $<
    ]bibtex *.aux
    $(TEXCMD) $<
    $(TEXCMD) $<
    find . | egrep ".*((\.(aux|log|blg|bbl|out|Rout|Rhistory|DS_Store))|~)$$" | xargs rm
    rm -rf auto

The makefile seems to work fine until it gets to the hll_jones_hr.pdf target, where it fails with an error:

hill_jones_hr.tex
make: hill_jones_hr.tex: No such file or directory
make: *** [hill_jones_hr.pdf] Error 1

I don't understand what the problem is. The document compiles fine when I execute pdflatex and bibtex manually. I tried adding the ignore error flag to no avail. I presume this is some stupid make error that I am making. This folder is in Dropbox if that makes any difference. I also tried adding the ./ prefix to both the .tex file and the .pdf target; the error was the same.

¿Fue útil?

Solución

The problem is that the $(TEXCMD) variable is not defined, so your command:

$(TEXCMD) $<

is expanding to just $< or just the filename, which is not a legal command by itself.

Otros consejos

use ./hill_jones_hr.tex instead of hill_jones_hr.tex, and try again.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top