Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (45 loc) · 7.26 KB
/
Copy pathMakefile
File metadata and controls
55 lines (45 loc) · 7.26 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
# VectorForge Makefile
CXX = g++
CXXFLAGS = -std=c++17 -O3 -Wall -Wextra
SRC_DIR = cpp
BUILD_DIR = build
TARGET = $(BUILD_DIR)/vectorforge
# Source files
SOURCES = $(SRC_DIR)/main.cpp $(SRC_DIR)/vector_store.cpp
HEADERS = $(SRC_DIR)/vector_store.h
.PHONY: all clean cpp server install test
all: cpp server
# Build C++ executable
cpp: $(TARGET)
$(TARGET): $(SOURCES) $(HEADERS)
@mkdir -p $(BUILD_DIR)
@mkdir -p data
$(CXX) $(CXXFLAGS) $(SOURCES) -o $(TARGET)
@echo "✓ C++ executable built: $(TARGET)"
# Install NPM dependencies and build TypeScript server
server:
@echo "Installing server dependencies..."
@cd server && npm install
@echo "Building TypeScript server..."
@cd server && npm run build
@echo "✓ Server built successfully"
# Install all dependencies
install:
@echo "Installing server dependencies..."
@cd server && npm install
@echo "✓ Dependencies installed"
# Clean build artifacts
clean:
rm -rf $(BUILD_DIR)
rm -rf data/database.bin
rm -rf server/dist
rm -rf server/node_modules
@echo "✓ Clean complete"
# Test C++ executable
test: cpp
@echo "Testing VectorForge C++ engine..."
@echo "Test 1: Adding a vector..."
@$(TARGET) add "Test memory content" "[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,0.1,0.2,0.3,0.4,0.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