From b0def630e3489f0e2a78dd27a1c0bb4b77663c6e Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Tue, 7 Nov 2023 15:01:31 -0700 Subject: added a Makefile, so either `make` or `./make` can be used for most tasks `make` doesn't always work, like when the user tries to do certain types of CLI args, but it's handy to have as a convenience sometimes. What works: - make - make clean - make hank boost - make me a sandwich What doesn't work: - make foo --bar - make foo BAR=1 The `make` program eats some types of arguments. --- Makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2f3aaed --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +# Tiny Makefile to simply "exec ./make $*" +# Copyright (C) 2023 Selene ToyKeeper +# SPDX-License-Identifier: GPL-3.0-or-later + +# Note: Does not pass args in the form "-a", "--arg", or "VAR=value" +# because 'make' does not put those into $MAKECMDGOALS +# but this is still helpful in case the user forgets the './' before 'make' + +# for 'make foo bar baz', don't run 3 times +# (generate no-op rules for args 2+) +ARGS := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS)) +$(eval $(ARGS):;@:) + +# handle the case with no args +all: + @./make + +# catch everything else and parse the command line ourselves +.PHONY: % +%: + @./make $(MAKECMDGOALS) + +# handle targets with the same name as a dir, +# because 'make' skips those otherwise +.PHONY: docs +docs: + @./make docs + -- cgit v1.2.3