LATEX := pdflatex
-all: noperltex.sty
- $(LATEX) isa.tex
+FILES = isa.tex
+TARGET = isa.pdf
-noperltex.sty: isa_file.tex
- @if $(SHELL) -c 'perltex --help' > /dev/null 2>&1; then \
- perltex --makesty --latex=pdflatex isa_gen.tex; \
- rm -f isa_gen.pdf isa_gen.log isa_gen.aux isa_gen.dfpl isa_gen.frpl isa_gen.lgpl isa_gen.topl isa_gen.pipe; \
- else \
- echo "no perltex installed! i hope you have the builded files";\
- fi
+ISA_FILES = sample.ptex
-clean:
- @rm -f isa.aux isa.log isa.pdf
+ISA_BUILD = $(ISA_FILES:.ptex=.tex)
+
+all: $(TARGET)
+
+$(TARGET) : $(FILES) $(ISA_BUILD)
+ $(LATEX) $(@:.pdf=.tex)
-cleanall: clean
- @rm -f noperltex.sty noperltex-*.tex
+%.tex : %.ptex
+ ./gentex.pl $^
+
+.PHONY: clean
+
+clean:
+ rm -rf *.aux *.log *.dvi *.pdf *.toc *.out $(ISA_BUILD)