From d30da2d13949caf2509f4b6f319612d08dff1a09 Mon Sep 17 00:00:00 2001 From: nodist Date: Sun, 13 Sep 2026 14:55:12 -0400 Subject: set up source readmes --- Makefile | 21 ++++++++------------- include/README | 7 +++++++ source/README | 17 +++++++++++++++++ test/README | 2 +- 4 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 include/README create mode 100644 source/README diff --git a/Makefile b/Makefile index e239bc4..17d71f0 100644 --- a/Makefile +++ b/Makefile @@ -1,34 +1,29 @@ -.PHONY: clean +.PHONY: kpl_test_memory kpl_test_thread clean MAKEFLAGS := -j$(shell nproc) -INCLUDE_DIR := "./include" -SOURCE_DIR := "./source" -TEST_DIR := "./test" - CC := gcc OO := -g -Og FFLAGS := -fno-omit-frame-pointer -fhardened WFLAGS := -Wall -Wextra -Wstack-protector -CFLAGS = -std=gnu99 $(FLAGS) -I$(INCLUDE_DIR) $(OO) $(FFLAGS) $(WFLAGS) +CFLAGS = -std=gnu99 $(FLAGS) -I./include $(OO) $(FFLAGS) $(WFLAGS) CCOBJ = $(CC) -o $@ $^ $(CFLAGS) -OBJECTS := $(patsubst %.c, %.o, $(wildcard ./source/*.c)) +SOURCE_OBJECTS := $(patsubst %.c, %.o, $(wildcard ./source/*.c)) +TEST_OBJECTS := $(patsubst %.c, %.o, $(wildcard ./test/*.c)) kpl: OO := -O2 kpl: WFLAGS += -Werror kpl: FLAGS += -DKPL_MAIN -kpl: $(OBJECTS) +kpl: $(SOURCE_OBJECTS) $(CCOBJ) -TEST_OBJECTS := $(patsubst %.c, %.o, $(wildcard ./test/*.c)) - -kpl_test: $(OBJECTS) $(TEST_OBJECTS) +kpl_test: $(SOURCE_OBJECTS) $(TEST_OBJECTS) $(CCOBJ) -kpl_test_error: FFLAGS += -fsanitize=address,leak,undefined -kpl_test_error: kpl_test +kpl_test_memory: FFLAGS += -fsanitize=address,leak,undefined +kpl_test_memory: kpl_test kpl_test_thread: FFLAGS += -fsanitize=thread kpl_test_thread: kpl_test diff --git a/include/README b/include/README new file mode 100644 index 0000000..f65c345 --- /dev/null +++ b/include/README @@ -0,0 +1,7 @@ +Headers + +--- + +Complier Flags: + +--- diff --git a/source/README b/source/README new file mode 100644 index 0000000..0ec82e2 --- /dev/null +++ b/source/README @@ -0,0 +1,17 @@ +Source + +--- + +Includes: + +#include "kpl.h" + +This is the only header for any C file in the source folder + +--- + +Complier Flags: + +KPL_MAIN # For standalone exec, off for testing or including in other code + +--- diff --git a/test/README b/test/README index 80d57e6..186c570 100644 --- a/test/README +++ b/test/README @@ -41,7 +41,7 @@ FAIL(FAIL_MESSAGE); Building: make kpl_test # build test exec -make kpl_test_error # build test exec with address, leak and undefined sanitizer +make kpl_test_memory # build test exec with address, leak and undefined sanitizer make kpl_test_thread # build test exec with thread sanitizer All objects need to be built with the same sanitizer and do not run valgrind when sanitizers are added -- cgit v1.2.3