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') SRC:=$(shell find ${SRC.dir} -iname '*.c')
HDR:=$(shell find ${SRC.dir} -iname '*.h') 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} VPATH=${SRC.dir} ${OBJ.dir}
${OBJ.dir}/%.o: ${SRC.dir}/%.c ${OBJ.dir}/%.o: ${SRC.dir}/%.c
${COMPILE.c} $< -o $@ ${COMPILE.c} $< -o $@
${TARGET}: ${OBJ} | ${HDR} ${TARGET}: ${HDR} ${OBJ.dir} | ${OBJ}
${LINK.c} $+ -o $@ ${LINK.c} $| -o $@
${SRC} ${HDR}: ${SRC} ${HDR}:

View File

@ -15,22 +15,3 @@ ifeq (${DEBUG},1)
else else
CFLAGS += -O2 -flto=auto CFLAGS += -O2 -flto=auto
endif 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}