Skip to content

Commit

Permalink
Add environment variable to disable the preparation step
Browse files Browse the repository at this point in the history
It's SteamOS-specific and silently changes the system configuration.
It should not be done for distro packaging (e.g., Nix, pacman).
  • Loading branch information
zhaofengli committed Aug 21, 2022
1 parent 66e1ebd commit 32ca22e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ $(shell echo "Makefile targets: $(MAKECMDGOALS)" $(DUMMYSHELLSILENT))

# Prepare

ifndef NOPREPARE

TEMPFILESNEC := $(or $(if $(MAKECMDGOALS),,x),$(findstring release,$(MAKECMDGOALS)),$(findstring debug,$(MAKECMDGOALS))\
,$(findstring install,$(MAKECMDGOALS)),$(findstring createpkg,$(MAKECMDGOALS)),$(findstring preparepkg,$(MAKECMDGOALS))\
Expand Down Expand Up @@ -270,6 +271,12 @@ $(DEPENDCHECKFILES) &:: $(RUNDEPS)
sudo pacman-key --init &>/dev/null
sudo pacman-key --populate &>/dev/null

else # ifndef NOPREPARE

prepare: ;

endif # ifndef NOPREPARE

# See second expansion at the bottom

# Build
Expand Down Expand Up @@ -381,6 +388,8 @@ $(OBJDIR) $(BINDIR) $(PKGDIR) $(PKGBINDIR):

# Prepare

ifndef NOPREPARE

.IGNORE: $(DEPENDCHECKFILES)

# Reinstall. Normal multiple target. Each dependency check file is
Expand All @@ -390,6 +399,7 @@ $(DEPENDCHECKFILES) :: $(RUNDEPS) | $$(call removefrom,$$(call getpos,$$@,$(DEPE
@echo -e "Missing $@. Reinstalling \e[1m$(call getmatch,$@,$(DEPENDCHECKFILES),$(DEPENDENCIES))\e[0m..."
sudo pacman -S --noconfirm $(call getmatch,$@,$(DEPENDCHECKFILES),$(DEPENDENCIES)) &>/dev/null

endif # ifndef NOPREPARE

# Build

Expand Down

0 comments on commit 32ca22e

Please sign in to comment.