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

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

updated Makefile

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