Skip to content

Commit

Permalink
Avoid executing build for hdt-cpp twice
Browse files Browse the repository at this point in the history
  • Loading branch information
JanWielemaker committed Jul 26, 2024
1 parent d6992f5 commit 95f556a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ $(SOBJ): $(OBJ) $(OBJ2)
mkdir -p $(SWIPL_MODULE_DIR)
$(CXX) $(SWIPL_MODULE_LDFLAGS) -o $@ $< $(LIBS) $(SWIPL_MODULE_LIB) -lserd-0

c/hdt4pl.o: c/hdt4pl.cpp $(HDTLIB)/libhdt.a $(CDSLIB)/libcds.a
c/hdt4pl.o: c/hdt4pl.cpp .hdt-cpp-sentinel
$(CXX) $(CXXFLAGS) -c -o $@ c/hdt4pl.cpp

$(HDTLIB)/libhdt.a $(HDTLIB)/libcds.a: $(HDTHOME)/Makefile FORCE
.hdt-cpp-sentinel: $(HDTHOME)/Makefile
set -x -e && $(MAKE) -C $(HDTHOME) $(MAKE_J)
touch .hdt-cpp-sentinel

$(HDTHOME)/Makefile:
./configure
Expand All @@ -63,6 +64,7 @@ clean:
rm -f $(OBJ) $(OBJ2)
[ ! -f $(HDTHOME)/Makefile ] || (cd $(HDTHOME) && git reset --hard)
[ ! -f $(HDTHOME)/Makefile ] || $(MAKE) -C $(HDTHOME) clean
rm -f .hdt-cpp-sentinel

distclean: clean
rm -f $(SOBJ)
Expand Down

0 comments on commit 95f556a

Please sign in to comment.