Finished BUD 1

This commit is contained in:
Your Name
2025-08-18 21:51:54 -04:00
parent e641c813eb
commit 95ccb3a9c4
24 changed files with 1728 additions and 31 deletions

50
Makefile Normal file
View File

@@ -0,0 +1,50 @@
# Ginxsom Blossom Server Makefile
CC = gcc
CFLAGS = -Wall -Wextra -std=c99 -O2
LIBS = -lfcgi -lsqlite3
SRCDIR = src
BUILDDIR = build
TARGET = $(BUILDDIR)/ginxsom-fcgi
# Source files
SOURCES = $(SRCDIR)/main.c
OBJECTS = $(SOURCES:$(SRCDIR)/%.c=$(BUILDDIR)/%.o)
# Default target
all: $(TARGET)
# Create build directory
$(BUILDDIR):
mkdir -p $(BUILDDIR)
# Compile object files
$(BUILDDIR)/%.o: $(SRCDIR)/%.c | $(BUILDDIR)
$(CC) $(CFLAGS) -c $< -o $@
# Link final executable
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) $(LIBS) -o $@
# Clean build files
clean:
rm -rf $(BUILDDIR)
# Install (copy to system location)
install: $(TARGET)
sudo cp $(TARGET) /usr/local/bin/
sudo chmod 755 /usr/local/bin/ginxsom-fcgi
# Uninstall
uninstall:
sudo rm -f /usr/local/bin/ginxsom-fcgi
# Run the FastCGI application
run: $(TARGET)
./$(TARGET)
# Debug build
debug: CFLAGS += -g -DDEBUG
debug: $(TARGET)
.PHONY: all clean install uninstall run debug