From efbd64504dd9fdbb840ba33a19cb294f3887f5df Mon Sep 17 00:00:00 2001 From: Nick Borgers <73143201+NickBorgersOnLowSecurityNode@users.noreply.github.com> Date: Sat, 22 Apr 2023 16:36:40 -0400 Subject: [PATCH] add help command to Makefile (#307) * add fanciness to Makefile --- v2/Makefile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/v2/Makefile b/v2/Makefile index 6080944..0e24e90 100644 --- a/v2/Makefile +++ b/v2/Makefile @@ -1,3 +1,5 @@ +.DEFAULT_GOAL := help + VERSION=$(shell bin/linuxamd64/glauth --version) GIT_COMMIT=$(shell git rev-list -1 HEAD ) @@ -23,28 +25,32 @@ MAIN_TARGETS=linux/amd64,linux/386,linux/arm64,linux/arm-7,darwin/amd64,darwin/a PLUGIN_TARGETS=linux/amd64,linux/386,linux/arm64,linux/arm-7,darwin/amd64,darwin/arm64 # Plugins -include pkg/plugins/*/Makefile +-include pkg/plugins/*/Makefile ##################### # High level commands ##################### -# Build and run - used for development +#help: @ List available tasks on this project +help: + @grep -E '[a-zA-Z\.\-]+:.*?@ .*$$' $(MAKEFILE_LIST)| tr -d '#' | sed -E 's/Makefile.//' | awk 'BEGIN {FS = ":.*?@ "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +#run: @ build and run - used for development run: setup devrun -# Run the integration test on linuxamd64 (eventually allow the binary to be set) +#test: @ runs the integration test on linuxamd64 (eventually allow the binary to be set) test: runtest -# Run build process for all binaries +#all: @ run build process for all binaries all: setup binaries verify -# Run build process for only linuxamd64 +#fast: @ run build process for only linuxamd64 fast: setup linuxamd64 -# list of binary formats to build +#binaries: @ list of binary formats to build binaries: linux386 linuxamd64 linuxarm linuxarm64 darwinamd64 darwinarm64 win386 winamd64 -# Setup commands to always run +#setup: @ setup commands to always run setup: getdeps format ##################### @@ -154,6 +160,7 @@ releasedockerplugins: releasedocker: releasedockermain releasedockerplugins +#testdocker: @ run integration test using docker testdocker: $(if $(REPO),,$(error Must set REPO - glauth or other)) @echo "==> Cleaning up any existing image to be on the safe side..." && \