]> git.eshelyaron.com Git - dict.git/commitdiff
Add swipl-devel submodule
authorEshel Yaron <me@eshelyaron.com>
Sat, 27 Aug 2022 06:36:33 +0000 (09:36 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 27 Aug 2022 06:36:33 +0000 (09:36 +0300)
.gitignore
.gitmodules [new file with mode: 0644]
Makefile
swipl [new submodule]

index 42073c2d27895826e0e40ee821655a8f0650af78..641c18cc367513ee41840e4403efbbf1b8e03f39 100644 (file)
@@ -1,2 +1,6 @@
 /.iprolog_history
 /sweep-module.dylib
+/swipl-win.app/
+/bin/
+/lib/
+/share/
diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..dafcc46
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "swipl"]
+       path = swipl
+       url = https://github.com/SWI-Prolog/swipl-devel.git
index 59a4c355eca58e11d6e40cbc2f9fc31c25b8172d..d11f967b609ca629170527dd227c144240f6fa74 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+CURRENT_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
+
 BASENAME = sweep
 SOEXT    = dylib
 
@@ -5,6 +7,7 @@ TARGET   = $(BASENAME)-module.$(SOEXT)
 SOURCE   = $(BASENAME).c
 
 LDFLAGS += -shared
+LDFLAGS += -Llib
 LDFLAGS += -lswipl
 
 CFLAGS  += -fPIC
@@ -12,13 +15,31 @@ CFLAGS  += -fdiagnostics-absolute-paths
 CFLAGS  += -Wall
 CFLAGS  += -Wextra
 CFLAGS  += -O2
+CFLAGS  += -Ilib/swipl/include
+
+CMAKE_OPTIONS += -DCMAKE_INSTALL_PREFIX=$(CURRENT_DIR)
+CMAKE_OPTIONS += -DUSE_GMP=OFF
+CMAKE_OPTIONS += -DSWIPL_PACKAGES_ODBC=OFF
+CMAKE_OPTIONS += -DSWIPL_PACKAGES_JAVA=OFF
+CMAKE_OPTIONS += -DSWIPL_PACKAGES_X=OFF
+CMAKE_OPTIONS += -DSWIPL_INSTALL_IN_LIB=ON
 
-.PHONY: clean all
+.PHONY: clean all swipl
 
 all: $(TARGET)
 
-$(TARGET): $(SOURCE)
-       $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+$(TARGET): $(SOURCE) swipl
+       $(CC) $(CFLAGS) -o $@ $(SOURCE) $(LDFLAGS)
 
 clean:
+       rm -rf bin lib share swipl/build
        rm -f $(TARGET)
+
+swipl:
+       cd swipl; \
+       rm -rf build; \
+       mkdir build; \
+       cd build; \
+       cmake $(CMAKE_OPTIONS) -G Ninja ..; \
+       ninja; \
+       ninja install
diff --git a/swipl b/swipl
new file mode 160000 (submodule)
index 0000000..5c7d1f8
--- /dev/null
+++ b/swipl
@@ -0,0 +1 @@
+Subproject commit 5c7d1f8352b27d45cb8066eac5af95cf925a05b7