diff --git a/Makefile b/Makefile index b3b78803..2a22ff2e 100644 --- a/Makefile +++ b/Makefile @@ -28,26 +28,34 @@ rebuild: rm -rf $(BUILD)/repo.tag $(BUILD)/harddrive.img $(BUILD)/redox-live.iso $(MAKE) all -clean: $(CONTAINER_TAG) +clean: ifeq ($(PODMAN_BUILD),1) +ifneq ("$(wildcard $(CONTAINER_TAG))","") $(PODMAN_RUN) make $@ +else + $(info will not run cookbook clean as container is not built) +endif else $(MAKE) c.--all - -rm -rf cookbook/repo - $(MAKE) fstools_clean - $(HOST_CARGO) clean --manifest-path relibc/Cargo.toml -endif -$(FUMOUNT) $(BUILD)/filesystem/ || true -$(FUMOUNT) /tmp/redox_installer/ || true +endif + rm -rf cookbook/repo + rm -rf relibc/target rm -rf $(BUILD) $(PREFIX) + $(MAKE) fstools_clean -distclean: $(CONTAINER_TAG) +distclean: ifeq ($(PODMAN_BUILD),1) +ifneq ("$(wildcard $(CONTAINER_TAG))","") $(PODMAN_RUN) make $@ else - $(MAKE) u.--all - $(MAKE) clean + $(info will not run cookbook unfetch as container is not built) endif +else + $(MAKE) u.--all +endif + $(MAKE) clean pull: git pull diff --git a/mk/fstools.mk b/mk/fstools.mk index d983c811..b7c231fc 100644 --- a/mk/fstools.mk +++ b/mk/fstools.mk @@ -25,14 +25,10 @@ else touch $@ endif -fstools_clean: FORCE $(CONTAINER_TAG) -ifeq ($(PODMAN_BUILD),1) - $(PODMAN_RUN) make $@ -else - $(HOST_CARGO) clean --manifest-path cookbook/Cargo.toml - $(HOST_CARGO) clean --manifest-path cookbook/pkgar/Cargo.toml - $(HOST_CARGO) clean --manifest-path installer/Cargo.toml - $(HOST_CARGO) clean --manifest-path redoxfs/Cargo.toml +fstools_clean: FORCE + rm -rf cookbook/target + rm -rf cookbook/pkgar/target + rm -rf installer/target + rm -rf redoxfs/target rm -rf $(FSTOOLS) rm -f $(FSTOOLS_TAG) -endif