diff --git a/Makefile b/Makefile index 4bbf042..7098c86 100644 --- a/Makefile +++ b/Makefile @@ -6,15 +6,15 @@ OBJ.dir:=obj SRC:=$(shell find ${SRC.dir} -iname '*.c') HDR:=$(shell find ${SRC.dir} -iname '*.h') -OBJ:=$(SRC:.c=.o) +OBJ:=$(subst $(SRC.dir),$(OBJ.dir),$(SRC:.c=.o)) VPATH=${SRC.dir} ${OBJ.dir} ${OBJ.dir}/%.o: ${SRC.dir}/%.c ${COMPILE.c} $< -o $@ -${TARGET}: ${OBJ} | ${HDR} - ${LINK.c} $+ -o $@ +${TARGET}: ${HDR} ${OBJ.dir} | ${OBJ} + ${LINK.c} $| -o $@ ${SRC} ${HDR}: diff --git a/config.mk b/config.mk index 019ce15..f883c75 100644 --- a/config.mk +++ b/config.mk @@ -15,22 +15,3 @@ ifeq (${DEBUG},1) else CFLAGS += -O2 -flto=auto endif - -# Programs to check warnings for as defined by the chad standard - -GCC:=gcc -GCC.warnings:=-Wall -Wextra -Wpedantic -Wvla -Wshadow -Wundef - -CLANG:=clang -CLANG.warnings:=-Weverything - -VALGRIND:=valgrind -VALGRIND.flags:=--track-origins=yes --leak-check=full --show-leak-kinds=all - -TARGET:=hl -ARGS:=${TARGET} < source/main.c - -chad_test: - ${GCC} ${GCC.warnings} ${SRC} -o ${TARGET} - ${CLANG} ${GCC.warnings} ${SRC} -o ${TARGET} - ${VALGRIND} ${VALGRIND.flags} ${TARGET} ${ARGS}