chiark / gitweb /
Provide test-load target in extensions directories
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 7 Jun 2016 23:59:39 +0000 (00:59 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 8 Jun 2016 00:00:26 +0000 (01:00 +0100)
.gitignore
base/extension.make

index 4dd2a63..8193c54 100644 (file)
@@ -2,6 +2,7 @@
 *.o
 *.so
 *.d
+*.test.tcl
 *+tcmdif.[ch]
 debian/files
 debian/libtcl-chiark-1
index 23e72ee..a881a9e 100644 (file)
@@ -41,4 +41,18 @@ TCMDIFARGS ?=        -p$(FAMILY)_$(EXTBASE) -o$@ $(BASE_TCT) $(OTHER_TCTS) $<
 %+tcmdif.h:    %.tct $(BASE_TCT) $(OTHER_TCTS) $(TCMDIFGEN)
                $(TCMDIFGEN) -wh $(TCMDIFARGS)
 
+OTHER_DIRS +=  ../base/
+OTHER_DIRS +=  $(addprefix ../,$(dir $(OTHER_EXTS)))
+OTHER_DIRS +=  .
+
+null :=
+space := $(null) #
+
+$(SHLIB).test.tcl:
+               echo >$@ "load $(SHLIB).so"
+
+test-load:     $(SHLIB).so $(SHLIB).test.tcl
+               LD_LIBRARY_PATH=$(subst $(space),:,$(OTHER_DIRS))$${LD_LIBRARY_PATH+:}$${LD_LIBRARY_PATH} \
+               tclsh$(TCL_VERSION) $(SHLIB).test.tcl
+
 include                $(BASE_DIR)/final.make