From 3d678a2cbc9ebef467db25454853bb720ae78a8f Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 25 Oct 2001 12:56:15 +0000 Subject: [PATCH] * lib/am/python.am (install-%DIR%PYTHON, uninstall-%DIR%PYTHON): Have the basename step optional and use %NDIR% instead of %DIR% in filenames in order to support 'nobase_'. --- ChangeLog | 6 ++++++ lib/am/python.am | 27 +++++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index b4448de38..a8b964945 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-10-25 Alexandre Duret-Lutz + + * lib/am/python.am (install-%DIR%PYTHON, uninstall-%DIR%PYTHON): + Have the basename step optional and use %NDIR% instead of %DIR% in + filenames in order to support 'nobase_'. + 2001-10-24 Alexandre Duret-Lutz * automake.in (handle_languages, handle_single_transform_list, diff --git a/lib/am/python.am b/lib/am/python.am index 558e70192..c0fd5dc0f 100644 --- a/lib/am/python.am +++ b/lib/am/python.am @@ -22,26 +22,28 @@ ## ------------ ## if %?INSTALL% -_am_installdirs += $(DESTDIR)$(%DIR%dir) +_am_installdirs += $(DESTDIR)$(%NDIR%dir) ?EXEC?.PHONY install-exec-am: install-%DIR%PYTHON ?!EXEC?.PHONY install-data-am: install-%DIR%PYTHON install-%DIR%PYTHON: $(%DIR%_PYTHON) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(%DIR%dir) + $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir) @list='$(%DIR%_PYTHON)'; dlist=''; for p in $$list; do\ if test -f $(srcdir)/$$p; then \ -## Compute basename of source file. We want to install 'python/foo.py' -## as '$(DESTDIR)$(%DIR%dir)/foo.yo', not '$(DESTDIR)$(%DIR%dir)/python/foo.yo' - d=`echo "$$p" | sed -e 's,^.*/,,'`; \ +## Compute basename of source file. Unless this is a nobase_ target, we +## want to install 'python/foo.py' as '$(DESTDIR)$(%NDIR%dir)/foo.yo', +## not '$(DESTDIR)$(%NDIR%dir)/python/foo.yo'. +?BASE? d=`echo "$$p" | sed -e 's,^.*/,,'`; \ +?!BASE? d="$$p"; \ dlist="$$dlist $$d"; \ ## Don't perform translation, since script name is important. - echo " $(INSTALL_PROGRAM) $(srcdir)/$$p $(DESTDIR)$(%DIR%dir)/$$d"; \ - $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(%DIR%dir)/$$d; \ + echo " $(INSTALL_PROGRAM) $(srcdir)/$$p $(DESTDIR)$(%NDIR%dir)/$$d"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(%NDIR%dir)/$$d; \ else :; fi; \ done; \ ## Byte-compile must be done at install time, since file times are ## encoded in the actual files. - PYTHON=$(PYTHON) $(py_compile) --basedir $(DESTDIR)$(%DIR%dir) $$dlist + PYTHON=$(PYTHON) $(py_compile) --basedir $(DESTDIR)$(%NDIR%dir) $$dlist endif %?INSTALL% @@ -54,12 +56,13 @@ if %?INSTALL% uninstall-%DIR%PYTHON: @$(NORMAL_UNINSTALL) list='$(%DIR%_PYTHON)'; for p in $$list; do \ - d=`echo "$$p" | sed -e 's,^.*/,,'`; \ - rm -f $(DESTDIR)$(%DIR%dir)/$$d; \ +?BASE? d=`echo "$$p" | sed -e 's,^.*/,,'`; \ +?!BASE? d="$$p"; \ + rm -f $(DESTDIR)$(%NDIR%dir)/$$d; \ ## This is to remove the .pyc and .pyo byte compiled versions (a bit ## of a hack). - rm -f $(DESTDIR)$(%DIR%dir)/$${d}c; \ - rm -f $(DESTDIR)$(%DIR%dir)/$${d}o; \ + rm -f $(DESTDIR)$(%NDIR%dir)/$${d}c; \ + rm -f $(DESTDIR)$(%NDIR%dir)/$${d}o; \ done endif %?INSTALL% -- 2.47.2