2014-11-06 13:22:46 +00:00
|
|
|
# Makefile for Copyleft Tutorial -*- GNUMakefile -*-
|
|
|
|
|
|
|
|
ifndef BOOK_BASE
|
|
|
|
BOOK_BASE=comprehensive-gpl-guide
|
|
|
|
endif
|
|
|
|
|
2014-11-06 17:41:31 +00:00
|
|
|
ifndef WEB_INSTALL_DIR
|
|
|
|
WEB_INSTALL_DIR = /path/to/html/install/directory
|
|
|
|
endif
|
|
|
|
|
2014-11-06 13:22:46 +00:00
|
|
|
LATEX_INPUT_FILES = $(BOOK_BASE).tex compliance-guide.tex license-texts.tex enforcement-case-studies.tex gpl-lgpl.tex
|
|
|
|
BOOK_CLASS_FILE = gpl-book.cls
|
|
|
|
|
2014-11-06 20:15:17 +00:00
|
|
|
CSS_FILES = css/*.css
|
|
|
|
JAVASCRIPT_FILES = js/*.js
|
|
|
|
WEB_CONFIG_FILE = webhacks.cfg
|
|
|
|
|
2014-11-06 17:34:18 +00:00
|
|
|
HTML_OUTPUT_DIR = public_html
|
|
|
|
|
2014-11-06 13:22:46 +00:00
|
|
|
TEX4HT=tex4ht
|
|
|
|
T4HT=t4ht
|
2014-11-06 17:34:18 +00:00
|
|
|
HTLATEX=htlatex
|
2014-11-06 13:22:46 +00:00
|
|
|
PDFLATEX = pdflatex
|
|
|
|
LATEX = latex
|
|
|
|
BIBTEX = bibtex
|
|
|
|
FIG2DEV = fig2dev
|
|
|
|
DVIPS=dvips
|
|
|
|
|
2014-11-06 17:34:18 +00:00
|
|
|
all: err $(BOOK_BASE).pdf $(BOOK_BASE).ps html
|
2014-11-06 13:22:46 +00:00
|
|
|
|
|
|
|
pdf: err $(BOOK_BASE).pdf
|
|
|
|
|
2014-11-06 20:15:17 +00:00
|
|
|
html: $(HTML_OUTPUT_DIR)/monolithic/$(BOOK_BASE).html $(HTML_OUTPUT_DIR)/$(BOOK_BASE).html pdf $(BOOK_BASE).ps jscssmonolitic jscss
|
2014-11-06 17:34:18 +00:00
|
|
|
/bin/ln -f $(BOOK_BASE).ps $(HTML_OUTPUT_DIR)/$(BOOK_BASE).ps
|
|
|
|
/bin/ln -f $(BOOK_BASE).pdf $(HTML_OUTPUT_DIR)/$(BOOK_BASE).pdf
|
|
|
|
|
2014-11-06 13:22:46 +00:00
|
|
|
.SUFFIXES: .fig .postscript .eps .pdf .pstex_t .pstex .ps .dvi .tex
|
|
|
|
|
|
|
|
.postscript.pdf:
|
|
|
|
ps2pdf $< $@
|
|
|
|
|
|
|
|
.postscript.eps:
|
|
|
|
ps2epsi $< $@
|
|
|
|
|
|
|
|
.dvi.ps:
|
|
|
|
$(DVIPS) $< -o $@
|
|
|
|
|
|
|
|
.tex.dvi:
|
|
|
|
$(LATEX) $<
|
|
|
|
|
|
|
|
.fig.pdf:
|
|
|
|
$(FIG2DEV) -L pdf -p "portrait" -c $< > $@
|
|
|
|
|
|
|
|
.fig.pstex_t:
|
|
|
|
$(FIG2DEV) -L pstex_t $< > $@
|
|
|
|
|
|
|
|
.fig.pstex:
|
|
|
|
$(FIG2DEV) -L pstex $< > $@
|
|
|
|
|
2014-11-06 18:21:16 +00:00
|
|
|
$(BOOK_BASE).pdf: $(PDF_FIGS) $(LATEX_INPUT_FILES)
|
2014-11-06 13:22:46 +00:00
|
|
|
$(PDFLATEX) $(BOOK_BASE)
|
|
|
|
$(PDFLATEX) $(BOOK_BASE)
|
2014-11-06 17:34:18 +00:00
|
|
|
$(PDFLATEX) $(BOOK_BASE)
|
2014-11-06 13:22:46 +00:00
|
|
|
|
2014-11-06 20:15:17 +00:00
|
|
|
$(HTML_OUTPUT_DIR)/monolithic/$(BOOK_BASE).html: $(LATEX_INPUT_FILES) $(WEB_CONFIG_FILE)
|
2014-11-06 17:34:18 +00:00
|
|
|
mkdir -p $(HTML_OUTPUT_DIR)/monolithic/js
|
|
|
|
mkdir -p $(HTML_OUTPUT_DIR)/monolithic/css
|
|
|
|
/bin/rm -f $(BOOK_BASE)*.html
|
|
|
|
/bin/rm -f $(BOOK_BASE)*.js
|
2014-11-06 21:54:37 +00:00
|
|
|
$(HTLATEX) comprehensive-gpl-guide.tex "webhacks,xhtml,mouseover,fn-in"
|
|
|
|
$(HTLATEX) comprehensive-gpl-guide.tex "webhacks,xhtml,mouseover,fn-in"
|
2014-11-06 17:34:18 +00:00
|
|
|
mv ${BOOK_BASE}*js $(HTML_OUTPUT_DIR)/monolithic/js
|
|
|
|
/bin/rm -f $(BOOK_BASE)*.html
|
|
|
|
/bin/rm -f $(BOOK_BASE)*.js
|
2014-11-07 03:40:28 +00:00
|
|
|
$(HTLATEX) comprehensive-gpl-guide.tex "webhacks,xhtml,fn-in"
|
2014-11-06 17:34:18 +00:00
|
|
|
mv $(BOOK_BASE)*html $(HTML_OUTPUT_DIR)/monolithic
|
|
|
|
mv cm*png $(HTML_OUTPUT_DIR)/monolithic
|
|
|
|
mv ${BOOK_BASE}*css $(HTML_OUTPUT_DIR)/monolithic
|
2014-11-06 21:54:37 +00:00
|
|
|
/bin/rm -f ${BOOK_BASE}*aux ${BOOK_BASE}*dvi ${BOOK_BASE}*idv ${BOOK_BASE}*lg ${BOOK_BASE}*tmp ${BOOK_BASE}*4ct ${BOOK_BASE}*4tc ${BOOK_BASE}*toc ${BOOK_BASE}*out ${BOOK_BASE}*xref
|
2014-11-06 20:15:17 +00:00
|
|
|
|
|
|
|
jscssmonolitic: $(CSS_FILES) $(JAVASCRIPT_FILES)
|
2014-11-06 17:34:18 +00:00
|
|
|
cp -pa js/*js $(HTML_OUTPUT_DIR)/monolithic/js
|
|
|
|
cp -pa css/*css $(HTML_OUTPUT_DIR)/monolithic/css
|
|
|
|
|
2014-11-06 20:15:17 +00:00
|
|
|
$(HTML_OUTPUT_DIR)/$(BOOK_BASE).html: $(LATEX_INPUT_FILES) $(WEB_CONFIG_FILE)
|
2014-11-06 17:34:18 +00:00
|
|
|
mkdir -p $(HTML_OUTPUT_DIR)/js
|
|
|
|
mkdir -p $(HTML_OUTPUT_DIR)/css
|
|
|
|
/bin/rm -f $(BOOK_BASE)*.html
|
|
|
|
/bin/rm -f $(BOOK_BASE)*.js
|
2014-11-06 21:54:37 +00:00
|
|
|
$(HTLATEX) comprehensive-gpl-guide.tex "webhacks,xhtml,3,next,mouseover,fn-in"
|
2014-11-06 17:34:18 +00:00
|
|
|
mv ${BOOK_BASE}*js $(HTML_OUTPUT_DIR)/js
|
|
|
|
/bin/rm -f $(BOOK_BASE)*.html
|
|
|
|
/bin/rm -f $(BOOK_BASE)*.js
|
2014-11-06 21:54:37 +00:00
|
|
|
$(HTLATEX) comprehensive-gpl-guide.tex "webhacks,3,next,fn-in"
|
2014-11-06 17:34:18 +00:00
|
|
|
mv ${BOOK_BASE}*css $(HTML_OUTPUT_DIR)
|
|
|
|
mv ${BOOK_BASE}*html $(HTML_OUTPUT_DIR)
|
|
|
|
mv cm*png $(HTML_OUTPUT_DIR)
|
2014-11-06 21:54:37 +00:00
|
|
|
/bin/rm -f ${BOOK_BASE}*aux ${BOOK_BASE}*dvi ${BOOK_BASE}*idv ${BOOK_BASE}*lg ${BOOK_BASE}*tmp ${BOOK_BASE}*4ct ${BOOK_BASE}*4tc ${BOOK_BASE}*toc ${BOOK_BASE}*out ${BOOK_BASE}*xref
|
2014-11-06 20:15:17 +00:00
|
|
|
|
|
|
|
jscss: $(CSS_FILE) $(JAVASCRIPT_FILES)
|
2014-11-06 17:34:18 +00:00
|
|
|
cp -pa js/*js $(HTML_OUTPUT_DIR)/js
|
|
|
|
cp -pa css/*css $(HTML_OUTPUT_DIR)/css
|
2014-11-06 13:22:46 +00:00
|
|
|
|
2014-11-06 18:21:16 +00:00
|
|
|
$(BOOK_BASE).dvi: $(LATEX_INPUT_FILES) $(EPS_FIGS)
|
2014-11-06 13:22:46 +00:00
|
|
|
$(LATEX) $(BOOK_BASE).tex
|
|
|
|
$(LATEX) $(BOOK_BASE).tex
|
|
|
|
|
2014-11-06 20:15:17 +00:00
|
|
|
install: all
|
2014-11-07 04:02:51 +00:00
|
|
|
chmod -R oug+r $(HTML_OUTPUT_DIR)
|
|
|
|
find $(HTML_OUTPUT_DIR) -type d -exec chmod gou+rx {} \;
|
|
|
|
rsync -HavP --delete --delay-updates $(HTML_OUTPUT_DIR)/ $(WEB_INSTALL_DIR)/
|
2014-11-06 18:21:16 +00:00
|
|
|
chmod -R oug+r $(WEB_INSTALL_DIR)
|
|
|
|
find $(WEB_INSTALL_DIR) -type d -exec chmod gou+rx {} \;
|
2014-11-06 20:48:53 +00:00
|
|
|
cd $(WEB_INSTALL_DIR); /bin/ln -sf comprehensive-gpl-guide.html index.html
|
2014-11-06 13:22:46 +00:00
|
|
|
clean:
|
2014-11-06 17:34:18 +00:00
|
|
|
/bin/rm -f $(BOOK_BASE).ps $(BOOK_BASE).pdf $(BOOK_BASE).log texput.log $(BOOK_BASE).lg $(BOOK_BASE).tmp $(BOOK_BASE).xref *.4ct *.4tc *.aux *.dvi $(BOOK_BASE)*.html *.idv *.lg *.tmp $(BOOK_BASE).css $(BOOK_BASE).log $(BOOK_BASE).out $(BOOK_BASE)-js.* cm*png
|
|
|
|
/bin/rm -rf public_html
|
2014-11-06 13:22:46 +00:00
|
|
|
err: ; $(ERR)
|