From 2dc9d118efb64de6ea54a5a9eb4474f8e5ef3145 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 29 Feb 2024 01:50:44 +0100 Subject: Initial commit --- Makefile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e8f873a --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +AR := ar +CC := gcc +LIB := lib/libsalis.a + +SOURCES := $(wildcard src/*.c) +OBJECTS := $(patsubst src/%.c,build/%.o,$(SOURCES)) +DEPS := $(patsubst %.o,%.d,$(OBJECTS)) + +LFLAGS := rs + +# uncomment for debug +# OFLAGS := -ggdb + +# uncomment for release +OFLAGS := -O3 -DNDEBUG + +CFLAGS := -Iinclude -c $(OFLAGS) -MMD -Wall -Wextra -std=c89 -pedantic-errors \ + -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition + +all: $(OBJECTS) + $(AR) $(LFLAGS) $(LIB) $(OBJECTS) + $(MAKE) -C tsalis + +-include $(DEPS) + +$(OBJECTS): $(patsubst build/%.o,src/%.c,$@) + $(CC) $(CFLAGS) $(patsubst build/%.o,src/%.c,$@) -o $@ + +clean: + -rm build/* + -rm $(LIB) + $(MAKE) clean -C tsalis -- cgit v1.2.1