aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-05-02 04:45:16 -0400
committerJesse Luehrs <doy@tozt.net>2016-05-02 04:51:25 -0400
commit8ce44cce8e385d1875b776e7e4fb87d4b4393e69 (patch)
tree98bfdd9eb859ff8ccbd2cb854289a73d0b641187 /Makefile
parent252dcc89a68b81e1fe7f759d33e8a49fab155c7c (diff)
downloadrunes-8ce44cce8e385d1875b776e7e4fb87d4b4393e69.tar.gz
runes-8ce44cce8e385d1875b776e7e4fb87d4b4393e69.zip
implement `make help` (and a couple other helpful commands)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 12 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index fe7f69d..19f559d 100644
--- a/Makefile
+++ b/Makefile
@@ -31,7 +31,13 @@ ALLLDFLAGS = $(shell pkg-config --libs $(LIBS)) $(LDFLAGS)
MAKEDEPEND = $(CC) $(ALLCFLAGS) -M -MP -MT '$@ $(@:$(BUILD)%.o=$(BUILD).%.d)'
-build: $(OUT) $(DOUT) $(COUT)
+all: $(OUT) $(DOUT) $(COUT) ## Build all of the targets
+
+run: $(OUT) ## Build and run the standalone runes terminal
+ @./$(OUT)
+
+run-daemon: $(DOUT) $(COUT) ## Build and run the runes daemon
+ @./$(DOUT)
$(OUT): $(OBJ) libvt100/libvt100.a
$(CC) $(ALLLDFLAGS) -o $@ $^
@@ -58,11 +64,14 @@ $(SRC)%.c: $(SRC)%.l
$(SRC)%.h: $(SRC)%.l
$(LEX) --header-file=$(<:.l=.h) -o /dev/null $<
-clean:
+clean: ## Remove build files
cd libvt100 && make clean
rm -f $(OUT) $(OBJ) $(OBJ:$(BUILD)%.o=$(BUILD).%.d) $(DOUT) $(DOBJ) $(DOBJ:$(BUILD)%.o=$(BUILD).%.d) $(COUT) $(COBJ) $(COBJ:$(BUILD)%.o=$(BUILD).%.d)
@rmdir -p $(BUILD) > /dev/null 2>&1
+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
+.PHONY: all run run-daemon clean help