Commit ee0fab1e authored by Alija Sabic's avatar Alija Sabic
Browse files

Cleanup and templatize Makefile

parent 1ab04102
# -*- cperl -*-
# latexmkrc
$builddir = $ENV{'BUILDDIR'};
$target = $ENV{'TARGET'};
$bibdirs = $ENV{'BIBDIRS'};
$target = $ENV{'TARGET'};
$type = $ENV{'TYPE'};
$viewer = $ENV{'VIEWER'};
BUILDDIR = build
VARIANTS = presentation handout notes
TARGETS = $(BASENAME)-presentation.pdf \
$(BASENAME)-handout.pdf \
......@@ -24,38 +25,20 @@ clean:
rm -rf $(BUILDDIR)
$(BASENAME)-presentation.pdf presentation setup
$(call LATEXMKV,presentation,)
presentation.view: setup
$(call LATEXMKV,presentation,-pv)
presentation.preview: setup
$(call LATEXMKV,presentation,-pvc)
presentation.clean: setup
$(call LATEXMKV,presentation,-c)
presentation.distclean: setup
$(call LATEXMKV,presentation,-C)
define TEMPLATE =
$(BASENAME)-$(strip $(1)).pdf $(strip $(1)).build $(1): setup
$(call LATEXMKV,$(strip $(1)),)
$(strip $(1)).view: setup
$(call LATEXMKV,$(strip $(1)),-pv)
$(strip $(1)).preview: setup
$(call LATEXMKV,$(strip $(1)),-pvc)
$(strip $(1)).clean: setup
$(call LATEXMKV,$(strip $(1)),-c)
$(strip $(1)).distclean: setup
$(call LATEXMKV,$(strip $(1)),-C)
$(BASENAME)-handout.pdf handout setup
$(call LATEXMKV,handout,)
handout.view: setup
$(call LATEXMKV,handout,-pv)
handout.preview: setup
$(call LATEXMKV,handout,-pvc)
handout.clean: setup
$(call LATEXMKV,handout,-c)
handout.distclean: setup
$(call LATEXMKV,handout,-C)
$(BASENAME)-notes.pdf notes setup
$(call LATEXMKV,notes,)
notes.view: setup
$(call LATEXMKV,notes,-pv)
notes.preview: setup
$(call LATEXMKV,notes,-pvc)
notes.clean: setup
$(call LATEXMKV,notes,-c)
notes.distclean: setup
$(call LATEXMKV,notes,-C)
$(foreach variant, $(VARIANTS), $(eval $(call TEMPLATE, $(variant))))
# dynamic targets setup
......@@ -73,7 +56,7 @@ notes.distclean: setup
setup: .FORCE | $(BUILDDIR)/
.PHONY: all presentation handout notes view preview clean distclean .FORCE
.PHONY: all presentation handout notes clean distclean .FORCE
No preview for this file type
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment