aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorfrosty <frosty@illegalfirearms.store>2026-01-06 23:46:24 -0500
committerfrosty <frosty@illegalfirearms.store>2026-01-06 23:46:24 -0500
commitf3aa7ca0bc2ef7c286609e8f87d07cc2568093af (patch)
tree269352af1238b4dd7c3e2e023f71a27b858cdb34 /Makefile
rebase(d)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ba36df6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,43 @@
+CC := gcc
+CFLAGS := -Wall -Wextra -O2 -Isrc -I/usr/include/libxml2
+LIBS := -lbeaker -lcurl -lxml2 -lpthread -lm
+
+SRC_DIR := src
+BIN_DIR := bin
+OBJ_DIR := obj
+
+SRCS := $(shell find $(SRC_DIR) -name '*.c')
+
+OBJS := $(SRCS:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
+
+TARGET := $(BIN_DIR)/omnisearch
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+ @mkdir -p $(BIN_DIR)
+ $(CC) $(OBJS) -o $@ $(LIBS)
+ @echo "Build complete: $(TARGET)"
+
+$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) -c $< -o $@
+ @echo "Compiled: $<"
+
+run: $(TARGET)
+ ./$(TARGET)
+
+clean:
+ rm -rf $(OBJ_DIR) $(BIN_DIR)
+ @echo "Cleaned build artifacts"
+
+rebuild: clean all
+
+info:
+ @echo "Sources to compile:"
+ @echo "$(SRCS)" | tr ' ' '\n'
+ @echo ""
+ @echo "Object files to generate:"
+ @echo "$(OBJS)" | tr ' ' '\n'
+
+.PHONY: all run clean rebuild info