Debian Codegraph @

makefile

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1
2 VERSION = 1.2-5
3 VERSION_ = 1.2.5
4 JAVAC = javac
5 JAVA = java
6 JAR = jar
7 JAVADOC = javadoc
8
9 # If you're building with java8, you can uncomment this to reduce warnings
10 JAVADOC_FLAGS = -Xdoclint:all,-missing
11
12 JARFILE = jcdf.jar
13
14 WWW_FILES = $(JARFILE) javadocs index.html cdflist.html cdfdump.html
15 WWW_DIR = /home/mbt/public_html/jcdf
16
17 TEST_JARFILE = jcdf_test.jar
18 TEST_CDFS = data/example1.cdf data/example2.cdf data/test.cdf data/local/*.cdf
19 TEST_BADLEAP = data/test_badleap.cdf
20 NASACDFJAR = nasa/cdfjava_3.6.0.4.jar
21 NASALEAPSECFILE = nasa/CDFLeapSeconds.txt
22
23 ARTIFACT_PKG = jcdf-$(VERSION_)
24 ARTIFACTS = $(ARTIFACT_PKG).jar \
25 $(ARTIFACT_PKG)-sources.jar \
26 $(ARTIFACT_PKG)-javadoc.jar
27
28 # See https://central.sonatype.org/publish/publish-manual/
29 # Uses gpg and ~/.m2/settings.xml
30 SIGN_AND_DEPLOY = \
31 mvn gpg:sign-and-deploy-file \
32 -Durl=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ \
33 -DrepositoryId=ossrh -DpomFile=pom.xml
34
35 JSRC = \
36 BankBuf.java \
37 Buf.java \
38 Bufs.java \
39 Pointer.java \
40 SimpleNioBuf.java \
41 WrapperBuf.java \
42 \
43 AttributeDescriptorRecord.java \
44 AttributeEntryDescriptorRecord.java \
45 CdfDescriptorRecord.java \
46 CompressedCdfRecord.java \
47 CompressedParametersRecord.java \
48 CompressedVariableValuesRecord.java \
49 GlobalDescriptorRecord.java \
50 Record.java \
51 RecordFactory.java \
52 RecordPlan.java \
53 SparsenessParametersRecord.java \
54 UnusedInternalRecord.java \
55 VariableDescriptorRecord.java \
56 VariableIndexRecord.java \
57 VariableValuesRecord.java \
58 CdfField.java \
59 OffsetField.java \
60 \
61 BitExpandInputStream.java \
62 Compression.java \
63 DataReader.java \
64 NumericEncoding.java \
65 RunLengthInputStream.java \
66 RecordMap.java \
67 \
68 AttributeEntry.java \
69 CdfContent.java \
70 GlobalAttribute.java \
71 VariableAttribute.java \
72 Variable.java \
73 CdfInfo.java \
74 CdfReader.java \
75 DataType.java \
76 Shaper.java \
77 CdfFormatException.java \
78 EpochFormatter.java \
79 TtScaler.java \
80 \
81 CdfDump.java \
82 CdfList.java \
83 LogUtil.java \
84
85 TEST_JSRC = \
86 ExampleTest.java \
87 SameTest.java \
88 OtherTest.java \
89 BufTest.java \
90
91 build: jar docs artifacts
92
93 jar: $(JARFILE)
94
95 docs: $(WWW_FILES)
96
97 artifacts: artifacts.zip
98
99 javadocs: $(JSRC) package-info.java
100 rm -rf javadocs
101 mkdir javadocs
102 $(JAVADOC) $(JAVADOC_FLAGS) -quiet \
103 -d javadocs $(JSRC) package-info.java
104
105 index.html: jcdf.xhtml
106 xmllint -noout jcdf.xhtml && \
107 xmllint -html jcdf.xhtml >index.html
108
109 cdflist.html: $(JARFILE)
110 ./examples.sh \
111 "java -classpath $(JARFILE) uk.ac.bristol.star.cdf.util.CdfList" \
112 "-help" \
113 "data/example1.cdf" \
114 "-data data/example1.cdf" \
115 >$@
116
117 cdfdump.html: $(JARFILE)
118 ./examples.sh \
119 "java -classpath $(JARFILE) uk.ac.bristol.star.cdf.util.CdfDump" \
120 "-help" \
121 "data/example1.cdf" \
122 "-fields -html data/example1.cdf" \
123 >$@
124
125 installwww: $(WWW_DIR) $(WWW_FILES)
126 rm -rf $(WWW_DIR)/* && \
127 cp -r $(WWW_FILES) $(WWW_DIR)/
128
129 updatewww: $(WWW_DIR)/index.html
130
131 $(WWW_DIR)/index.html: index.html
132 cp index.html $@
133
134 $(NASALEAPSECFILE):
135 curl 'https://cdf.gsfc.nasa.gov/html/CDFLeapSeconds.txt' >$@
136
137 test: build buftest extest othertest badleaptest convtest
138
139 convtest: $(JARFILE) $(TEST_JARFILE)
140 rm -rf tmp; \
141 mkdir tmp; \
142 for f in $(TEST_CDFS); \
143 do \
144 files=`./cdfvar.sh -outdir tmp -report $$f`; \
145 cmd="java -ea -classpath $(JARFILE):$(TEST_JARFILE) \
146 uk.ac.bristol.star.cdf.test.SameTest $$files"; \
147 ./cdfvar.sh -outdir tmp -create $$f && \
148 echo $$cmd && \
149 $$cmd || \
150 break; \
151 done
152
153 extest: $(JARFILE) $(TEST_JARFILE)
154 jargs="-ea \
155 -classpath $(JARFILE):$(TEST_JARFILE) \
156 uk.ac.bristol.star.cdf.test.ExampleTest \
157 data/example1.cdf data/example2.cdf data/test.cdf" && \
158 java -Duser.timezone=GMT $$jargs && \
159 java -Duser.timezone=PST $$jargs && \
160 java -Duser.timezone=EET $$jargs && \
161 java $$jargs
162
163 othertest: $(JARFILE) $(TEST_JARFILE) $(NASACDFJAR) $(NASALEAPSECFILE)
164 jargs="-ea \
165 -classpath $(JARFILE):$(TEST_JARFILE):$(NASACDFJAR) \
166 uk.ac.bristol.star.cdf.test.OtherTest" && \
167 export CDF_LEAPSECONDSTABLE=$(NASALEAPSECFILE) && \
168 java -Duser.timezone=GMT $$jargs && \
169 java -Duser.timezone=PST $$jargs && \
170 java -Duser.timezone=EET $$jargs && \
171 java $$jargs
172
173 buftest: $(JARFILE) $(TEST_JARFILE)
174 java -ea \
175 -classpath $(JARFILE):$(TEST_JARFILE) \
176 uk.ac.bristol.star.cdf.test.BufTest
177
178 badleaptest: $(JARFILE) $(TEST_BADLEAP)
179 # This one should run OK
180 java -classpath $(JARFILE) uk.ac.bristol.star.cdf.util.CdfDump \
181 $(TEST_BADLEAP) >/dev/null
182 # but this one should report that the file's leap seconds table
183 # is out of date and exit with a RuntimeException
184 if java -classpath $(JARFILE) \
185 uk.ac.bristol.star.cdf.util.CdfList -data \
186 $(TEST_BADLEAP) >/dev/null 2>&1; then \
187 should_have_failed; \
188 fi
189
190 pom.xml:
191 sed 's/__VERSION__/$(VERSION_)/g' <pom.xml.in >$@
192
193 uploadmaven: $(ARTIFACTS) pom.xml
194 $(SIGN_AND_DEPLOY) -Dfile=$(ARTIFACT_PKG).jar
195 $(SIGN_AND_DEPLOY) -Dfile=$(ARTIFACT_PKG)-sources.jar \
196 -Dclassifier=sources
197 $(SIGN_AND_DEPLOY) -Dfile=$(ARTIFACT_PKG)-javadoc.jar \
198 -Dclassifier=javadoc
199 @echo
200 @echo "Now close and release from staging repository https://s01.oss.sonatype.org/"
201 @echo "see https://central.sonatype.org/publish/release/"
202
203 clean:
204 rm -rf $(JARFILE) $(TEST_JARFILE) tmp \
205 index.html javadocs cdflist.html cdfdump.html \
206 $(ARTIFACTS) artifacts.zip \
207 $(ARTIFACT_PKG).jar.asc \
208 $(ARTIFACT_PKG)-sources.jar.asc \
209 $(ARTIFACT_PKG)-javadoc.jar.asc \
210 pom.xml pom.xml.asc
211
212 $(JARFILE): $(JSRC)
213 rm -rf tmp
214 mkdir -p tmp
215 $(JAVAC) -Xlint:unchecked -source 1.5 -target 1.5 -d tmp $(JSRC) \
216 && echo "$(VERSION)" >tmp/uk/ac/bristol/star/cdf/jcdf.version \
217 && $(JAR) cf $@ -C tmp .
218 rm -rf tmp
219
220 $(TEST_JARFILE): $(JARFILE) $(TEST_JSRC)
221 rm -rf tmp
222 mkdir -p tmp
223 $(JAVAC) -Xlint:unchecked -d tmp -classpath $(JARFILE) $(TEST_JSRC) \
224 && $(JAR) cf $@ -C tmp .
225 rm -rf tmp
226
227 artifacts.zip: $(ARTIFACTS)
228 jar cfM $@ $(ARTIFACTS)
229
230 $(ARTIFACT_PKG).jar: $(JARFILE)
231 cp $(JARFILE) $@
232
233 $(ARTIFACT_PKG)-sources.jar: $(JSRC)
234 $(JAR) cf $@ $(JSRC)
235
236 $(ARTIFACT_PKG)-javadoc.jar: javadocs
237 $(JAR) cf $@ -C javadocs .
238