Browse Source

build: use $(RM) in Makefile for consistency

Also allows someone to reassign `$RM`, e.g. with `RM=rm -v` instead of
`rm -f` (the default) should they want to. We're currently using a
mixture of `$(RM)` and `rm -f`.

There are a couple of places which aren't doing -f, have them do it for
consistency.

Backport-PR-URL: https://github.com/nodejs/node/pull/12515
PR-URL: https://github.com/nodejs/node/pull/12157
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
v6.x
Gibson Fahnestock 8 years ago
committed by Myles Borins
parent
commit
e7e83f6f10
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 76
      Makefile

76
Makefile

@ -90,24 +90,24 @@ uninstall:
$(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)' $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'
clean: clean:
-rm -rf out/Makefile $(NODE_EXE) $(NODE_G_EXE) out/$(BUILDTYPE)/$(NODE_EXE) \ $(RM) -r out/Makefile $(NODE_EXE) $(NODE_G_EXE) out/$(BUILDTYPE)/$(NODE_EXE) \
out/$(BUILDTYPE)/node.exp out/$(BUILDTYPE)/node.exp
@if [ -d out ]; then find out/ -name '*.o' -o -name '*.a' -o -name '*.d' | xargs rm -rf; fi @if [ -d out ]; then find out/ -name '*.o' -o -name '*.a' -o -name '*.d' | xargs $(RM) -r; fi
-rm -rf node_modules $(RM) -r node_modules
@if [ -d deps/icu ]; then echo deleting deps/icu; rm -rf deps/icu; fi @if [ -d deps/icu ]; then echo deleting deps/icu; $(RM) -r deps/icu; fi
-rm -f test.tap $(RM) test.tap
distclean: distclean:
-rm -rf out $(RM) -r out
-rm -f config.gypi icu_config.gypi config_fips.gypi $(RM) config.gypi icu_config.gypi config_fips.gypi
-rm -f config.mk $(RM) config.mk
-rm -rf $(NODE_EXE) $(NODE_G_EXE) $(RM) -r $(NODE_EXE) $(NODE_G_EXE)
-rm -rf node_modules $(RM) -r node_modules
-rm -rf deps/icu $(RM) -r deps/icu
-rm -rf deps/icu4c*.tgz deps/icu4c*.zip deps/icu-tmp $(RM) -r deps/icu4c*.tgz deps/icu4c*.zip deps/icu-tmp
-rm -f $(BINARYTAR).* $(TARBALL).* $(RM) $(BINARYTAR).* $(TARBALL).*
-rm -rf deps/v8/testing/gmock $(RM) -r deps/v8/testing/gmock
-rm -rf deps/v8/testing/gtest $(RM) -r deps/v8/testing/gtest
check: test check: test
@ -367,7 +367,7 @@ docopen: $(apidocs_html)
@$(PYTHON) -mwebbrowser file://$(PWD)/out/doc/api/all.html @$(PYTHON) -mwebbrowser file://$(PWD)/out/doc/api/all.html
docclean: docclean:
-rm -rf out/doc $(RM) -r out/doc
build-ci: build-ci:
$(PYTHON) ./configure $(CONFIG_FLAGS) $(PYTHON) ./configure $(CONFIG_FLAGS)
@ -542,8 +542,8 @@ release-only:
fi fi
$(PKG): release-only $(PKG): release-only
rm -rf $(PKGDIR) $(RM) -r $(PKGDIR)
rm -rf out/deps out/Release $(RM) -r out/deps out/Release
$(PYTHON) ./configure \ $(PYTHON) ./configure \
--dest-cpu=x64 \ --dest-cpu=x64 \
--tag=$(TAG) \ --tag=$(TAG) \
@ -574,24 +574,24 @@ $(TARBALL): release-only $(NODE_EXE) doc
mkdir -p $(TARNAME)/doc/api mkdir -p $(TARNAME)/doc/api
cp doc/node.1 $(TARNAME)/doc/node.1 cp doc/node.1 $(TARNAME)/doc/node.1
cp -r out/doc/api/* $(TARNAME)/doc/api/ cp -r out/doc/api/* $(TARNAME)/doc/api/
rm -rf $(TARNAME)/deps/v8/{test,samples,tools/profviz,tools/run-tests.py} $(RM) -r $(TARNAME)/deps/v8/{test,samples,tools/profviz,tools/run-tests.py}
rm -rf $(TARNAME)/doc/images # too big $(RM) -r $(TARNAME)/doc/images # too big
rm -rf $(TARNAME)/deps/uv/{docs,samples,test} $(RM) -r $(TARNAME)/deps/uv/{docs,samples,test}
rm -rf $(TARNAME)/deps/openssl/openssl/{doc,demos,test} $(RM) -r $(TARNAME)/deps/openssl/openssl/{doc,demos,test}
rm -rf $(TARNAME)/deps/zlib/contrib # too big, unused $(RM) -r $(TARNAME)/deps/zlib/contrib # too big, unused
rm -rf $(TARNAME)/.{editorconfig,git*,mailmap} $(RM) -r $(TARNAME)/.{editorconfig,git*,mailmap}
rm -rf $(TARNAME)/tools/{eslint,eslint-rules,osx-pkg.pmdoc,pkgsrc} $(RM) -r $(TARNAME)/tools/{eslint,eslint-rules,osx-pkg.pmdoc,pkgsrc}
rm -rf $(TARNAME)/tools/{osx-*,license-builder.sh,cpplint.py} $(RM) -r $(TARNAME)/tools/{osx-*,license-builder.sh,cpplint.py}
rm -rf $(TARNAME)/test*.tap $(RM) -r $(TARNAME)/test*.tap
find $(TARNAME)/ -name ".eslint*" -maxdepth 2 | xargs rm find $(TARNAME)/ -name ".eslint*" -maxdepth 2 | xargs $(RM)
find $(TARNAME)/ -type l | xargs rm # annoying on windows find $(TARNAME)/ -type l | xargs $(RM) # annoying on windows
tar -cf $(TARNAME).tar $(TARNAME) tar -cf $(TARNAME).tar $(TARNAME)
rm -rf $(TARNAME) $(RM) -r $(TARNAME)
gzip -c -f -9 $(TARNAME).tar > $(TARNAME).tar.gz gzip -c -f -9 $(TARNAME).tar > $(TARNAME).tar.gz
ifeq ($(XZ), 0) ifeq ($(XZ), 0)
xz -c -f -$(XZ_COMPRESSION) $(TARNAME).tar > $(TARNAME).tar.xz xz -c -f -$(XZ_COMPRESSION) $(TARNAME).tar > $(TARNAME).tar.xz
endif endif
rm $(TARNAME).tar $(RM) $(TARNAME).tar
tar: $(TARBALL) tar: $(TARBALL)
@ -620,14 +620,14 @@ $(TARBALL)-headers: release-only
--release-urlbase=$(RELEASE_URLBASE) \ --release-urlbase=$(RELEASE_URLBASE) \
$(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS) $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
HEADERS_ONLY=1 $(PYTHON) tools/install.py install '$(TARNAME)' '/' HEADERS_ONLY=1 $(PYTHON) tools/install.py install '$(TARNAME)' '/'
find $(TARNAME)/ -type l | xargs rm -f find $(TARNAME)/ -type l | xargs $(RM)
tar -cf $(TARNAME)-headers.tar $(TARNAME) tar -cf $(TARNAME)-headers.tar $(TARNAME)
rm -rf $(TARNAME) $(RM) -r $(TARNAME)
gzip -c -f -9 $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.gz gzip -c -f -9 $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.gz
ifeq ($(XZ), 0) ifeq ($(XZ), 0)
xz -c -f -$(XZ_COMPRESSION) $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.xz xz -c -f -$(XZ_COMPRESSION) $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.xz
endif endif
rm $(TARNAME)-headers.tar $(RM) $(TARNAME)-headers.tar
tar-headers: $(TARBALL)-headers tar-headers: $(TARBALL)-headers
@ -643,8 +643,8 @@ ifeq ($(XZ), 0)
endif endif
$(BINARYTAR): release-only $(BINARYTAR): release-only
rm -rf $(BINARYNAME) $(RM) -r $(BINARYNAME)
rm -rf out/deps out/Release $(RM) -r out/deps out/Release
$(PYTHON) ./configure \ $(PYTHON) ./configure \
--prefix=/ \ --prefix=/ \
--dest-cpu=$(DESTCPU) \ --dest-cpu=$(DESTCPU) \
@ -656,12 +656,12 @@ $(BINARYTAR): release-only
cp LICENSE $(BINARYNAME) cp LICENSE $(BINARYNAME)
cp CHANGELOG.md $(BINARYNAME) cp CHANGELOG.md $(BINARYNAME)
tar -cf $(BINARYNAME).tar $(BINARYNAME) tar -cf $(BINARYNAME).tar $(BINARYNAME)
rm -rf $(BINARYNAME) $(RM) -r $(BINARYNAME)
gzip -c -f -9 $(BINARYNAME).tar > $(BINARYNAME).tar.gz gzip -c -f -9 $(BINARYNAME).tar > $(BINARYNAME).tar.gz
ifeq ($(XZ), 0) ifeq ($(XZ), 0)
xz -c -f -$(XZ_COMPRESSION) $(BINARYNAME).tar > $(BINARYNAME).tar.xz xz -c -f -$(XZ_COMPRESSION) $(BINARYNAME).tar > $(BINARYNAME).tar.xz
endif endif
rm $(BINARYNAME).tar $(RM) $(BINARYNAME).tar
binary: $(BINARYTAR) binary: $(BINARYTAR)

Loading…
Cancel
Save