Merge branch 'master' into 'master'

Add make recipe commands for multiple targets, speedup category.sh for podman build.

See merge request redox-os/redox!1590
This commit is contained in:
Jeremy Soller 2025-06-25 08:46:04 -06:00
commit 3c9bffa547
2 changed files with 83 additions and 4 deletions

View File

@ -51,6 +51,16 @@ else
./clean.sh $* ./clean.sh $*
endif endif
comma := ,
# Invoke clean.sh for multiple targets
cl.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
$(MAKE) $(foreach target,$(subst $(comma), ,$*),c.$(target))
endif
# Invoke fetch.sh for a single target # Invoke fetch.sh for a single target
f.%: $(FSTOOLS_TAG) FORCE f.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1) ifeq ($(PODMAN_BUILD),1)
@ -62,6 +72,14 @@ else
./fetch.sh $* ./fetch.sh $*
endif endif
# Invoke fetch.sh for multiple targets
fl.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
$(MAKE) $(foreach target,$(subst $(comma), ,$*),f.$(target))
endif
# Invoke repo.sh for a single target # Invoke repo.sh for a single target
r.%: $(FSTOOLS_TAG) FORCE r.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1) ifeq ($(PODMAN_BUILD),1)
@ -73,6 +91,14 @@ else
./repo.sh $* ./repo.sh $*
endif endif
# Invoke repo.sh for multiple targets
rl.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
$(MAKE) $(foreach target,$(subst $(comma), ,$*),r.$(target))
endif
# Invoke unfetch.sh for a single target # Invoke unfetch.sh for a single target
u.%: $(FSTOOLS_TAG) FORCE u.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1) ifeq ($(PODMAN_BUILD),1)
@ -84,20 +110,64 @@ else
./unfetch.sh $* ./unfetch.sh $*
endif endif
# Invoke unfetch.sh for multiple targets
ul.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
$(MAKE) $(foreach target,$(subst $(comma), ,$*),u.$(target))
endif
# Invoke clean.sh, and repo.sh for a single target # Invoke clean.sh, and repo.sh for a single target
cr.%: $(FSTOOLS_TAG) FORCE cr.%: $(FSTOOLS_TAG) FORCE
$(MAKE) c.$* $(MAKE) c.$*
$(MAKE) r.$* $(MAKE) r.$*
# Invoke clean.sh and repo.sh for multiple targets
crl.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
$(MAKE) $(foreach target,$(subst $(comma), ,$*),c.$(target))
$(MAKE) $(foreach target,$(subst $(comma), ,$*),r.$(target))
endif
# Invoke unfetch.sh, clean.sh, and repo.sh for a single target # Invoke unfetch.sh, clean.sh, and repo.sh for a single target
ucr.%: $(FSTOOLS_TAG) FORCE ucr.%: $(FSTOOLS_TAG) FORCE
$(MAKE) u.$* $(MAKE) u.$*
$(MAKE) cr.$* $(MAKE) cr.$*
# Invoke unfetch.sh, clean.sh and repo.sh for multiple targets
ucrl.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
$(MAKE) $(foreach target,$(subst $(comma), ,$*),u.$(target))
$(MAKE) $(foreach target,$(subst $(comma), ,$*),cr.$(target))
endif
uc.%: $(FSTOOLS_TAG) FORCE uc.%: $(FSTOOLS_TAG) FORCE
$(MAKE) u.$* $(MAKE) u.$*
$(MAKE) c.$* $(MAKE) c.$*
# Invoke unfetch.sh and clean.sh for multiple targets
ucl.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
$(MAKE) $(foreach target,$(subst $(comma), ,$*),u.$(target))
$(MAKE) $(foreach target,$(subst $(comma), ,$*),c.$(target))
endif
ucf.%: $(FSTOOLS_TAG) FORCE ucf.%: $(FSTOOLS_TAG) FORCE
$(MAKE) uc.$* $(MAKE) uc.$*
$(MAKE) f.$* $(MAKE) f.$*
# Invoke unfetch, clean.sh and fetch.sh for multiple targets
ucfl.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
$(MAKE) $(foreach target,$(subst $(comma), ,$*),uc.$(target))
$(MAKE) $(foreach target,$(subst $(comma), ,$*),f.$(target))
endif

View File

@ -10,13 +10,22 @@ then
exit 1 exit 1
fi fi
set -x
action="${1#-}" action="${1#-}"
recipe_list=""
first=1
for recipe in `find cookbook/recipes/"$2" -name "recipe.*"` for recipe in `find cookbook/recipes/"$2" -name "recipe.*"`
do do
recipe_folder=`dirname "$recipe"` recipe_folder=`dirname "$recipe"`
recipe_name=`basename "$recipe_folder"` recipe_name=`basename "$recipe_folder"`
make "$action"."$recipe_name" if [ "$first" -eq 1 ]; then
done recipe_list="$recipe_name"
first=0
else
recipe_list="$recipe_list,$recipe_name"
fi
done
set -x
make "$action"l."$recipe_list"