Skip to content

Commit

Permalink
added make install / uninstall directives (#85)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Pollak <tompollak100@gmail.com>
  • Loading branch information
tom-pollak and Tom Pollak authored Aug 15, 2024
1 parent b427669 commit e78b7f1
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ COMMIT=$(shell git rev-parse HEAD)
VERSION=$(shell cat VERSION)
DATE=$(shell date +'%FT%TZ%z')

INSTALL_LIB_DIR = /usr/local/lib
INSTALL_INCLUDE_DIR = /usr/local/include
INSTALL_BIN_DIR = /usr/local/bin

ifndef CC
CC=gcc
endif
Expand Down Expand Up @@ -174,7 +178,7 @@ evidence-of:
test:
sqlite3 :memory: '.read test.sql'

.PHONY: version loadable static test clean gh-release evidence-of
.PHONY: version loadable static test clean gh-release evidence-of install uninstall

publish-release:
./scripts/publish-release.sh
Expand All @@ -195,6 +199,28 @@ site-dev:
site-build:
npm --prefix site run build

install:
install -d $(INSTALL_LIB_DIR)
install -d $(INSTALL_INCLUDE_DIR)
install -m 644 sqlite-vec.h $(INSTALL_INCLUDE_DIR)
@if [ -f $(TARGET_LOADABLE) ]; then \
install -m 644 $(TARGET_LOADABLE) $(INSTALL_LIB_DIR); \
fi
@if [ -f $(TARGET_STATIC) ]; then \
install -m 644 $(TARGET_STATIC) $(INSTALL_LIB_DIR); \
fi
@if [ -f $(TARGET_CLI) ]; then \
sudo install -m 755 $(TARGET_CLI) $(INSTALL_BIN_DIR); \
fi
ldconfig

uninstall:
rm -f $(INSTALL_LIB_DIR)/$(notdir $(TARGET_LOADABLE))
rm -f $(INSTALL_LIB_DIR)/$(notdir $(TARGET_STATIC))
rm -f $(INSTALL_LIB_DIR)/$(notdir $(TARGET_CLI))
rm -f $(INSTALL_INCLUDE_DIR)/sqlite-vec.h
ldconfig

# ███████████████████████████████ WASM SECTION ███████████████████████████████

WASM_DIR=$(prefix)/.wasm
Expand Down

0 comments on commit e78b7f1

Please sign in to comment.