diff options
author | Nicholas <nbnoll@eml.cc> | 2021-11-20 11:55:55 -0800 |
---|---|---|
committer | Nicholas <nbnoll@eml.cc> | 2021-11-20 12:34:01 -0800 |
commit | e97c8c469db0aa27985dab2879dc1f14905c7387 (patch) | |
tree | f10f7ed68f1ad5212eebb0985ef040c5e96235ba /rules.mk | |
parent | a9bfe650038afea8b751175cac16f6027345e45f (diff) |
chore: simplify makefiles
Diffstat (limited to 'rules.mk')
-rw-r--r-- | rules.mk | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -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 |