# HG changeset patch # User Mike Miller # Date 1471911853 25200 # Node ID eec3ed1c0578bf488c6991c2ac29c0c6bf12e290 # Parent 826a23f63f75aee2e6d441cf1e83338d378aedb7 build: generate PKG_ADD and PKG_DEL files from DEFUN_DLD declarations * Makefile.am (PKG_ADD, PKG_DEL): Generate autoload directives for functions declared in oct files with names different from file name. * .hgignore: Ignore PKG_ADD and PKG_DEL files. diff -r 826a23f63f75 -r eec3ed1c0578 .hgignore --- a/.hgignore Mon Aug 22 14:55:19 2016 -0700 +++ b/.hgignore Mon Aug 22 17:24:13 2016 -0700 @@ -43,6 +43,7 @@ (^|/)\.deps (^|/)\.libs +(^|/)PKG_(ADD|DEL) (^|/)octave-workspace # e.g. doc/faq/OctaveFAQ.info diff -r 826a23f63f75 -r eec3ed1c0578 Makefile.am --- a/Makefile.am Mon Aug 22 14:55:19 2016 -0700 +++ b/Makefile.am Mon Aug 22 17:24:13 2016 -0700 @@ -77,7 +77,7 @@ libpytave_la_CPPFLAGS = $(AM_CPPFLAGS) libpytave_la_SOURCES = $(COMMON_SOURCE_FILES) $(PYTAVE_HEADER_FILES) -CLEANFILES = *.oct +CLEANFILES = *.oct PKG_ADD PKG_DEL SUFFIXES = .oct AM_V_MKOCTFILE = $(am__v_MKOCTFILE_$(V)) @@ -93,7 +93,27 @@ %.oct: %.cc libpytave.la $(PYTAVE_HEADER_FILES) $(AM_V_MKOCTFILE)$(OCT_LINK) $< $(OCT_LIBS) -all-local: $(OCT_FILES) +PKG_ADD: $(OCT_SOURCE_FILES) + $(AM_V_GEN)for f in $(OCT_SOURCE_FILES); do \ + b=$${f%.cc}; \ + funcs=`$(SED) -n 's/^DEFUN.*(\(\w\+\),.*/\1/p' $$f | grep -v $$b`; \ + if test -n "$$funcs"; then \ + echo "$$funcs" | $(SED) "s/.*/autoload (\"&\", \"$$b.oct\");/" > $@-t && \ + mv $@-t $@ || exit $?; \ + fi; \ + done + +PKG_DEL: $(OCT_SOURCE_FILES) + $(AM_V_GEN)for f in $(OCT_SOURCE_FILES); do \ + b=$${f%.cc}; \ + funcs=`$(SED) -n 's/^DEFUN.*(\(\w\+\),.*/\1/p' $$f | grep -v $$b`; \ + if test -n "$$funcs"; then \ + echo "$$funcs" | $(SED) "s/.*/autoload (\"&\", which (\"&\"), \"remove\");/" > $@-t && \ + mv $@-t $@ || exit $?; \ + fi; \ + done + +all-local: $(OCT_FILES) PKG_ADD PKG_DEL @echo "" @echo "Pytave successfully built. Now choose from the following:" @echo ""