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
--- /dev/null
+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
--- /dev/null
+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
-# 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 > $@