Fixed not isolating objects in obj
This commit is contained in:
parent
b21b46e825
commit
ce284f667b
6
Makefile
6
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}:
|
||||
|
||||
|
19
config.mk
19
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}
|
||||
|
Loading…
Reference in New Issue
Block a user