2024-02-16 14:16:12 +05:30
|
|
|
# Build a shared library of negentropy
|
|
|
|
|
|
|
|
|
|
#TODO: Need to add compilation flags based on OS
|
2024-02-16 15:15:59 +05:30
|
|
|
INCS = -I./ -I/opt/homebrew/include/
|
2024-02-16 14:16:12 +05:30
|
|
|
TARGET = libnegentropy.so
|
|
|
|
|
|
2024-02-16 15:15:59 +05:30
|
|
|
.PHONY: all clean install-deps
|
2024-02-16 14:16:12 +05:30
|
|
|
|
2024-02-16 15:25:39 +01:00
|
|
|
all: precompiled-header shared-lib
|
2024-02-16 15:15:59 +05:30
|
|
|
|
|
|
|
|
#TODO: Need to add compilation flags based on OS
|
|
|
|
|
install-deps:
|
|
|
|
|
brew install lmdb openssl
|
2024-02-16 14:16:12 +05:30
|
|
|
|
2024-02-16 15:25:39 +01:00
|
|
|
# Generate 'negentropy.h.gch'
|
|
|
|
|
precompiled-header:
|
|
|
|
|
g++ --std=c++20 -Wall -fexceptions -g negentropy.h -I./ -I./vendor/lmdbxx/include/
|
2024-02-16 14:16:12 +05:30
|
|
|
|
2024-02-16 15:25:39 +01:00
|
|
|
shared-lib: negentropy.h.gch
|
|
|
|
|
g++ --std=c++20 -I./ -I./vendor/lmdbxx/include/ -shared -fPIC -o $(TARGET) negentropy_wrapper.c
|
2024-02-16 14:16:12 +05:30
|
|
|
|
2024-02-16 15:23:50 +05:30
|
|
|
clean:
|
2024-02-16 15:25:39 +01:00
|
|
|
rm -f $(TARGET) negentropy.h.gch libnegentropy.so
|