Skip to content

Commit

Permalink
Use ack version 2 environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kamahen authored and JanWielemaker committed Jul 12, 2024
1 parent 7f22217 commit 6144cc1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
24 changes: 18 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,26 @@ LIBHDT=$(HDTHOME)/libhdt
LIBCDS=$(HDTHOME)/libcds
HDTLIB=$(LIBHDT)/.libs
CDSLIB=$(LIBCDS)/.libs
SOBJ= $(PACKSODIR)/hdt4pl.$(SOEXT)
SOBJ= $(SWIPL_MODULE_DIR)/hdt4pl.$(SWIPL_MODULE_EXT)
NPROC:=$(shell expr $$(nproc) + 1)
MAKE_J=-j$(NPROC)
CFLAGS+=-I$(LIBHDT)/include -g
CFLAGS=$(SWIPL_CFLAGS) -I$(LIBHDT)/include -g
# This doesn't work because the *.so files get picked first:
# LIBS= -L$(HDTLIB) -L$(CDSLIB) -lhdt -lcds
# Instead, we copy the *.a files intothe same directory as $(OBJ)
# Instead, we copy the *.a files into the same directory as $(OBJ)
# - see the rules for $(OBJ2).
LIBS= -Lc -lhdt -lcds
OBJ= c/hdt4pl.o
OBJ2= c/libcds.a c/libhdt.a
LD=g++
# WARNING: A previous version of this Makefile set LD=g++
# ... this confuses hdt-cpp's use of libtool.
# The correct way of using the linker is with $(CC):
# see the "implicit variables" in the GNU make documentation
# Note that pack_version(2) defines `SWIPL_CC` and
# "swipl pack install ." creates ./buildenv.sh, which
# defines the SWIPL_* environment variables

CC=$(SWIPL_CC)

all: $(SOBJ)

Expand All @@ -27,8 +35,8 @@ c/libcds.a: $(CDSLIB)/libcds.a
ln -f $< $@

$(SOBJ): $(OBJ) $(OBJ2)
mkdir -p $(PACKSODIR)
$(LD) $(ARCH) $(LDSOFLAGS) -o $@ $< $(LIBS) $(SWISOLIB) -lserd-0
mkdir -p $(SWIPL_MODULE_DIR)
$(CC) $(ARCH) $(SWIPL_MODULE_LDFLAGS) -o $@ $< $(LIBS) $(SWIPL_MODULE_LIB) -lserd-0

c/hdt4pl.o: c/hdt4pl.cpp $(HDTLIB)/libhdt.a $(CDSLIB)/libcds.a
$(CC) $(ARCH) $(CFLAGS) -c -o $@ c/hdt4pl.cpp
Expand All @@ -38,6 +46,9 @@ $(HDTLIB)/libhdt.a $(HDTLIB)/libcds.a: FORCE

FORCE:

check::
$(MAKE) -C $(HDTHOME) $(MAKE_J) check

check::
$(SWIPL) -g test_hdt -t halt test/test_hdt.pl

Expand All @@ -51,3 +62,4 @@ clean:
distclean: clean
rm -f $(SOBJ)
[ ! -f $(HDTHOME)/Makefile ] || $(MAKE) -C $(HDTHOME) distclean
cd $(HDTHOME) && git clean -d -f -x
5 changes: 3 additions & 2 deletions pack.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name(hdt).
version('0.5.3').
% TODO: swipl_version([90121]).
version('0.5.4').
pack_version(2).
% swipl_version([90302]). % TODO: add stable version
title('Access RDF HDT files').
keywords(['RDF']).
author( 'Jan Wielemaker', '[email protected]' ).
Expand Down

0 comments on commit 6144cc1

Please sign in to comment.