-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
136 lines (114 loc) · 4.78 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
## ********************************************************************* ##
## Copyright 2020 ##
## Mitchel T. Keller and Nicholas Long ##
## ##
## This file is part of Active Calculus - Multivariable (Vector Calculus)##
## ##
## ********************************************************************* ##
#######################
# DO NOT EDIT THIS FILE
#######################
# 1) Make a copy of Makefile.paths.original
# as Makefile.paths, which git will ignore.
# 2) Edit Makefile.paths to provide full paths to the root folders
# of your local clones of the project repository and the mathbook
# repository as described below.
# 3) The files Makefile and Makefile.paths.original
# are managed by git revision control and any edits you make to
# these will conflict. You should only be editing Makefile.paths.
##############
# Introduction
##############
# This is not a "true" makefile, since it
# operates on very few dependencies. It is more of a shell
# script, sharing common configurations
# Useful targets:
# make acmv-extraction --- Run this any time a change is made to a WeBWorK
# exercise. Do not run if no such changes have been
# made.
# make html --- Build the HTML version. Requires that make acs-extraction have
# been run in the past, but need not run it immediately before.
######################
# System Prerequisites
######################
# install (system tool to make directories)
# xsltproc (xml/xsl text processor)
# <helpers> (PDF viewer, web browser, pager, Sage executable, etc)
#####
# Use
#####
# A) Navigate to the location of this file
# B) At command line: make <some-target-from-the-options-below>
# The included file contains customized versions
# of locations of the principal components of this
# project and names of various helper executables
include Makefile.paths
# These paths are subdirectories of
# the project distribution
PRJSRC = $(PRJ)/ptx
OUTPUT = $(PRJ)/output
IMAGESSRC = $(PRJSRC)/images
AC3IMAGESSRC = $(PRJSRC)/AC3/images
# The project's main hub file
MAINFILE = $(PRJSRC)/acmv-index.ptx
# These paths are subdirectories of
# the PreTeXt distribution
# PTXUSR is where extension files get copied
# so relative paths work properly
PTXXSL = $(PTX)/xsl
PTXUSR = $(PTX)/user
# These paths are subdirectories of
# the scratch directory
PDFOUT = $(OUTPUT)/pdf
WWOUT = $(OUTPUT)/webwork-extraction
IMAGESOUT = $(OUTPUT)/images
# Some aspects of producing these examples require a WeBWorK server.
# For all but trivial testing or examples, please look into setting
# up your own WeBWorK server, or consult Alex Jordan about the use
# of PCC's server in a nontrivial capacity. <[email protected]>
SERVER = https://webwork-ptx.aimath.org
# Extract webwork problems into a single XML file called
# webwork-extraction.xml which holds multiple versions of each problem.
# Also locally store images from the WeBWorK server.
acmv-extraction:
-rm -rf $(WWOUT)
install -d $(WWOUT)
$(PTX)/pretext/pretext -c webwork -d $(WWOUT) -s $(SERVER) $(MAINFILE)
# HTML output
# Output lands in the subdirectory: $(HTMLOUT)
# Remove the entire $(HTMLOUT)/knowl directory because of how PTX now
# seems to make a knowl for everything and rm throws an error.
html:
install -d $(HTMLOUT)
-rm -rf $(HTMLOUT)/knowl
-rm -rf $(HTMLOUT)/images
install -d $(HTMLOUT)/knowl
install -d $(HTMLOUT)/images
install -d $(OUTPUT)
install -d $(OUTPUT)/images
install -d $(PTXUSR)
install -b xsl/acmv-html.xsl $(PTXUSR)
install -b xsl/acmv-common.xsl $(PTXUSR)
-rm $(HTMLOUT)/*.html
cp -a $(AC3IMAGESSRC) $(HTMLOUT)
cp -a $(IMAGESSRC) $(HTMLOUT)
cp -a $(WWOUT)/* $(HTMLOUT)/images
cd $(HTMLOUT); \
xsltproc -xinclude -stringparam publisher $(PRJ)/pub/html.xml $(PTXUSR)/acmv-html.xsl $(MAINFILE)
###########
# Utilities
###########
# Verify Source integrity
# Leaves "schema_errors.txt" in OUTPUT
# can then grep on, e.g.
# "element XXX:"
# "does not follow"
# "Element XXXX content does not follow"
# "No declaration for"
# Automatically invokes the "less" pager, could configure as $(PAGER)
check:
install -d $(OUTPUT)
-rm $(OUTPUT)/schema_errors.*
-java -classpath $(JING_DIR)/build -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration -jar $(JING_DIR)/build/jing.jar $(PTX)/schema/pretext.rng $(MAINFILE) > $(OUTPUT)/schema_errors.txt
xsltproc --xinclude $(PTX)/schema/pretext-schematron.xsl $(MAINFILE) >> $(OUTPUT)/schema_errors.txt
less $(OUTPUT)/schema_errors.txt