Fixed not isolating objects in obj

This commit is contained in:
Emil 2023-08-21 07:25:14 -06:00
parent b21b46e825
commit ce284f667b
No known key found for this signature in database
GPG Key ID: 5432DB986FDBCF8A
2 changed files with 3 additions and 22 deletions

View File

@ -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}:

View File

@ -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}