# Standard housekeeping .PHONY: all debug release clean install .SUFFIXES: .SUFFIXES: .s .c .o all: targets debug: CFLAGS += -DDEBUG debug: targets release: CFLAGS += -O3 -flto #-DNDEBUG release: targets # Targets & array of sources & intermediates SRCS := OBJS := DEPS := LIBS := BINS := # Iterate through directory tree DIR := sys include $(DIR)/rules.mk # Generic rules %.a: %.o @echo AR $@ $^ @$(ARCHIVE) $(OBJ_DIR)/%.o: $(SRC_DIR)/%.c @echo CC $^ @$(COMPILE) $(OBJ_DIR)/%.o: $(SRC_DIR)/%.s @echo AS $^ @$(ASSEMBLE) %: %.o @echo CC $^ @$(LINK) $(OBJ_DIR)/%: $(SRC_DIR)/%.c @echo CC $^ @$(COMPLNK) .PHONY: targets targets: $(LIBS) $(BINS) .PHONY: database database: $(LIBS) $(BINS) gentags ctags -R sys .PHONY: clean clean: rm -f $(OBJS) rm -f $(DEPS) rm -f $(LIBS) rm -f $(BINS) .PHONY: install install: targets echo "TODO"