From 40efee07a79bc3cce7910a98a8d2779240ec8769 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 4 Jun 2016 05:25:51 -0400 Subject: add a help target --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f557e92..bed5f09 100644 --- a/Makefile +++ b/Makefile @@ -22,11 +22,11 @@ QUIET_AR = @echo " AR $@"; QUIET_LEX = @echo " LEX $@"; endif -all: $(OUT) $(SOUT) +all: $(OUT) $(SOUT) ## Build both static and dynamic libraries -build: $(OUT) +build: $(OUT) ## Build a dynamic library -static: $(SOUT) +static: $(SOUT) ## Build a static library $(OUT): $(OBJ) $(QUIET_LD)$(CC) -fPIC -shared -o $@ $^ $(ALLLDFLAGS) @@ -49,10 +49,13 @@ $(SRC)%.c: $(SRC)%.l $(SRC)%.h: $(SRC)%.l $(QUIET_LEX)$(LEX) --header-file=$(<:.l=.h) -o /dev/null $< -clean: +clean: ## Remove build files rm -f $(OUT) $(SOUT) $(OBJ) $(OBJ:$(BUILD)%.o=$(BUILD).%.d) @rmdir -p $(BUILD) > /dev/null 2>&1 || true +help: ## Display this help + @grep -HE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":|##"}; {printf "\033[36m%-20s\033[0m %s\n", $$2, $$4}' + -include $(OBJ:$(BUILD)%.o=$(BUILD).%.d) .PHONY: build clean -- cgit v1.2.3-54-g00ecf