chiark / gitweb /
Makefile: Arrangements for honouring RUST_VERSION
[otter.git] / Makefile
1 # Copyright 2020-2021 Ian Jackson and contributors to Otter
2 # SPDX-License-Identifier: AGPL-3.0-or-later
3 # There is NO WARRANTY.
4
5 # make -j8
6 # make -j8 release
7 # make -j8 shapelib
8
9 SHELL=/bin/bash
10 src=.
11
12 default: all check
13 all: debug
14 full-check: all check cargo-syntaxcheck-release shapelib doc-sphinx
15 full-check: for-deploy release
16 everything: debug doc release check bundled-sources
17
18 shapelib: templates/shapelib.html docs/html/index.html
19         @echo 'Shape library preview and docs can now be found here:'
20         @for f in $^; do echo '  file://$(PWD)/'$$f; done
21
22 MAKEFILE_DEP ?= Makefile
23 MAKEFILE_FIND_X ?=
24 # ^ set this to "x" to debug the $rsrcs rune
25
26 #---------- funky macros etc. ----------
27
28 cr = $(addprefix --,$(filter-out debug,$1))
29 rsrcs = $(shell $(foreach x,$(MAKEFILE_FIND_X),set -$x;)\
30     find -H $1 \( -name Cargo.toml -o -name Cargo.lock -o -name Cargo.lock.example -o -name \*.rs \) \! -path '*/build/*' )
31 stamp=@mkdir -p stamp; touch $@
32
33 BUNDLED_SOURCES_LIT = README.md LICENCE
34 BUNDLED_SOURCES_FILES = index.html $(BUNDLED_SOURCES_LIT)
35 BUNDLED_SOURCES_LINKS += $(BUNDLED_SOURCES_LIT) otter/
36 BUNDLED_SOURCES += $(BUNDLED_SOURCES_FILES)
37
38 #---------- programs and config variables ----------
39
40 TARGET_DIR ?= target
41
42 USVG_OPTIONS = "--sans-serif-family=DejaVu Sans"
43
44 WASM_BINDGEN = $(TARGET_DIR)/debug/wasm-bindgen
45 WASM_BINDGEN_OPTIONS =                                          \
46         --remove-name-section --remove-producers-section        \
47         --typescript
48
49 BUNDLE_SOURCES ?= bundle-rust-sources
50
51 SPHINXBUILD   ?= sphinx-build
52
53 ifndef INKSCAPE_EXTENSIONS
54 INKSCAPE ?= inkscape
55 INKSCAPE_SDD_QUIETEN ?= 2>/dev/null
56 # inkscape 0.92.4: --extension-directory works, no --system-data-directory
57 # inkscape 1.0.2: --system-data-directory, no --extension-directory
58 INKSCAPE_EXTENSIONS := $(shell set -e; { sdd=$$( $(INKSCAPE) --system-data-directory $(INKSCAPE_SDD_QUIETEN) ) && echo "$$sdd/extensions"; } || $(INKSCAPE) --extension-directory )
59 endif
60 RECOLOUR_SVG ?= ./run-inkscape-extension $(INKSCAPE_EXTENSIONS)/color_replace.py
61
62 DEPLOY_ARCH=x86_64-unknown-linux-musl
63 DEPLOY_RELEASE=debug
64 DEPLOY_TARGET_DIR=$(TARGET_DIR)/$(addsuffix /,$(DEPLOY_ARCH))$(DEPLOY_RELEASE)
65 DEPLOYED_BRANCH=deployed
66 PUBLISHED_BRANCH=published
67
68 RUST_CLIPPY_OPTIONS ?= $(shell perl -pe 's/\#.*//; s/\n/ /' clippy-options)
69 RUST_CLIPPY ?= clippy
70 RUST_CLIPPY_CMD := clippy $(RUST_CLIPPY_OPTIONS)
71
72 #---------- nailing-cargo ----------
73
74 ifneq (,$(wildcard ../Cargo.nail))
75
76 NAILING_CARGO ?= nailing-cargo
77 CARGO_CMD ?= $(NAILING_CARGO)
78 BUILD_SUBDIR ?= ../Build
79 TARGET_DIR = $(BUILD_SUBDIR)/$(notdir $(PWD))/target
80
81 NAILING_CARGO_JUST_RUN ?= $(NAILING_CARGO) --just-run -q ---
82 BUNDLE_SOURCES_CMD ?= $(NAILING_CARGO) --- $(BUNDLE_SOURCES)
83 USVG_CMD ?= $(NAILING_CARGO_JUST_RUN) $(USVG)
84 WASM_BINDGEN_CLI_CARGO_OPTS ?= --subcommand-props=!manifest-path
85
86 clean-nailing:
87         $(NAILING_CARGO_JUST_RUN) \
88  sh -c 'cd "$1"; find -mindepth 1 -maxdepth 1 -print0 | xargs -0r rm -rf --' \
89                 $(abspath $(BUILD_SUBDIR)/$(notdir $(PWD)))
90
91 else
92 CARGO_CMD ?= cargo
93 clean-nailing:
94 endif # Cargo.nail
95
96 BUILD_SUBDIR ?= ../Build
97 BUNDLE_SOURCES_CMD ?= $(BUNDLE_SOURCES)
98 USVG_CMD ?= $(USVG)
99
100 WASM_PACKED=$(TARGET_DIR)/packed-wasm
101
102 #---------- local programs ----------
103
104 define lp
105 stamp/cargo.$2: $(call rsrcs, ! -name \*.rs)
106         $$(CARGO) build $(call cr,$3) -p $2
107         $$(stamp)
108 $1 := $(abspath $(TARGET_DIR)/$3/$4)
109 endef
110
111 $(eval $(call lp,BUNDLE_SOURCES,bundle-sources,debug,bundle-rust-sources))
112 $(eval $(call lp,USVG,usvg,release,usvg))
113
114 #---------- variables defining bits of source etc. ----------
115
116 PROGRAMS=daemon-otter otter
117
118 WASM_ASSETS := $(addprefix otter_wasm,.js _bg.wasm)
119 WASM_OUTPUTS := $(addprefix otter_wasm,.d.ts)
120
121 TS_SRCS= script
122 TS_SRC_FILES= \
123         $(addprefix templates/,$(addsuffix .ts,$(TS_SRCS))) \
124         webassembly-types/webassembly.d.ts \
125         $(WASM_PACKED)/otter_wasm.d.ts
126
127 LITFILES= LICENCE AGPLv3
128 TXTFILES= CC-BY-SA-3.0 CC-BY-SA-4.0
129
130 FILEASSETS = $(addprefix templates/, libre shapelib.html script.js \
131                         $(LITFILES) $(TXTFILES)) \
132                 $(wildcard templates/*.tera)
133
134 WASM := wasm32-unknown-unknown
135 # ^ todo: Is this still right after
136 #     Use correct ABI for wasm32 by default
137 #     https://github.com/rust-lang/rust/pull/79998
138 # ?  But maybe it doesn't matter since we're very conservative and
139 # only pass JsValue and a few strings across the WASM ABI.
140
141 CARGO = $(CARGO_CMD) $(RUST_VERSION)
142
143 #---------- toplevel aggregate targets ----------
144
145 check: stamp/cargo.debug-check at wdt jstest
146         @echo 'Tests passed.'
147
148 full-check: stamp/cargo.release-check
149 full-check: stamp/cargo.release-miri stamp/cargo.debug-miri
150
151 full-check:
152         @echo 'Full tests passed.'
153
154 doc: cargo-doc doc-sphinx examples
155
156 debug release:: %: stamp/cargo.% assets libraries extra-%
157
158 cargo: cargo-debug cargo-wasm-release
159
160 cargo-debug cargo-release cargo-check cargo-doc \
161 cargo-wasm-debug cargo-wasm-release:: \
162 cargo-%: stamp/cargo.%
163
164 EXAMPLE_BUNDLES = test-bundle big-bundle
165 EXAMPLE_BUNDLE_FILES = $(foreach f, $(EXAMPLE_BUNDLES), examples/$f.zip)
166
167 examples: $(EXAMPLE_BUNDLE_FILES)
168 .PHONY: examples
169
170 cargo-wasm: cargo-wasm-release
171
172 wasm: stamp/wasm-bindgen
173
174 assets: js stamp/wasm-bindgen $(FILEASSETS)
175
176 js: templates/script.js
177
178 extra-debug:
179 extra-release: bundled-sources
180
181 cargo-syntaxcheck: cargo-syntaxcheck-host cargo-syntaxcheck-wasm
182 cargo-syntaxcheck-host:
183         $(CARGO) check --workspace
184 cargo-syntaxcheck-wasm:
185         $(CARGO) check --target $(WASM) -p otter-wasm --release
186 cargo-syntaxcheck-release:
187         $(CARGO) check --workspace --release
188
189 cargo-clippy: cargo-clippy-host cargo-clippy-wasm
190 cargo-clippy-host: clippy-options
191         $(CARGO) $(RUST_CLIPPY) --workspace $(RUST_CLIPPY_OPTIONS)
192 cargo-clippy-wasm: clippy-options
193         $(CARGO) $(RUST_CLIPPY) --target $(WASM) -p otter-wasm $(RUST_CLIPPY_OPTIONS)
194
195 #---------- cargo ----------
196
197 DR=debug release
198 CARGOES=$(foreach t, wasm-,$(addprefix $t,check $(DR)))
199
200 $(addprefix stamp/cargo.,$(DR)):: \
201 stamp/cargo.%: $(call rsrcs,. ! -path './wasm/*')
202         $(CARGO) build --workspace $(call cr,$*) -p otter -p otter-daemon -p otter-cli
203         $(NAILING_CARGO_JUST_RUN) \
204         ln -sf otter $(abspath $(TARGET_DIR))/$*/otter-ssh-proxy
205         $(stamp)
206
207 $(TARGET_DIR)/debug/%: $(call rsrcs, ! -path './wasm/*')
208         $(CARGO) build --workspace -p otter-cli
209         $(NAILING_CARGO_JUST_RUN) touch $(abspath $@)
210
211 stamp/cargo.wasm-bindgen: $(call rsrcs, ! -name \*.rs)
212         $(CARGO_CMD) $(WASM_BINDGEN_CLI_CARGO_OPTS) $(CARGO_VERSION) \
213                 build --target-dir=target \
214                 --manifest-path=$(abspath wasm/Cargo.toml) -p wasm-bindgen-cli
215         $(stamp)
216
217 stamp/cargo.%-check: $(call rsrcs,.)
218         $(CARGO) test --workspace $(call cr,$*)
219         $(stamp)
220
221 stamp/cargo.%-miri: $(call rsrcs,.)
222         $(CARGO) miri test --workspace $(call cr,$*)
223         $(stamp)
224
225 stamp/cargo-at.debug: $(call rsrcs,.)
226         $(CARGO) build --workspace $(call cr,$*) -p otter-api-tests
227         $(stamp)
228
229 stamp/cargo-wdt.debug: $(call rsrcs,.)
230         $(CARGO) build --workspace $(call cr,$*) -p otter-webdriver-tests
231         $(stamp)
232
233 stamp/cargo-jstest.debug: $(call rsrcs,.)
234         $(CARGO) build --workspace $(call cr,$*) -p otter-nodejs-tests
235         $(stamp)
236
237 stamp/cargo.doc: $(call rsrcs,.)
238         set -o pipefail -e; \
239         $(CARGO) doc $(CARGO_DOC_OPTS) --workspace 2>&1 |egrep -vf .cargo-doc-suppress-errors
240         $(stamp)
241
242 $(addprefix stamp/cargo.wasm-,$(DR)):: \
243 stamp/cargo.wasm-%: $(call rsrcs, base wasm Cargo.*)
244         $(CARGO) build --target $(WASM) -p otter-wasm $(call cr,$*)
245         $(stamp)
246
247 stamp/cargo.deploy-build: $(call rsrcs,.)
248         $(CARGO) build --target $(DEPLOY_ARCH) $(call cr,$(DEPLOY_RELEASE)) -p otter -p otter-cli -p otter-daemon
249         $(NAILING_CARGO_JUST_RUN) \
250         ln -sf otter $(abspath $(TARGET_DIR)/$(DEPLOY_ARCH))/$(DEPLOY_RELEASE)/otter-ssh-proxy
251         $(stamp)
252
253 #---------- sphnix ----------
254
255 doc-sphinx:     docs/html/index.html \
256         $(foreach f, $(EXAMPLE_BUNDLES), docs/html/examples/$f.zip) \
257         $(addprefix docs/html/examples/, $(notdir $(wildcard specs/*.toml)))
258         @echo 'Documentation can now be found here:'
259         @echo '  file://$(PWD)/$<'
260
261 docs/html/index.html: docs/conf.py $(wildcard docs/*.md docs/*.rst docs/*.png)
262         $(SPHINXBUILD) -M html docs docs $(SPHINXOPTS)
263
264 docs/html/examples/%.zip: examples/%.zip
265         mkdir -p docs/html/examples
266         rm -f $@ && ln $< $@
267
268 docs/html/examples/%.toml: specs/%.toml
269         mkdir -p docs/html/examples
270         rm -f $@ && ln $< $@
271
272 #---------- jstest ----------
273
274 JSTESTS= basic lower
275
276 .PHONY: jstest
277 jstest jstests: $(foreach t,$(JSTESTS),stamp/$t.jstest)
278
279 stamp/%.jstest: jstest/run1 jstest/%.nodejs templates/script.js \
280                 stamp/wasm-bindgen-jstest stamp/cargo-jstest.debug
281         $(NAILING_CARGO_JUST_RUN) $(abspath $(filter-out stamp/%,$^))
282         $(stamp)
283
284 #---------- wasm ----------
285
286 $(addprefix $(WASM_PACKED)/,$(WASM_ASSETS) $(WASM_OUTPUTS)): stamp/wasm-bindgen
287 stamp/wasm-bindgen: stamp/cargo.wasm-bindgen stamp/cargo.wasm-release
288         $(NAILING_CARGO_JUST_RUN) $(abspath $(WASM_BINDGEN)) \
289                 $(WASM_BINDGEN_OPTIONS) --no-modules \
290                 --out-dir target/packed-wasm \
291                 target/$(WASM)/release/otter_wasm.wasm
292         $(stamp)
293
294 stamp/wasm-bindgen-jstest: stamp/cargo.wasm-bindgen stamp/cargo.wasm-release
295         $(NAILING_CARGO_JUST_RUN) $(abspath $(WASM_BINDGEN)) \
296                 $(WASM_BINDGEN_OPTIONS) --nodejs \
297                 --out-dir target/jstest \
298                 target/$(WASM)/release/otter_wasm.wasm
299         $(stamp)
300
301 #---------- bundle-sources ----------
302
303 BUNDLED_SOURCES_DIRS += otter
304
305 bundled-sources:: $(addprefix bundled-sources/, $(BUNDLED_SOURCES_DIRS))
306
307 TARGET_BUNDLED=$(TARGET_DIR)/bundled-sources
308
309 $(TARGET_BUNDLED):
310         $(NAILING_CARGO_JUST_RUN) mkdir -p $(abspath $@)
311
312 $(addprefix bundled-sources/, $(BUNDLED_SOURCES_DIRS)): \
313 bundled-sources/%: stamp/cargo.bundle-sources $(TARGET_BUNDLED)
314         set -e; d=$(abspath $(TARGET_BUNDLED)); \
315         $(if $(filter-out otter,$*), cd ../$*;) \
316         $(BUNDLE_SOURCES_CMD) --output $$d/$*
317
318 bundled-sources:: $(addprefix $(TARGET_BUNDLED)/, $(BUNDLED_SOURCES_FILES))
319
320 $(addprefix $(TARGET_BUNDLED)/, $(BUNDLED_SOURCES_LIT)): \
321 $(TARGET_BUNDLED)/%: % $(TARGET_BUNDLED)
322         $(NAILING_CARGO_JUST_RUN) cp $(abspath $(src))/$< $(abspath $@)
323
324 $(TARGET_BUNDLED)/index.html: bundled-sources-make-index \
325                 $(MAKEFILE_DEP) $(TARGET_BUNDLED)
326         $(NAILING_CARGO_JUST_RUN) sh -ec '                      \
327                 cd $(abspath $(src)); mkdir -p $(dir $@);       \
328                 ./$< >$@.tmp $(BUNDLED_SOURCES_LINKS);          \
329                 mv -f $@.tmp $@;                                \
330         '
331
332 bundled-sources::
333         @echo Bundled sources.
334
335 #---------- svg processing ----------
336
337 LIBRARIES ?= $(basename $(wildcard library/*.toml))
338 USVG_DEP = stamp/cargo.usvg
339
340 include $(addsuffix /files.make, $(LIBRARIES))
341
342 USVG_PROCESSOR = usvg-processor
343 LIBRARY_PROCESS_SVG = ./$(USVG_PROCESSOR) $@ $(wordlist 1,2,$^) '$(USVG_CMD) $(USVG_OPTIONS)'
344 $(LIBRARY_FILES): $(USVG_PROCESSOR) $(USVG_DEP) $(MAKEFILE_DEP)
345
346 # actual command for each of $(LIBRARY_FILES) is in one of the files.make
347
348 library/%/files.make: media-scraper library/%.toml
349         ./$< --offline library/$*.toml
350
351 #---------- typescript ----------
352
353 templates/%.js: tsc-wrap tsconfig.json
354         ./tsc-wrap $@ tsconfig.json $(filter %.ts,$^)
355
356 templates/script.js: $(TS_SRC_FILES) stamp/wasm-bindgen
357
358 #---------- other templates ----------
359
360 $(addprefix templates/,$(LITFILES)): templates/%: %
361         cp $< $@.new && mv -f $@.new $@
362
363 $(addprefix templates/,$(TXTFILES)): templates/%: %.txt
364         cp $< $@.new && mv -f $@.new $@
365
366 libraries: $(LIBRARY_FILES)
367
368 templates/shapelib.html: $(TARGET_DIR)/debug/otterlib $(LIBRARY_FILES)
369         $(NAILING_CARGO_JUST_RUN) $(abspath $<) \
370         --libs '$(addprefix $(PWD)/, $(addsuffix .toml, $(LIBRARIES)))' \
371                 preview >$@.tmp && mv -f $@.tmp $@
372
373 #---------- examples ----------
374
375 EXAMPLE_BUNDLE_INPUT_DEPS := $(shell                                    \
376         cd examples/test-bundle/ && find \! \( -name '*~' -o -name '.*' \) \
377 )
378
379 examples/%.zip: $(MAKEFILE_DEP)
380         set -e; rm -f $@.tmp; cd examples/$*/; \
381         zip $(ZIPFLAGS) -DX ../$(notdir $@).tmp $(ZIP_INPUTS)
382         mv -f $@.tmp $@
383
384 examples/test-bundle.zip: ZIP_INPUTS=$(EXAMPLE_BUNDLE_INPUT_DEPS)
385 examples/test-bundle.zip: \
386  $(addprefix examples/test-bundle/, $(EXAMPLE_BUNDLE_INPUT_DEPS))
387
388 examples/big-bundle.zip: examples/big-bundle/otter.toml
389 examples/big-bundle.zip: ZIPFLAGS+= -0 -r -q
390 examples/big-bundle.zip: ZIP_INPUTS=.
391 examples/big-bundle/otter.toml: $(LIBRARY_FILES) $(MAKEFILE_DEP)
392         rm -rf examples/big-bundle
393         mkdir examples/big-bundle examples/big-bundle/library
394         @set -e; echo 'MKDIR for $@'; \
395         for l in $(LIBRARIES); do \
396                 mkdir examples/big-bundle/$$l; \
397                 perl -p \
398  -e 'BEGIN { print "# -- AUTOGENERATED FROM COPY IN OTTER SOURCE --\n" }' \
399  -e 'if (m/^\[scraper]/..0) { unless (m/^\[(?!scraper)/..0) { s/^/\#/ } }' \
400  -e 's/(?<=\s)\w\S*(?=\s)/-/ if m/^files = """/..m/^"""/;' \
401                         <$$l.toml >examples/big-bundle/$$l.toml; done
402         @set -e; echo 'LN for $@'; \
403         for e in $(LIBRARY_FILE_INPUTS); do \
404                 ln $${e#*:} examples/big-bundle/$${e%%.usvg:*}.svg; done;
405         @set -e; echo 'MV for $@'; \
406         cd examples/big-bundle/library/; for x in '' .toml; do \
407                 mv wikimedia$$x duped-example$$x; done
408         @set -e; mkdir examples/big-bundle/specs/; \
409         perl -pe <specs/demo.game.toml \
410                 >examples/big-bundle/specs/Modded-spec.game.toml \
411                 's/chess-b-/chess-purple-/; s/chess-w-/chess-yellow-/'
412         @set -e; echo 'ECHO for $@'; \
413         echo 'title = "Autogenerated test bundle - do not distribute"' \
414                 >$@.tmp
415         mv -f $@.tmp $@
416
417 #---------- webdriver tests (wdt) ----------
418
419 AT_TESTS := $(basename $(notdir $(wildcard apitest/at-*.rs)))
420 WDT_TESTS := $(basename $(notdir $(wildcard wdriver/wdt-*.rs)))
421
422 WDT_LANDSCAPE_TESTS = wdt-altergame
423
424 at:     $(foreach f, $(AT_TESTS), stamp/$f.check)
425
426 wdt:    $(foreach f, $(WDT_TESTS), stamp/$f.check) \
427         $(foreach f, $(WDT_LANDSCAPE_TESTS), stamp/$f.lcheck) \
428
429 RUNTEST_DEPS =  apitest/run1 stamp/cargo.debug $(FILEASSETS) \
430                 $(wildcard specs/*.toml) examples/test-bundle.zip \
431                 $(wildcard libraries/*.toml) $(LIBRARY_FILES)
432
433 AT_DEPS =       $(filter-out templates/script.js, $(RUNTEST_DEPS)) \
434                 examples/big-bundle.zip \
435                 stamp/cargo-at.debug
436
437 WDT_DEPS =      $(RUNTEST_DEPS) wdriver/firefox-wrapper \
438                 stamp/cargo-wdt.debug
439
440 AT_WDT_RUN = $(NAILING_CARGO_JUST_RUN) $(abspath $<)
441
442 AT_RUN = $(AT_WDT_RUN) apitest --test=$(basename $(notdir $@))
443 WDT_RUN = $(AT_WDT_RUN) wdriver --test=$(basename $(notdir $@))
444
445 for-at:                 $(AT_DEPS)
446 stamp/at-%.check:       $(AT_DEPS)
447         $(AT_RUN)
448         $(stamp)
449
450 for-wdt:                $(WDT_DEPS)
451 stamp/wdt-%.check:      $(WDT_DEPS)
452         $(WDT_RUN)
453         $(stamp)
454
455 stamp/wdt-%.lcheck:     $(WDT_DEPS)
456         $(WDT_RUN) --as-if=lwdt-$* --layout=Landscape
457         $(stamp)
458
459 #---------- docs publication ----------
460
461 PUBLISH_USER=ianmdlvl@login.chiark.greenend.org.uk
462 PUBLISH_DOC_SPHINX=$(PUBLISH_USER):public-html/otter/docs
463
464 publish: doc-sphinx
465         rsync -r --delete-delay docs/html/. $(PUBLISH_DOC_SPHINX)/.
466         git branch -f $(PUBLISHED_BRANCH)
467
468 #---------- deployment ----------
469
470 DEPLOY_USER=ian@login.chiark.greenend.org.uk
471 DEPLOY_BASE=$(DEPLOY_USER):/volatile/Otter
472 DEPLOY_FINISH=/home/Otter/etc/deploy-finish
473
474 for-deploy: stamp/cargo.deploy-build
475 deploy: for-deploy bundled-sources assets libraries
476         rsync -zvl --progress $(addprefix $(DEPLOY_TARGET_DIR)/,$(PROGRAMS) otter-ssh-proxy) $(DEPLOY_BASE)/bin/
477         rsync -zv --progress $(TARGET_DIR)/release/usvg $(DEPLOY_BASE)/libexec/
478         rsync -rv --progress $(TARGET_DIR)/bundled-sources/. $(DEPLOY_BASE)/bundled-sources
479         rsync -r README.md $(DEPLOY_BASE)/.
480         rsync -r --delete --exclude=\*~ library specs $(DEPLOY_BASE)/.
481         rsync -r $(FILEASSETS) $(addprefix $(WASM_PACKED)/, $(WASM_ASSETS)) \
482                 $(DEPLOY_BASE)/assets/
483         rsync -r nwtemplates/*.tera $(DEPLOY_BASE)/nwtemplates/
484         ssh -o BatchMode=true $(DEPLOY_USER) $(DEPLOY_FINISH)
485         git branch -f $(DEPLOYED_BRANCH)
486         -git push origin main
487         -git push chiark main
488
489 #$(DEPLOY_BASE)/bundled-sources
490
491 #---------- clean ----------
492
493 clean-for-retest:
494         rm -f templates/script.js library/*/*.usvg stamp/*
495         rm -rf $(LIBRARY_CLEAN)
496         rm -rf examples/big-bundle examples/big-bundle.zip
497         rm -f examples/test-bundle.zip
498         find * \( -name '*~' -o -name '*.tmp' \) -print0 | xargs -0r rm --
499
500 clean: clean-nailing clean-for-retest
501         rm -rf target
502         $(NAILING_CARGO_JUST_RUN) rm -rf target