From 0170e838d18369c10439c25720e11a79d65c4bff Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Sat, 11 Dec 2021 18:04:43 -0500 Subject: initial commit. working alloc and free --- Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b8de4df --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +CFILES := $(wildcard *.c) +OFILES := $(patsubst %.c,%.o,$(CFILES)) + +SHARED ?= 1 +STATIC ?= 0 + +CC ?= gcc +AR ?= ar + +WARNS ?= -Wall -Wextra -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -Wnull-dereference -Wdouble-promotion -Wshadow -Wcast-align +CFLAGS ?= $(WARNS) -L$(shell pwd) +OUT := libmoditheap + +.PHONY: all +all: $(OFILES) +ifeq ($(SHARED),1) + $(CC) -shared $(CFLAGS) -o $(OUT).so -fPIC $(CFILES) +endif +ifeq ($(STATIC),1) + $(AR) rcs $(OUT).a $^ +endif + +%.o:%.c + $(CC) -c -o $@ $< -- cgit v1.2.1