diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2020-05-15 10:52:11 -0700 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2020-05-15 10:52:11 -0700 |
commit | 66eb918a13b6607cc7bb615350a0e26f3670cd54 (patch) | |
tree | 91a9f9c3e086e778fc754aa299f223e59dad429c /rules.mk | |
parent | 463ed852261da4d1dd1b859fa717a1d683306c9d (diff) |
factored out the common code of makefiles
Diffstat (limited to 'rules.mk')
-rw-r--r-- | rules.mk | 25 |
1 files changed, 9 insertions, 16 deletions
@@ -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" |