From d36d381bafd22f182fb336d9319579ff9eb39c8e Mon Sep 17 00:00:00 2001 From: William Trevor King Date: Wed, 5 Aug 2009 09:16:45 -0400 Subject: [PATCH] Website:doc/note subdir and Makefile tree for publishing latex/notes. --- html/Makefile | 2 +- latex/Makefile | 2 +- latex/notes/Makefile | 12 +++++++++ latex/notes/topics/Makefile | 11 ++++++++ latex/notes/topics/linear_algebra/Makefile | 31 +++++++++++++++------- 5 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 latex/notes/Makefile create mode 100644 latex/notes/topics/Makefile diff --git a/html/Makefile b/html/Makefile index 53fcf32..f76ed3f 100644 --- a/html/Makefile +++ b/html/Makefile @@ -1,6 +1,6 @@ HTML_FILES = $(shell echo *.shtml) EMPTY_DIRS = doc source -DEEP_EMPYT_DIRS = doc/exam doc/hwk doc/lab doc/lec doc/rec +DEEP_EMPYT_DIRS = doc/exam doc/hwk doc/lab doc/lec doc/rec doc/note HTML_DIRS = shared php xml $(EMPTY_DIRS) $(DEEP_EMPTY_DIRS) SOURCE_FILES = $(HTML_FILES) $(HTML_DIRS) README .htaccess OTHER_FILES = Makefile diff --git a/latex/Makefile b/latex/Makefile index 19c783b..9008b44 100644 --- a/latex/Makefile +++ b/latex/Makefile @@ -1,4 +1,4 @@ -SUBDIRS = hwk rec +SUBDIRS = hwk rec notes install : @for i in $(SUBDIRS); do \ diff --git a/latex/notes/Makefile b/latex/notes/Makefile new file mode 100644 index 0000000..1aea101 --- /dev/null +++ b/latex/notes/Makefile @@ -0,0 +1,12 @@ +SUBDIRS = topics +INSTALL_DIR := $(INSTALL_DIR)/doc/note + +install : + @for i in $(SUBDIRS); do \ + echo "make install in $$i..."; \ + (cd $$i; $(MAKE) $(MFLAGS) install); done + +clean : + @for i in $(SUBDIRS); do \ + echo "make clean in $$i..."; \ + (cd $$i; $(MAKE) $(MFLAGS) clean); done diff --git a/latex/notes/topics/Makefile b/latex/notes/topics/Makefile new file mode 100644 index 0000000..c722564 --- /dev/null +++ b/latex/notes/topics/Makefile @@ -0,0 +1,11 @@ +SUBDIRS = linear_algebra + +install : + @for i in $(SUBDIRS); do \ + echo "make install in $$i..."; \ + (cd $$i; $(MAKE) $(MFLAGS) install); done + +clean : + @for i in $(SUBDIRS); do \ + echo "make clean in $$i..."; \ + (cd $$i; $(MAKE) $(MFLAGS) clean); done diff --git a/latex/notes/topics/linear_algebra/Makefile b/latex/notes/topics/linear_algebra/Makefile index 6be3b9b..44a7d40 100644 --- a/latex/notes/topics/linear_algebra/Makefile +++ b/latex/notes/topics/linear_algebra/Makefile @@ -1,20 +1,33 @@ -# each MetaPost graphic has it's own file, -# so the basic definitions should get bundled out into an external file -# (encourages reuse anyway, so it's good for you :p) +THIS_DIR = $(shell basename $(PWD)) +SOURCE_FILES = main.tex +OTHER_FILES = Makefile +DIST_FILES = $(SOURCE_FILES) $(OTHER_FILES) +DIST_FILE = $(THIS_DIR)_source.tar.gz +DIST_DIR = $(THIS_DIR) +# external variables: INSTALL_USER, INSTALL_HOST, INSTALL_DIR, SOURCE_DIR all : main.pdf view : all xpdf main.pdf & -%.pdf : %.tex *.tex - pdflatex $< - ../../tex/make_mp.sh - pdflatex $< +%.pdf : %.tex $(SOURCE_FILES) + pdflatex $(patsubst %.tex,%,$<) + pdflatex $(patsubst %.tex,%,$<) semi-clean : - rm -f *.1 *.log *.mp *.mpx *.aux *.out *.cut - rm -f mp*.tex # remove metapost-generated tex + rm -f *.log *.aux *.out *.thm *.toc *.pre clean : semi-clean rm -f *.pdf + +$(DIST_FILE) : $(DIST_FILES) + mkdir $(DIST_DIR) + cp -Lrp $^ $(DIST_DIR) + tar -chozf $@ $(DIST_DIR) + rm -rf $(DIST_DIR) + +install : main.pdf + scp -p $< $(INSTALL_USER)@$(INSTALL_HOST):$(INSTALL_DIR)/$(THIS_DIR).pdf + scp -p $(DIST_FILE) $(INSTALL_USER)@$(INSTALL_HOST):$(SOURCE_DIR) + @date > $@ -- 2.26.2