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
commit7018bae05d9c04c799e715294b5c58317f21a5ac (patch)
tree6ebfb5bcd5d0eb528804f27702c921e15a407024
parentac965cf5e65a120134e5fe15be637a71ecd9ff60 (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)