From 9b679d8f821b7b40f90362370162e671c70da47c Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Mon, 29 Jan 2024 13:03:43 +0000 Subject: [PATCH] Build system: General improvements --- Makefile | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 433808b..2a6a072 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,27 @@ +QUIET=1 + all:first -first:gui.o main.o simdata.o assembly.o - gcc -ggdb $^ -fsanitize=address -lncurses -ltinfo -o $@ +OBJECT_FILES=gui.o main.o simdata.o assembly.o + +ifeq "${QUIET}" "1" + QUIET_CC = @echo ' CC '$@; + QUIET_LINK = @echo ' LINK '$@; + QUIET_CLEAN = @echo ' CLEAN .'; + Q = @ +else + Q = +endif + +first: ${OBJECT_FILES} + ${QUIET_LINK} + ${Q}gcc -ggdb $^ -fsanitize=address -lncurses -ltinfo -o $@ %.o:%.c - gcc -ggdb -c $< -Wall -Wextra -Werror -fsanitize=address + ${QUIET_CC} + ${Q} gcc -ggdb -c $< -Wall -Wextra -Werror -fsanitize=address .PHONY: clean clean: - rm -f gui.o main.o simdata.o assembly.o + ${QUIET_CLEAN} + ${Q} rm -f ${OBJECT_FILES} first