-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (45 loc) · 1.3 KB
/
Makefile
File metadata and controls
57 lines (45 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# DeepShell C Version Makefile
# Supports both Linux and Windows (MSYS2/Mingw64)
CC = gcc
CFLAGS = -Wall -Wextra -std=c99 -O2
LDFLAGS =
LIBS = -lcurl -ljson-c -lpthread -lreadline
# Platform detection
ifeq ($(OS),Windows_NT)
# Windows with MSYS2/Mingw64
EXECUTABLE = deepshell.exe
CFLAGS += -D_WIN32
LDFLAGS += -static-libgcc
else
# Linux
EXECUTABLE = deepshell
CFLAGS += -D_POSIX_C_SOURCE=200809L
endif
# Source files
SOURCES = main.c settings.c gemini.c ollama.c openrouter.c utils.c config.c interactive.c
OBJECTS = $(SOURCES:.c=.o)
# Default target
all: $(EXECUTABLE)
# Build the executable
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) -o $(EXECUTABLE) $(LDFLAGS) $(LIBS)
# Compile source files
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# Clean build artifacts
clean:
rm -f $(OBJECTS) $(EXECUTABLE)
# Install dependencies (Linux)
install-deps-linux:
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libjson-c-dev libreadline-dev
# Install dependencies (Windows/MSYS2)
install-deps-windows:
pacman -S mingw-w64-x86_64-curl mingw-w64-x86_64-json-c
# Development build with debug info
debug: CFLAGS += -g -DDEBUG
debug: $(EXECUTABLE)
# Release build
release: CFLAGS += -DNDEBUG
release: $(EXECUTABLE)
.PHONY: all clean install-deps-linux install-deps-windows debug release