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

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

cleaned up package imports

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)/../js/exptData.js
103        rsync -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
128siteDataNew:
129        mkdir new new/data
130        mv dreqPy/xls new/data/tabs02
131        mv dreqPy/html/tabs03 new/
132        mv dreqPy/html/u new/
133        mv dreqPy/html/t new/
134        cp dreqPy/data3.js new/data/mipVarsData.js
135        cp dreqPy/data3ex.js new/data/exptData.js
136
137siteData:
138        if [ -e "$(wwwdata)/new" ]; then \
139          echo "Let's rock" >&2; \
140        else \
141          echo "Base directory -- $(wwwdata)/new -- does not exist" >&2; \
142          exit 1; \
143        fi
144        mkdir -p $(wwwdata)/new/data/tabs02/  $(wwwdata)/new/tabs03/ $(wwwdata)/new/u/ $(wwwdata)/new/t/
145        rsync -r dreqPy/xls/ $(wwwdata)/new/data/tabs02/
146        rsync -r dreqPy/html/tabs03/ $(wwwdata)/new/tabs03/
147        rsync -r dreqPy/html/u/ $(wwwdata)/new/u/
148        rsync -r dreqPy/html/t/ $(wwwdata)/new/t/
149        cp dreqPy/data3.js $(wwwdata)/new/data/mipVarsData.js
150        cp dreqPy/data3ex.js $(wwwdata)/new/data/exptData.js
151
152siteDataV2:
153        cp dreqPy/tab01_1_1_dn.html dreqPy/tab01_1_1.html dreqPy/tab01_3_3.html $(wwwdata)/new/
154        cp -r dreqPy/html/index $(wwwdata)/new/
155        cp -r dreqPy/html/index.html $(wwwdata)/new/
156
157betaHtml:
158        mkdir -p $(www)/beta/ $(www)/beta/css/ $(www)/beta/index/
159        (cd $(www)/beta; ln -s $(wwwdata)/new/data ; ln -s $(wwwdata)/new/tabs03 ;  ln -s $(wwwdata)/new/u ; ln -s $(wwwdata)/new/t)
160        cp dreqPy/tab01_1_1_dn.html dreqPy/tab01_1_1.html dreqPy/tab01_3_3.html $(www)/beta/
161        cp websiteExtras/dreq.css $(www)/beta/css/
162        cp -r dreqPy/html/index/* $(www)/beta/index/
163        cp -r dreqPy/html/index.html $(www)/beta/
164
165betaHtmlV2:
166        mkdir -p $(www)/beta/ $(www)/beta/css/ $(www)/beta/index/
167        (cd $(www)/beta; ln -s $(wwwdata)/new/data ; ln -s $(wwwdata)/new/tabs03 ;  ln -s $(wwwdata)/new/u ; ln -s $(wwwdata)/new/t)
168        (cd $(wwwdata)/new/; cp tab01_1_1_dn.html tab01_1_1.html tab01_3_3.html $(www)/beta/)
169        cp websiteExtras/dreq.css $(www)/beta/css/
170        cp -r $(wwwdata)/new/index/* $(www)/beta/index/
171        cp -r $(wwwdata)/new/index.html $(www)/beta/
172
173siteHtml:
174        cp dreqPy/tab01_1_1_dn.html dreqPy/tab01_1_1.html dreqPy/tab01_3_3.html $(www)/
175        mkdir -p $(www)/css; mkdir -p $(www)/index/
176        cp websiteExtras/dreq.css $(www)/css
177        cp -r dreqPy/html/index/* $(www)/index/
178        cp -r dreqPy/html/index.html $(www)/
179
180versionHtml:
181        mkdir $(www)/$(version)  $(www)/$(version)/index $(www)/$(version)/css
182        cp $(www)/tab01_1_1_dn.html dreqPy/tab01_1_1.html dreqPy/tab01_3_3.html $(www)/$(version)
183        cp  $(www)/css/dreq.css  $(www)/$(version)/css/
184        cp $(www)/index/* $(www)/$(version)/index/
185        cp $(www)/index.html $(www)/experiments.html $(www)/mipVars.html  $(www)/$(version)
186
187versionLinks:
188        (cd $(www)/$(version); ln -s $(wwwdata)/$(version)/data)
189        (cd $(www)/$(version); ln -s $(wwwdata)/$(version)/tabs03)
190        (cd $(www)/$(version); ln -s $(wwwdata)/$(version)/u)
191        (cd $(www)/$(version); ln -s $(wwwdata)/$(version)/t)
192
193cleanLocalHtml:
194        cp -r dreqPy/xls/* $(www)/data/tabs02/
195        cp -r dreqPy/html/tabs03/* $(www)/tabs03/
196        cp dreqPy/tab01_1_1.html dreqPy/tab01_3_3.html $(www)/
197        cp dreqPy/data3.js $(www)/data/mipVarsData.js
198        cp websiteExtras/dreq.css $(www)/css
199        mv $(www)/u/ $(www)/u1
200        cp -r dreqPy/html/u $(www)/
201        mv $(www)/t/ $(www)/t1
202        cp -r dreqPy/html/t $(www)/
203        cp -r dreqPy/html/index/* $(www)/index/
204        cp -r dreqPy/html/index.html $(www)/
205        echo clearing up ... may take some time
206        find  $(www)/u1 -name "*.html" -exec rm {} \;
207        find  $(www)/t1 -name "*.html" -exec rm {} \;
208        rmdir $(www)/u1
209        rmdir $(www)/t1
210
211cleanHtml:
212        find dreqPy/html/u -type f -exec rm {} \;
213        rm dreqPy/html/t/* dreqPy/html/tt/*
214        find /var/www/f/u -type f -exec rm {} \;
215        rm /var/www/f/t/*
216
217sHtml:
218        zip -r html.zip data2.js html
219
Note: See TracBrowser for help on using the repository browser.