aboutsummaryrefslogtreecommitdiff
path: root/rules.mk
diff options
context:
space:
mode:
authorNicholas <nbnoll@eml.cc>2021-11-20 11:55:55 -0800
committerNicholas <nbnoll@eml.cc>2021-11-20 12:34:01 -0800
commite97c8c469db0aa27985dab2879dc1f14905c7387 (patch)
treef10f7ed68f1ad5212eebb0985ef040c5e96235ba /rules.mk
parenta9bfe650038afea8b751175cac16f6027345e45f (diff)
chore: simplify makefiles
Diffstat (limited to 'rules.mk')
-rw-r--r--rules.mk18
1 files changed, 11 insertions, 7 deletions
diff --git a/rules.mk b/rules.mk
index e8be45d..d89035e 100644
--- a/rules.mk
+++ b/rules.mk
@@ -1,5 +1,5 @@
# Standard housekeeping
-.PHONY: all debug release system bins libs tests clean target install
+.PHONY: all debug release clean target install
.SUFFIXES:
all: targets
@@ -9,8 +9,8 @@ debug: CFLAGS += -DDEBUG -g -fsanitize=address
debug: INCS := -I $(INC_DIR)
debug: ELIBS := -fsanitize=address
debug: STATIC :=
-debug: CINIT :=
-debug: CFINI :=
+debug: INIT :=
+debug: FINI :=
debug: targets
release: CFLAGS += -O2 -mtune=native -flto #-DNDEBUG
@@ -48,14 +48,18 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.s
$(OBJ_DIR)/%: $(SRC_DIR)/%.c
$(COMPLINK)
+$(TST_DIR)/%: TLIBS=$(OBJ_DIR)/base/base.a $(SYS)
+$(TST_DIR)/%: $(SRC_DIR)/%.c
+ $(COMPLINK)
+
# iterate through source directory tree
DIR := src
include $(DIR)/rules.mk
-system: $(RUNTIME) $(SYS)
-bins: system $(BINS)
-tests: system $(TEST)
-targets: libs bins tests
+$(BINS): | $(LIBS) $(RUNTIME) $(SYS)
+$(TEST): | $(LIBS) $(RUNTIME) $(SYS)
+
+targets: $(LIBS) $(BINS) $(TEST)
clean:
@echo removing system layer