aboutsummaryrefslogtreecommitdiff
path: root/rules.mk
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-04-17 18:04:04 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-04-17 18:04:04 -0700
commit65264ba6d1f7e7402009f33b60e3263bf1f02498 (patch)
tree9911d9fd925940d61a75a48817b375b96a637ddc /rules.mk
init: prototype of code skeleton
Diffstat (limited to 'rules.mk')
-rw-r--r--rules.mk44
1 files changed, 44 insertions, 0 deletions
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"