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

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

makefile update

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