Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow 'make clobber' to run #4235

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions _cxx/envoy.mk
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ $(OSS_HOME)/_cxx/envoy: FORCE
git checkout origin/master; \
fi; \
}
$(OSS_HOME)/_cxx/envoy.clean: %.clean:
$(if $(filter-out -,$(ENVOY_COMMIT)),rm -rf $*)
$(OSS_HOME)/_cxx/envoy.clean:
$(if $(filter-out -,$(ENVOY_COMMIT)),rm -rf $@)
Comment on lines +118 to +119
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$@ doesn't work. You'd need to use $(patsubst %.clean,%,$@).

.PHONY: $(OSS_HOME)/_cxx/envoy.clean
clobber: $(OSS_HOME)/_cxx/envoy.clean

Expand All @@ -128,8 +128,8 @@ $(OSS_HOME)/_cxx/envoy-build-image.txt: $(OSS_HOME)/_cxx/envoy $(tools/write-ifc
popd; \
echo docker.io/envoyproxy/envoy-build-ubuntu:$$ENVOY_BUILD_SHA | $(tools/write-ifchanged) $@; \
}
$(OSS_HOME)/_cxx/envoy-build-image.txt.clean: %.clean:
rm -f $*
$(OSS_HOME)/_cxx/envoy-build-image.txt.clean:
rm -f $@
.PHONY: $(OSS_HOME)/_cxx/envoy-build-image.txt.clean
clean: $(OSS_HOME)/_cxx/envoy-build-image.txt.clean

Expand All @@ -143,10 +143,14 @@ $(OSS_HOME)/_cxx/envoy-build-container.txt: $(OSS_HOME)/_cxx/envoy-build-image.t
fi; \
docker run --detach --rm --privileged --volume=envoy-build:/root:rw $$(cat $<) tail -f /dev/null > $@; \
}
$(OSS_HOME)/_cxx/envoy-build-container.txt.clean: %.clean:
if [ -e $* ]; then docker kill $$(cat $*) || true; fi
rm -f $*
if docker volume inspect envoy-build &>/dev/null; then docker volume rm envoy-build >/dev/null; fi
$(OSS_HOME)/_cxx/envoy-build-container.txt.clean:
if [ -e $@ ]; then docker kill $$(cat $@) || true; fi
rm -f $@
if docker volume inspect envoy-build &>/dev/null; then \
if ! docker volume rm envoy-build >/dev/null; then \
echo "Cannot remove Docker volume envoy-build, continuing" ;\
fi ;\
fi
.PHONY: $(OSS_HOME)/_cxx/envoy-build-container.txt.clean
clean: $(OSS_HOME)/_cxx/envoy-build-container.txt.clean

Expand Down Expand Up @@ -203,8 +207,8 @@ $(OSS_HOME)/docker/base-envoy/envoy-static-stripped: %-stripped: % FORCE
rsync -a$(RSYNC_EXTRAS) --partial --blocking-io -e 'docker exec -i' $$(cat $(OSS_HOME)/_cxx/envoy-build-container.txt):/tmp/$(@F) $@; \
fi; \
}
$(OSS_HOME)/docker/base-envoy/envoy-static.clean $(OSS_HOME)/docker/base-envoy/envoy-static-stripped.clean: %.clean
Copy link
Contributor

@LukeShu LukeShu May 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only line that's a problem; by typo it's missing the : at the end of the line.

All of the other changes should be dropped from the PR.

rm -f $*
$(OSS_HOME)/docker/base-envoy/envoy-static.clean $(OSS_HOME)/docker/base-envoy/envoy-static-stripped.clean:
rm -f $@
.PHONY: $(OSS_HOME)/docker/base-envoy/envoy-static.clean $(OSS_HOME)/docker/base-envoy/envoy-static-stripped.clean
clobber: $(OSS_HOME)/docker/base-envoy/envoy-static.clean $(OSS_HOME)/docker/base-envoy/envoy-static-stripped.clean

Expand Down