From d02e8881fcfb34d4c25354b67fdc3af58fdcbf98 Mon Sep 17 00:00:00 2001 From: Emery Berger Date: Fri, 25 Oct 2024 10:30:27 -0400 Subject: [PATCH 1/2] Changed binary name, added homebrew links. --- GNUmakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index ae84bbb..e84100d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -7,6 +7,7 @@ ifeq ($(shell uname -s),Darwin) LIBFILE := $(LIBNAME).dylib DYNAMIC_LIB := -dynamiclib SQLITE_LIB = libsqlite3.dylib +CXXFLAGS := $(CXXFLAGS) -I/opt/homebrew/include -L/opt/homebrew/lib else LIBFILE := $(LIBNAME).so DYNAMIC_LIB := -shared -fPIC @@ -16,4 +17,4 @@ endif all: *.c *.cpp *.hpp clang++ $(CXXFLAGS) $(DYNAMIC_LIB) -o $(LIBFILE) sqlwrite.cpp fmt/src/format.cc -lcurl -lssl -lcrypto clang $(CFLAGS) $(DYNAMIC_LIB) -o $(SQLITE_LIB) sqlite3.c - clang $(CFLAGS) shell.c -L. -lsqlite3 -o sqlite3 + clang $(CFLAGS) shell.c -L. -lsqlite3 -o sqlwrite From 4922286ed27e49bd0d1876197d0407589770c0df Mon Sep 17 00:00:00 2001 From: Emery Berger Date: Fri, 25 Oct 2024 10:34:46 -0400 Subject: [PATCH 2/2] Use pkg-config. --- GNUmakefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index e84100d..8665f36 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -7,14 +7,15 @@ ifeq ($(shell uname -s),Darwin) LIBFILE := $(LIBNAME).dylib DYNAMIC_LIB := -dynamiclib SQLITE_LIB = libsqlite3.dylib -CXXFLAGS := $(CXXFLAGS) -I/opt/homebrew/include -L/opt/homebrew/lib +CXXFLAGS := $(CXXFLAGS) $(shell pkg-config --cflags --libs libcurl openssl) else LIBFILE := $(LIBNAME).so DYNAMIC_LIB := -shared -fPIC SQLITE_LIB = libsqlite3.so +CXXFLAGS := $(CXXFLAGS) -lcurl -lssl -lcrypto endif all: *.c *.cpp *.hpp - clang++ $(CXXFLAGS) $(DYNAMIC_LIB) -o $(LIBFILE) sqlwrite.cpp fmt/src/format.cc -lcurl -lssl -lcrypto + clang++ $(CXXFLAGS) $(DYNAMIC_LIB) -o $(LIBFILE) sqlwrite.cpp fmt/src/format.cc clang $(CFLAGS) $(DYNAMIC_LIB) -o $(SQLITE_LIB) sqlite3.c clang $(CFLAGS) shell.c -L. -lsqlite3 -o sqlwrite