Skip to content

Commit

Permalink
Split system dependent commands to clean modular-gc
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Dec 10, 2024
1 parent ce2f398 commit f12e262
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
10 changes: 4 additions & 6 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1953,12 +1953,10 @@ modular-gc: probes.h modular-gc-precheck
$(CHDIR) gc/$(MODULAR_GC) && $(exec) $(MAKE) TARGET_SO_DIR=./
$(CP) gc/$(MODULAR_GC)/librubygc.$(MODULAR_GC).$(DLEXT) $(modular_gc_dir)

clean-modular-gc:
- find gc -type d -mindepth 1 -maxdepth 1 -exec sh -c '$(CHDIR) "{}" && $(MAKE) TARGET_SO_DIR=./ clean || $(NULLCMD)' \; || $(NULLCMD)
-$(Q) $(RMDIR) gc
distclean-modular-gc: clean-modular-gc
- find gc -type d -mindepth 1 -maxdepth 1 -exec sh -c '$(CHDIR) "{}" && $(MAKE) TARGET_SO_DIR=./ distclean || $(NULLCMD)' \; || $(NULLCMD)
- find gc -type d -mindepth 1 -maxdepth 1 -exec sh -c '$(RMDIR) "{}"' \; || $(NULLCMD)
clean-modular-gc: gc/clean
distclean-modular-gc: gc/distclean
realclean-modular-gc: gc/realclean
distclean-modular-gc realclean-modular-gc:
-$(Q) $(RMDIR) gc

help: PHONY
Expand Down
6 changes: 6 additions & 0 deletions template/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,12 @@ ext/distclean ext/realclean .bundle/distclean .bundle/realclean::
.bundle/realclean::
@$(RMALL) $(tooldir)/bunlder/*.lock $(srcdir)/.bundle

gc/clean gc/distclean gc/realclean::
- for gc in gc/*/; do ($(CHDIR) $$gc && exec $(MAKE) TARGET_SO_DIR=./ $(@F)); done || $(NULLCMD)

gc/distclean gc/realclean::
- for gc in gc/*/; do $(RMDIR) $$gc; done || $(NULLCMD)

clean-enc distclean-enc realclean-enc:
@test -f "$(ENC_MK)" || exit 0; \
echo $(@:-enc=ing) encodings; \
Expand Down
5 changes: 5 additions & 0 deletions win32/Makefile.sub
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,11 @@ ext/distclean gems/distclean ext/realclean gems/realclean::
do $(Q)(del %I & rmdir %~dpI)) || @
-$(Q)rmdir $(@D) 2> nul || @

gc/clean gc/distclean gc/realclean::
- for /D %G in (gc\*) do (pushd %G && $(MAKE) TARGET_SO_DIR=./ $(@F) & popd) || $(NULLCMD)
gc/distclean gc/realclean::
- for /D %G in (gc\*) do ($(RMDIR) %G) || $(NULLCMD)

clean-enc distclean-enc realclean-enc:
!if exist($(ENC_MK))
$(ECHO) $(@:-enc=ing) encodings
Expand Down

0 comments on commit f12e262

Please sign in to comment.