From 65264ba6d1f7e7402009f33b60e3263bf1f02498 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Fri, 17 Apr 2020 18:04:04 -0700 Subject: init: prototype of code skeleton --- rules.mk | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 rules.mk (limited to 'rules.mk') diff --git a/rules.mk b/rules.mk new file mode 100644 index 0000000..cc495d6 --- /dev/null +++ b/rules.mk @@ -0,0 +1,44 @@ +# Standard housekeeping +.PHONY: all clean install +.SUFFIXES: +.SUFFIXES: .c .o + +all: targets + +# Targets & array of sources & intermediates +SRCS := +OBJS := +DEPS := + +LIBS := +BINS := + +# Iterate through directory tree +DIR := src +include $(DIR)/rules.mk +# ... (repeat) + +# Generic rules +%.a: %.o + $(ARCHIVE) + +$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c + $(COMPILE) + +%: %.o + $(LINK) + +$(OBJ_DIR)/%: $(SRC_DIR)/%.c + $(COMPLNK) + +.PHONY: targets +targets: $(LIBS) $(BINS) + +.PHONY: clean +clean: + rm $(OBJS) $(DEPS) + rm $(LIBS) $(BINS) + +.PHONY: install +install: targets + echo "TODO" -- cgit v1.2.1