aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-09-13 14:55:12 -0400
committernodist <kevin.comas.git@gmail.com>2026-09-13 14:55:12 -0400
commitd30da2d13949caf2509f4b6f319612d08dff1a09 (patch)
tree83731bbb837ed6435acd0631c0742d280bf6cd72
parent33d09be340ec13cd02735dbcfe4fc810c4ad5902 (diff)
set up source readmes
-rw-r--r--Makefile21
-rw-r--r--include/README7
-rw-r--r--source/README17
-rw-r--r--test/README2
4 files changed, 33 insertions, 14 deletions
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