1 | |
---|
2 | |
---|
3 | targ ?= dreq |
---|
4 | fmt ?= txt |
---|
5 | www ?= /var/www/html/dreq |
---|
6 | ddir ?= /data/svn/exarch/CMIP6dreq/trunk |
---|
7 | |
---|
8 | |
---|
9 | .PHONY: config checkSamp schema checkSchema |
---|
10 | |
---|
11 | config: out/$(targ)Sample.xml out/$(targ)Defn.xml checkSamp |
---|
12 | |
---|
13 | configV: out/vocabSample.xml out/vocabDefn.xml checkVSamp |
---|
14 | |
---|
15 | configu: out/dreqUpdSample.xml out/dreqUpdDefn.xml checkSampU |
---|
16 | |
---|
17 | out/dreqUpdSample.xml: ../../docs/dreq.txt ptxt.py |
---|
18 | python ptxt.py -f dreq.txt updsamp |
---|
19 | |
---|
20 | out/dreqUpdDefn.xml: ../../docs/dreq.txt ptxt.py |
---|
21 | python ptxt.py -f dreq.txt upd |
---|
22 | |
---|
23 | out/$(targ)Sample.xml: ../../docs/$(targ).$(fmt) ptxt.py dreqPy/packageConfig.py |
---|
24 | python ptxt.py -f $(targ).$(fmt) samp |
---|
25 | |
---|
26 | out/$(targ)Defn.xml: ../../docs/$(targ).$(fmt) ptxt.py |
---|
27 | python ptxt.py -f $(targ).$(fmt) defn |
---|
28 | |
---|
29 | out/vocabSample.xml: ../../docs/vocab.txt ptxt.py |
---|
30 | python ptxt.py -f vocab.txt samp |
---|
31 | |
---|
32 | out/vocabDefn.xml: ../../docs/vocab.txt ptxt.py |
---|
33 | python ptxt.py -f vocab.txt defn |
---|
34 | |
---|
35 | checkVSamp: |
---|
36 | xmllint --noout --schema out/vocabFrameworkSchema.xsd out/vocabDefn.xml |
---|
37 | |
---|
38 | checkSamp: |
---|
39 | xmllint --noout --schema out/vocabFrameworkSchema.xsd out/$(targ)Defn.xml |
---|
40 | |
---|
41 | checkSampU: |
---|
42 | xmllint --noout --schema out/vocabFrameworkSchema.xsd out/dreqUpdDefn.xml |
---|
43 | |
---|
44 | schema: config out/$(targ)Schema.xsd checkSchema |
---|
45 | |
---|
46 | schemaV: configV out/vocabSchema.xsd checkSchemaV |
---|
47 | |
---|
48 | xsd: ../../docs/xlst_xdsSchemaGen.xml config out/$(targ)Defn.xml |
---|
49 | xsltproc ../../docs/xlst_xdsSchemaGen.xml out/$(targ)Defn.xml > out/$(targ)Schema.xsd |
---|
50 | |
---|
51 | out/vocabSchema.xsd: ../../docs/xlst_xdsSchemaGen.xml configV out/vocabDefn.xml |
---|
52 | xsltproc ../../docs/xlst_xdsSchemaGen.xml out/vocabDefn.xml > out/vocabSchema.xsd |
---|
53 | |
---|
54 | checkSchema: |
---|
55 | xmllint --noout --schema out/$(targ)Schema.xsd out/$(targ)Sample.xml |
---|
56 | |
---|
57 | checkSchemaV: |
---|
58 | xmllint --noout --schema out/vocabSchema.xsd out/vocabSample.xml |
---|
59 | |
---|
60 | distrib: out/dreq2Defn.xml out/dreq2Sample.xml out/dreq2Schema.xsd |
---|
61 | cp out/dreq2Defn.xml out/dreq2Sample.xml out/dreq2Schema.xsd out/vocabFrameworkSchema.xsd $(ddir)/dreqPy/docs |
---|
62 | cp out/vocabDefn.xml out/vocabSample.xml out/vocabSchema.xsd vocab.xml $(ddir)/dreqPy/docs |
---|
63 | echo "docs copied to $(ddir)/dreqPy/docs" |
---|
64 | bash seddreq.sh annotated_20150731.xml dreq.xml dreqPy/dreq.py > $(ddir)/dreqPy/dreq.py |
---|
65 | bash seddreq02.sh "\.\.\/out" "docs" dreqPy/packageConfig.py > $(ddir)/dreqPy/packageConfig.py |
---|
66 | cp htmlTemplates.py dreqPy/scope.py dreqPy/scope_utils.py dreqPy/utilities.py dreqPy/utilP3.py $(ddir)/dreqPy |
---|
67 | cp dreqPy/utilP2/*.py $(ddir)/dreqPy/utilP2/ |
---|
68 | cp dreqPy/dreqCmdl.py dreqPy/makeTables.py dreqPy/vrev.py dreqPy/fgrid.py dreqPy/overviewTabs.py dreqPy/volsum.py dreqPy/__init__.py dreqPy/simpleCheck.py $(ddir)/dreqPy |
---|
69 | cp dreqPy/misc_utils.py dreqPy/table_utils.py dreqPy/rvgExtraTable.py $(ddir)/dreqPy |
---|
70 | cp vocabDemo.py $(ddir)/dreqPy |
---|
71 | cp compare.py $(ddir)/ |
---|
72 | cp out/annotated_20150731_chk.xml $(ddir)/dreqPy/docs/dreq.xml |
---|
73 | cp out/annotated_20150731.xml $(ddir)/dreqPy/docs/dreq_lt.xml |
---|
74 | ### cp LICENSE README.txt setup.py setup.cfg $(ddir)/ |
---|
75 | cp dreqPy/tables/test.xlsx $(ddir)/dreqPy/docs/CMIP6_MIP_tables.xlsx |
---|
76 | cp out/dc1.xsd out/xlink.xsd out/xml.xsd out/pav.xsd $(ddir)/dreqPy/docs/ |
---|
77 | cp out/dreqSuppSchema.xsd out/dreqSuppDefn.xml $(ddir)/dreqPy/docs/ |
---|
78 | cp out/supplement_20150731.xml $(ddir)/dreqPy/docs/dreqSupp.xml |
---|
79 | cp out/dreqManifest_dist.txt $(ddir)/dreqPy/docs/dreqManifest.txt |
---|
80 | cp out/md5Manifest.txt out/sfheadings.csv $(ddir)/dreqPy/docs/ |
---|
81 | cp -r dreqPy/examples $(ddir)/dreqPy/ |
---|
82 | cp out/BlockSchema.csv $(ddir)/dreqPy/docs/ |
---|
83 | echo "source copied to $(ddir)/dreqPy" |
---|
84 | |
---|
85 | dirs: |
---|
86 | mkdir -p html html/index html/t html/u tab2 tabs03 html/tt |
---|
87 | |
---|
88 | localHtml: |
---|
89 | cp -r dreqPy/xls/* $(www)/data/tabs02/ |
---|
90 | cp -r dreqPy/tabs03/* $(www)/tabs03/ |
---|
91 | cp dreqPy/tab01_1_1_dn.html dreqPy/tab01_1_1.html dreqPy/tab01_3_3.html $(www)/ |
---|
92 | cp dreqPy/data3.js $(www)/data/mipVarsData.js |
---|
93 | cp dreqPy/data3ex.js $(www)/data/exptData.js |
---|
94 | cp websiteExtras/dreq.css $(www)/css |
---|
95 | cp -r dreqPy/html/u/* $(www)/u/ |
---|
96 | cp -r dreqPy/html/t/* $(www)/t/ |
---|
97 | cp -r dreqPy/html/index/* $(www)/index/ |
---|
98 | cp -r dreqPy/html/index.html $(www)/ |
---|
99 | |
---|
100 | cleanLocalHtml: |
---|
101 | cp -r dreqPy/xls/* $(www)/data/tabs02/ |
---|
102 | cp -r dreqPy/tabs03/* $(www)/tabs03/ |
---|
103 | cp dreqPy/tab01_1_1.html dreqPy/tab01_3_3.html $(www)/ |
---|
104 | cp dreqPy/data3.js $(www)/data/mipVarsData.js |
---|
105 | cp websiteExtras/dreq.css $(www)/css |
---|
106 | mv $(www)/u/ $(www)/u1 |
---|
107 | cp -r dreqPy/html/u $(www)/ |
---|
108 | mv $(www)/t/ $(www)/t1 |
---|
109 | cp -r dreqPy/html/t $(www)/ |
---|
110 | cp -r dreqPy/html/index/* $(www)/index/ |
---|
111 | cp -r dreqPy/html/index.html $(www)/ |
---|
112 | echo clearing up ... may take some time |
---|
113 | find $(www)/u1 -name "*.html" -exec rm {} \; |
---|
114 | find $(www)/t1 -name "*.html" -exec rm {} \; |
---|
115 | rmdir $(www)/u1 |
---|
116 | rmdir $(www)/t1 |
---|
117 | |
---|
118 | cleanHtml: |
---|
119 | find dreqPy/html/u -type f -exec rm {} \; |
---|
120 | rm dreqPy/html/t/* dreqPy/html/tt/* |
---|
121 | find /var/www/f/u -type f -exec rm {} \; |
---|
122 | rm /var/www/f/t/* |
---|
123 | |
---|
124 | sHtml: |
---|
125 | zip -r html.zip data2.js html |
---|
126 | |
---|