From 50ce14b9bb9d412de031c43a4dcf4b1625d949da Mon Sep 17 00:00:00 2001 From: Emil Date: Wed, 2 Aug 2023 08:41:54 -0600 Subject: [PATCH] Simplified Makefile --- Makefile | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index fbc52d5..442d562 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ OBJ.DIR := obj # INC.DIR := include SRC := fetch.c main.c -OBJ := ${OBJ.DIR}/fetch.o ${OBJ.DIR}/main.o +OBJ := fetch.o main.o # HDR := VPATH := ${INC.DIR}:${SRC.DIR}:${OBJ.DIR} @@ -28,20 +28,16 @@ CFLAGS := ${CFLAGS} -fsanitize=${SAN} CPPFLAGS := ${CPPFLAGS} -DPROGN="\"${PROGN}\"" -all: ${PROGN} +.c.o: + ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $< -${PROGN}: ${OBJ.DIR} ${PREFIX} ${HDR} ${OBJ} +${PROGN}: ${OBJ.DIR} ${HDR} ${OBJ} ${CC} ${CFLAGS} ${CPPFLAGS} -o $@ ${OBJ} ${LDFLAGS} -${OBJ.DIR}/main.o: ${SRC.DIR}/main.c - ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ ${SRC.DIR}/main.c -${OBJ.DIR}/fetch.o: ${SRC.DIR}/fetch.c - ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ ${SRC.DIR}/fetch.c - # include/config.h: include/config.mk.h # cp -f $< $@ -${OBJ.DIR} ${PREFIX}: +${OBJ.DIR}: mkdir -p $@ clean: