summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..6f80fb0
--- /dev/null
+++ b/makefile
@@ -0,0 +1,24 @@
+CC ?= cc
+CFLAGS := -std=c23 -O3 -Wall -Werror -fPIC -c
+
+BUILD_DIR := build
+TARGET := $(BUILD_DIR)/libsafec.a
+
+SRCS := $(wildcard *.c)
+OBJS := $(patsubst %.c,$(BUILD_DIR)/%.o,$(SRCS))
+
+.PHONY: all clean
+
+all: $(BUILD_DIR) $(TARGET)
+
+$(BUILD_DIR):
+ mkdir -p $(BUILD_DIR)
+
+$(TARGET): $(OBJS)
+ ar rcs $@ $^
+
+$(BUILD_DIR)/%.o: %.c
+ $(CC) $(CFLAGS) $< -o $@
+
+clean:
+ rm -rf $(BUILD_DIR)