commit 424c91d2f8cc15cc9940d1e83952dd8b41862be6
parent 9bf8c9b60f1d43677b02448f8d0657721ecd1cb2
Author: pyratebeard <root@pyratebeard.net>
Date: Thu, 17 Nov 2022 22:04:49 +0000
don't need separate ARG var names
Diffstat:
M | Makefile | | | 30 | +++++++++++++++--------------- |
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/Makefile b/Makefile
@@ -4,29 +4,29 @@ RND := ""
# If the first argument is "draft"
ifeq (draft,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "draft"
- DRAFT_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
+ ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
- $(eval $(DRAFT_ARGS):;@:)
+ $(eval $(ARGS):;@:)
else
ifeq (preview,$(firstword $(MAKECMDGOALS)))
- VIEW_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
- $(eval $(VIEW_ARGS):;@:)
+ ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
+ $(eval $(ARGS):;@:)
else
ifeq (publish,$(firstword $(MAKECMDGOALS)))
- PUB_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
- $(eval $(PUB_ARGS):;@:)
+ ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
+ $(eval $(ARGS):;@:)
endif
endif
endif
-ifeq ($(DRAFT_ARGS), )
- DRAFT_ARGS := $(shell git branch --show-current)
+ifeq ($(ARGS), )
+ ARGS := $(shell git branch --show-current)
endif
-ifeq ($(VIEW_ARGS), )
- VIEW_ARGS := $(shell git branch --show-current)
+ifeq ($(ARGS), )
+ ARGS := $(shell git branch --show-current)
endif
-ifeq ($(PUB_ARGS), )
- PUB_ARGS := $(shell git branch --show-current)
+ifeq ($(ARGS), )
+ ARGS := $(shell git branch --show-current)
endif
prog: # ...
@@ -35,10 +35,10 @@ prog: # ...
.PHONY: draft preview publish
draft : prog
- scripts/draft $(DRAFT_ARGS) $(RND)
+ scripts/draft $(ARGS) $(RND)
preview : prog
- scripts/preview $(VIEW_ARGS)
+ scripts/preview $(ARGS)
publish : prog
- scripts/publish $(PUB_ARGS)
+ scripts/publish $(ARGS) $(RND)