source: CMIP6dreqbuild/trunk/src/framework/Makefile @ 1241

Subversion URL: http://proj.badc.rl.ac.uk/svn/exarch/CMIP6dreqbuild/trunk/src/framework/Makefile@1241
Revision 1241, 5.8 KB checked in by mjuckes, 12 months ago (diff)

cand. 01.00.27

Line 
1
2
3targ ?= dreq2
4fmt ?= xls
5www ?= /var/www/html/dreq
6wwwdata ?= /group_workspaces/jasmin2/cmip6_prep/cmip6_data_request/site
7ddir ?= /data/svn/exarch/CMIP6dreq/trunk
8
9
10.PHONY: config checkSamp schema checkSchema
11
12build:
13        make xsd targ=dreq2
14        make xsd targ=dreqSupp
15
16config: out/$(targ)Sample.xml out/$(targ)Defn.xml checkSamp
17
18configV: out/vocabSample.xml out/vocabDefn.xml checkVSamp
19
20configu: out/dreqUpdSample.xml out/dreqUpdDefn.xml checkSampU
21
22out/dreqUpdSample.xml: ../../docs/dreq.txt ptxt.py
23        python ptxt.py -f dreq.txt updsamp
24
25out/dreqUpdDefn.xml: ../../docs/dreq.txt ptxt.py
26        python ptxt.py -f dreq.txt upd
27
28out/$(targ)Sample.xml: ../../docs/$(targ).$(fmt) ptxt.py   dreqPy/packageConfig.py
29        python ptxt.py -f $(targ).$(fmt) samp
30
31out/$(targ)Defn.xml: ../../docs/$(targ).$(fmt) ptxt.py
32        python ptxt.py -f $(targ).$(fmt) defn
33
34out/vocabSample.xml: ../../docs/vocab.txt ptxt.py
35        python ptxt.py -f vocab.txt samp
36
37out/vocabDefn.xml: ../../docs/vocab.txt ptxt.py
38        python ptxt.py -f vocab.txt defn
39
40checkVSamp:
41        xmllint --noout --schema out/vocabFrameworkSchema.xsd out/vocabDefn.xml
42
43checkSamp:
44        xmllint --noout --schema out/vocabFrameworkSchema.xsd out/$(targ)Defn.xml
45
46checkSampU:
47        xmllint --noout --schema out/vocabFrameworkSchema.xsd out/dreqUpdDefn.xml
48
49schema: config out/$(targ)Schema.xsd checkSchema
50
51schemaV: configV out/vocabSchema.xsd checkSchemaV
52
53xsd: ../../docs/xlst_xdsSchemaGen.xml config  out/$(targ)Defn.xml
54        xsltproc ../../docs/xlst_xdsSchemaGen.xml out/$(targ)Defn.xml > out/$(targ)Schema.xsd
55
56out/vocabSchema.xsd: ../../docs/xlst_xdsSchemaGen.xml configV  out/vocabDefn.xml
57        xsltproc ../../docs/xlst_xdsSchemaGen.xml out/vocabDefn.xml > out/vocabSchema.xsd
58
59checkSchema:
60        xmllint --noout --schema out/$(targ)Schema.xsd out/$(targ)Sample.xml
61
62checkSchemaV:
63        xmllint --noout --schema out/vocabSchema.xsd out/vocabSample.xml
64
65distrib: out/dreq2Defn.xml  out/dreq2Sample.xml  out/dreq2Schema.xsd
66        cp  out/dreq2Defn.xml  out/dreq2Sample.xml  out/dreq2Schema.xsd  out/vocabFrameworkSchema.xsd $(ddir)/dreqPy/docs
67        cp  out/vocabDefn.xml  out/vocabSample.xml  out/vocabSchema.xsd vocab.xml  $(ddir)/dreqPy/docs
68        echo "docs copied to $(ddir)/dreqPy/docs"
69        bash seddreq.sh annotated_20150731.xml dreq.xml dreqPy/dreq.py >  $(ddir)/dreqPy/dreq.py
70        bash seddreq02.sh "\.\.\/out" "docs" dreqPy/packageConfig.py > $(ddir)/dreqPy/packageConfig.py
71        cp htmlTemplates.py dreqPy/scope.py dreqPy/scope_utils.py dreqPy/utilities.py dreqPy/utilP3.py $(ddir)/dreqPy   
72        cp dreqPy/utilP2/*.py $(ddir)/dreqPy/utilP2/
73        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
74        cp dreqPy/extensions/collect.py dreqPy/extensions/versions.py dreqPy/extensions/__init__.py $(ddir)/dreqPy/extensions/
75        cp dreqPy/misc_utils.py dreqPy/table_utils.py dreqPy/rvgExtraTable.py $(ddir)/dreqPy
76        cp vocabDemo.py $(ddir)/dreqPy 
77        cp compare.py $(ddir)
78        cp out/annotated_20150731_chk.xml $(ddir)/dreqPy/docs/dreq.xml
79        cp out/annotated_20150731.xml $(ddir)/dreqPy/docs/dreq_lt.xml
80        ### cp LICENSE README.txt setup.py setup.cfg $(ddir)/
81        cp dreqPy/tables/test.xlsx $(ddir)/dreqPy/docs/CMIP6_MIP_tables.xlsx
82        cp out/dc1.xsd out/xlink.xsd out/xml.xsd out/pav.xsd $(ddir)/dreqPy/docs/
83        cp out/dreqSuppSchema.xsd out/dreqSuppDefn.xml $(ddir)/dreqPy/docs/
84        cp out/supplement_20150731.xml $(ddir)/dreqPy/docs/dreqSupp.xml
85        cp out/dreqManifest_dist.txt $(ddir)/dreqPy/docs/dreqManifest.txt
86        cp out/md5Manifest.txt out/sfheadings.csv $(ddir)/dreqPy/docs/
87        cp -r dreqPy/examples $(ddir)/dreqPy/
88        cp out/BlockSchema.csv $(ddir)/dreqPy/docs/
89        echo "source copied to $(ddir)/dreqPy"
90
91dirs:
92        mkdir -p html html/index  html/t  html/u tab2 tabs03  html/tt
93
94localHtml:
95        cp -r dreqPy/xls/* $(www)/data/tabs02/
96        cp -r dreqPy/tabs03/* $(www)/tabs03/
97        cp dreqPy/tab01_1_1_dn.html dreqPy/tab01_1_1.html dreqPy/tab01_3_3.html $(www)/
98        cp dreqPy/data3.js $(www)/data/mipVarsData.js
99        cp dreqPy/data3ex.js $(www)/data/exptData.js
100        cp websiteExtras/dreq.css $(www)/css
101        cp -r dreqPy/html/u/* $(www)/u/
102        cp -r dreqPy/html/t/* $(www)/t/
103        cp -r dreqPy/html/index/* $(www)/index/
104        cp -r dreqPy/html/index.html $(www)/
105
106siteDataShift:
107        ##mv $(wwwdata)/latest $(wwwdata)/$(version)
108        ##[[ $$? != 0 ]] && exit -1;
109        ##echo MOVED $(wwwdata)/latest to $(wwwdata)/$(version)
110        mv $(wwwdata)/new $(wwwdata)/latest
111        [[ $$? != 0 ]] && exit -1;
112        echo MOVED $(wwwdata)/new to $(wwwdata)/latest
113
114
115siteData:
116        if [ -e "$(wwwdata)/new" ]; then \
117          echo "Let's rock" >&2; \
118        else \
119          echo "Base directory does not exist" >&2; \
120          exit 1; \
121        fi
122        mkdir -p $(wwwdata)/new/data/tabs02/  $(wwwdata)/new/tabs03/ $(wwwdata)/new/u/ $(wwwdata)/new/t/
123        cp -r dreqPy/xls/* $(wwwdata)/new/data/tabs02/
124        cp -r dreqPy/tabs03/* $(wwwdata)/new/tabs03/
125        rsync -r dreqPy/html/u/ $(wwwdata)/new/u/
126        rsync -r dreqPy/html/t/ $(wwwdata)/new/t/
127        cp dreqPy/data3.js $(wwwdata)/new/data/mipVarsData.js
128        cp dreqPy/data3ex.js $(wwwdata)/new/data/exptData.js
129
130siteHtml:
131        cp dreqPy/tab01_1_1_dn.html dreqPy/tab01_1_1.html dreqPy/tab01_3_3.html $(www)/
132        cp websiteExtras/dreq.css $(www)/css
133        cp -r dreqPy/html/index/* $(www)/index/
134        cp -r dreqPy/html/index.html $(www)/
135
136cleanLocalHtml:
137        cp -r dreqPy/xls/* $(www)/data/tabs02/
138        cp -r dreqPy/tabs03/* $(www)/tabs03/
139        cp dreqPy/tab01_1_1.html dreqPy/tab01_3_3.html $(www)/
140        cp dreqPy/data3.js $(www)/data/mipVarsData.js
141        cp websiteExtras/dreq.css $(www)/css
142        mv $(www)/u/ $(www)/u1
143        cp -r dreqPy/html/u $(www)/
144        mv $(www)/t/ $(www)/t1
145        cp -r dreqPy/html/t $(www)/
146        cp -r dreqPy/html/index/* $(www)/index/
147        cp -r dreqPy/html/index.html $(www)/
148        echo clearing up ... may take some time
149        find  $(www)/u1 -name "*.html" -exec rm {} \;
150        find  $(www)/t1 -name "*.html" -exec rm {} \;
151        rmdir $(www)/u1
152        rmdir $(www)/t1
153
154cleanHtml:
155        find dreqPy/html/u -type f -exec rm {} \;
156        rm dreqPy/html/t/* dreqPy/html/tt/*
157        find /var/www/f/u -type f -exec rm {} \;
158        rm /var/www/f/t/*
159
160sHtml:
161        zip -r html.zip data2.js html
162
Note: See TracBrowser for help on using the repository browser.