feat: Adding malloc wrapper for memory safety.
This commit is contained in:
41
Makefile
Normal file
41
Makefile
Normal 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
|
Reference in New Issue
Block a user