Skip to content

Commit

Permalink
Rename variable to avoid shadowing env var from pwnmake script
Browse files Browse the repository at this point in the history
  • Loading branch information
C0deH4cker committed Nov 6, 2024
1 parent ef8507c commit 31b04b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Versions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# *_RELEASED.

# Update any time the PwnableHarness makefiles are changed
PWNMAKE_VERSION := v2.2
PWNMAKE_RELEASED := v2.1
PHMAKE_VERSION := v2.2
PHMAKE_RELEASED := v2.1

# This only needs to update when there's a change that would affect the base
# images. Changes that only affect PwnableHarness as a build system don't need
Expand Down
22 changes: 11 additions & 11 deletions pwnmake/pwnmake.mk
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Attempt to prevent accidentally updating a published version
ifeq "$(PWNMAKE_VERSION)" "$(PWNMAKE_RELEASED)"
ifeq "$(PHMAKE_VERSION)" "$(PHMAKE_RELEASED)"

.PHONY: pwnmake-build
pwnmake-build:
@echo "Not building pwnmake, as version $(PWNMAKE_VERSION) is already released!"
@echo "Not building pwnmake, as version $(PHMAKE_VERSION) is already released!"
$(_v)false

.PHONY: pwnmake-push
pwnmake-push:
@echo "Not pushing pwnmake, as version $(PWNMAKE_VERSION) is already released!"
@echo "Not pushing pwnmake, as version $(PHMAKE_VERSION) is already released!"
$(_v)false

.PHONY: pwnmake-push-latest
pwnmake-push-latest: pwnmake-push

else #PWNMAKE_VERSION != PWNMAKE_RELEASED
else #PHMAKE_VERSION != PHMAKE_RELEASED

# Files used when building the pwnmake container
PWNMAKE_DEPS := \
Expand All @@ -33,26 +33,26 @@ $(call add_phony_target,pwnmake-build)
pwnmake-build: $(BUILD)/.pwnmake_image_build_marker

$(BUILD)/.pwnmake_image_build_marker: $(PWNMAKE_DEPS)
$(_V)echo "Building Docker image 'pwnmake-$(PWNMAKE_VERSION)'"
$(_V)echo "Building Docker image 'pwnmake-$(PHMAKE_VERSION)'"
$(_v)$(DOCKER) build \
-f $(PWNMAKE_DIR)/pwnmake.Dockerfile \
--build-arg DIR=$(PWNMAKE_DIR) \
--build-arg BUILD_DIR=$(BUILD) \
--build-arg GIT_HASH=$$(git rev-parse HEAD) \
-t $(PWNABLEHARNESS_REPO):pwnmake-$(PWNMAKE_VERSION) . \
-t $(PWNABLEHARNESS_REPO):pwnmake-$(PHMAKE_VERSION) . \
&& mkdir -p $(@D) && touch $@

pwnmake-tag[$(PWNMAKE_VERSION)]: pwnmake-build
pwnmake-tag[$(PHMAKE_VERSION)]: pwnmake-build

$(call add_phony_target,pwnmake-tag[version])
pwnmake-tag[%]: pwnmake-build
$(_V)echo "Tagging Docker image with tag 'pwnmake-$(PWNMAKE_VERSION)' as 'pwnmake-$*'"
$(_V)echo "Tagging Docker image with tag 'pwnmake-$(PHMAKE_VERSION)' as 'pwnmake-$*'"
$(_v)$(DOCKER) tag \
$(PWNABLEHARNESS_REPO):pwnmake-$(PWNMAKE_VERSION) \
$(PWNABLEHARNESS_REPO):pwnmake-$(PHMAKE_VERSION) \
$(PWNABLEHARNESS_REPO):pwnmake-$*

$(call add_phony_target,pwnmake-push)
pwnmake-push: pwnmake-push[$(PWNMAKE_VERSION)]
pwnmake-push: pwnmake-push[$(PHMAKE_VERSION)]
pwnmake-push: pwnmake-push[dev]

$(call add_phony_target,pwnmake-push-latest)
Expand All @@ -64,4 +64,4 @@ pwnmake-push[%]: pwnmake-tag[%]
$(_V)echo "Pushing Docker image with tag 'pwnmake-$*'"
$(_v)$(DOCKER) push $(PWNABLEHARNESS_REPO):pwnmake-$*

endif #PWNMAKE_VERSION != PWNMAKE_RELEASED
endif #PHMAKE_VERSION != PHMAKE_RELEASED

0 comments on commit 31b04b3

Please sign in to comment.