feat: Adding malloc wrapper for memory safety.

This commit is contained in:
2025-06-26 00:20:24 +02:00
parent 3f78db4cb7
commit dbd7f58025
11 changed files with 436 additions and 67 deletions

41
Makefile Normal file
View File

@@ -0,0 +1,41 @@
ifndef verbose
SILENT = @
endif
CC := gcc
AR := ar
CFLAGS := -I include/
ifeq ($(colorized), y)
CFLAGS += -D COLORIZED
endif
ifeq ($(no_banner), y)
CFLAGS += -D NO_BANNER
endif
ifeq ($(testing), y)
CFLAGS += -g2 -O0
else
CFLAGS += -O2
endif
all: create_output_dir libset.a
clean:
$(SILENT) rm -rf int/
$(SILENT) rm -f libset.a
create_output_dir:
$(SILENT) mkdir -p int/
libset.a: $(patsubst src/%.c, int/%.o, $(wildcard src/*.c))
@echo "Archiving $^ to $@"
$(SILENT) $(AR) rcs $@ int/**.o
# Recipe
int/%.o: src/%.c
@echo "Building $< => $@"
$(SILENT) $(CC) $(CFLAGS) -c $< -o $@
.PHONY: all clean test create_output_dir