Simplified Makefile

This commit is contained in:
Emil 2023-08-02 08:41:54 -06:00
parent 4b69c1abf1
commit 50ce14b9bb

View File

@ -11,7 +11,7 @@ OBJ.DIR := obj
# INC.DIR := include # INC.DIR := include
SRC := fetch.c main.c SRC := fetch.c main.c
OBJ := ${OBJ.DIR}/fetch.o ${OBJ.DIR}/main.o OBJ := fetch.o main.o
# HDR := # HDR :=
VPATH := ${INC.DIR}:${SRC.DIR}:${OBJ.DIR} VPATH := ${INC.DIR}:${SRC.DIR}:${OBJ.DIR}
@ -28,20 +28,16 @@ CFLAGS := ${CFLAGS} -fsanitize=${SAN}
CPPFLAGS := ${CPPFLAGS} -DPROGN="\"${PROGN}\"" 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} ${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 # include/config.h: include/config.mk.h
# cp -f $< $@ # cp -f $< $@
${OBJ.DIR} ${PREFIX}: ${OBJ.DIR}:
mkdir -p $@ mkdir -p $@
clean: clean: