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

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

updates to makefile

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