From 66eb918a13b6607cc7bb615350a0e26f3670cd54 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Fri, 15 May 2020 10:52:11 -0700 Subject: factored out the common code of makefiles --- rules.mk | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'rules.mk') diff --git a/rules.mk b/rules.mk index ce74da2..ff12fdb 100644 --- a/rules.mk +++ b/rules.mk @@ -1,7 +1,6 @@ # Standard housekeeping -.PHONY: all debug release clean install +.PHONY: all debug release clean target install .SUFFIXES: -.SUFFIXES: .s .c .o all: targets @@ -18,6 +17,7 @@ DEPS := LIBS := BINS := +TSTS := # Iterate through directory tree DIR := sys @@ -25,40 +25,33 @@ include $(DIR)/rules.mk # Generic rules %.a: %.o - @echo AR $@ $^ + @echo AR $^ @$(ARCHIVE) $(OBJ_DIR)/%.o: $(SRC_DIR)/%.c - @echo CC $^ + @echo CC $^ @$(COMPILE) $(OBJ_DIR)/%.o: $(SRC_DIR)/%.s - @echo AS $^ + @echo AS $^ @$(ASSEMBLE) %: %.o - @echo CC $^ + @echo CC $^ @$(LINK) $(OBJ_DIR)/%: $(SRC_DIR)/%.c - @echo CC $^ + @echo CC $^ @$(COMPLNK) -.PHONY: targets -targets: $(LIBS) $(BINS) +targets: $(LIBS) $(BINS) $(TSTS) -.PHONY: database -database: $(LIBS) $(BINS) - gentags - ctags -R sys - -.PHONY: clean clean: rm -f $(OBJS) rm -f $(DEPS) rm -f $(LIBS) rm -f $(BINS) + rm -f $(TSTS) -.PHONY: install install: targets echo "TODO" -- cgit v1.2.1