aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorame <[email protected]>2024-04-14 21:24:32 -0500
committerame <[email protected]>2024-04-14 21:24:32 -0500
commit3b9343ae3f25684e1dfa3bd8f123d61dcfd81be7 (patch)
tree6ebfb5bcd5d0eb528804f27702c921e15a407024
parent6b4d88d79c8000a6c3a50aaadbab0c7f4b6e7525 (diff)
make file (woo)
-rw-r--r--.gitignore3
-rw-r--r--makefile22
2 files changed, 25 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 5ce4029..1a2cf81 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,6 @@ a.out
test
test2
*.py
+
+src/*.o
+src/*/*.o
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..f27930a
--- /dev/null
+++ b/makefile
@@ -0,0 +1,22 @@
+#todo: msys2 stuff
+
+CC := clang
+CFLAGS := -fPIC
+LFLAGS := -lm -shared
+
+SRCS := $(wildcard src/*.c) $(wildcard src/*/*.c)
+
+OBJS := $(SRCS:.c=.o)
+
+TARGET := llib.so
+
+all: $(TARGET)
+
+%.o: %.c
+ $(CC) -c $< -o $@ $(CFLAGS)
+
+$(TARGET): $(OBJS)
+ ld $(LFLAGS) $(OBJS) -o $(TARGET)
+
+clean:
+ rm -f $(OBJS)