summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-06-04 05:25:51 -0400
committerJesse Luehrs <doy@tozt.net>2016-06-04 05:25:51 -0400
commit40efee07a79bc3cce7910a98a8d2779240ec8769 (patch)
tree821224f3a54bb6937ef241d61bf919379c19a5d0
parent5c7795b64609773b9266693d225f21db494a16c8 (diff)
downloadlibvt100-40efee07a79bc3cce7910a98a8d2779240ec8769.tar.gz
libvt100-40efee07a79bc3cce7910a98a8d2779240ec8769.zip
add a help target
-rw-r--r--Makefile11
1 files 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