From e97c8c469db0aa27985dab2879dc1f14905c7387 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sat, 20 Nov 2021 11:55:55 -0800 Subject: chore: simplify makefiles --- rules.mk | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'rules.mk') 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 -- cgit v1.2.1