[Makefile] Added .PHONY. Removed object compilation. This project won't get extra .c files anyway, so let's compile directly into executable.

This commit is contained in:
Alexander Andreev 2021-12-25 23:22:32 +04:00
parent 1abcf3d4cc
commit 1799c62c48
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -7,17 +7,14 @@ OBJ_DIR=obj
DESTDIR=/
.PHONY: all ${TARGET} clean install uninstall
all: ${TARGET}
${TARGET}: ${OBJ_DIR}/main.o
${CC} ${CFLAGS} $< -o $@
${OBJ_DIR}/main.o: ${SRC_DIR}/main.c ${SRC_DIR}/main.h
@mkdir -p ${OBJ_DIR}
${CC} ${CFLAGS} -c $< -o $@
${TARGET}: ${SRC_DIR}/main.c ${SRC_DIR}/main.h
${CC} ${CFLAGS} ${LDFLAGS} $< -o $@
clean:
rm -r ${OBJ_DIR}
rm ${TARGET}
install: