2
0

Makefile.inc 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. ## Copyright (C) 1995-2017 Free Software Foundation, Inc.
  2. ##
  3. ## This program is free software; you can redistribute it and/or modify
  4. ## it under the terms of the GNU General Public License as published by
  5. ## the Free Software Foundation; either version 2, or (at your option)
  6. ## any later version.
  7. ##
  8. ## This program is distributed in the hope that it will be useful,
  9. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. ## GNU General Public License for more details.
  12. ##
  13. ## You should have received a copy of the GNU General Public License
  14. ## along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. ## ----------------------------------- ##
  16. ## The automake and aclocal scripts. ##
  17. ## ----------------------------------- ##
  18. bin_SCRIPTS = %D%/automake %D%/aclocal
  19. CLEANFILES += $(bin_SCRIPTS)
  20. # Used by maintainer checks and such.
  21. automake_in = $(srcdir)/%D%/automake.in
  22. aclocal_in = $(srcdir)/%D%/aclocal.in
  23. automake_script = %D%/automake
  24. aclocal_script = %D%/aclocal
  25. AUTOMAKESOURCES = $(automake_in) $(aclocal_in)
  26. TAGS_FILES += $(AUTOMAKESOURCES)
  27. EXTRA_DIST += $(AUTOMAKESOURCES)
  28. # Make versioned links. We only run the transform on the root name;
  29. # then we make a versioned link with the transformed base name. This
  30. # seemed like the most reasonable approach.
  31. install-exec-hook:
  32. @$(POST_INSTALL)
  33. @for p in $(bin_SCRIPTS); do \
  34. f=`echo $$p | sed -e 's,.*/,,' -e '$(transform)'`; \
  35. fv="$$f-$(APIVERSION)"; \
  36. rm -f "$(DESTDIR)$(bindir)/$$fv"; \
  37. echo " $(LN) '$(DESTDIR)$(bindir)/$$f' '$(DESTDIR)$(bindir)/$$fv'"; \
  38. $(LN) "$(DESTDIR)$(bindir)/$$f" "$(DESTDIR)$(bindir)/$$fv"; \
  39. done
  40. uninstall-hook:
  41. @for p in $(bin_SCRIPTS); do \
  42. f=`echo $$p | sed -e 's,.*/,,' -e '$(transform)'`; \
  43. fv="$$f-$(APIVERSION)"; \
  44. rm -f "$(DESTDIR)$(bindir)/$$fv"; \
  45. done
  46. # These files depend on Makefile so they are rebuilt if $(VERSION),
  47. # $(datadir) or other do_subst'ituted variables change.
  48. %D%/automake: %D%/automake.in
  49. %D%/aclocal: %D%/aclocal.in
  50. %D%/automake %D%/aclocal: Makefile %D%/gen-perl-protos
  51. $(AM_V_GEN)rm -f $@ $@-t $@-t2 \
  52. && $(MKDIR_P) $(@D) \
  53. ## Common substitutions.
  54. && in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t \
  55. ## Auto-compute prototypes of perl subroutines.
  56. && $(PERL) -w $(srcdir)/%D%/gen-perl-protos $@-t > $@-t2 \
  57. && mv -f $@-t2 $@-t \
  58. ## We can't use '$(generated_file_finalize)' here, because currently
  59. ## Automake contains occurrences of unexpanded @substitutions@ in
  60. ## comments, and that is perfectly legit.
  61. && chmod a+x,a-w $@-t && mv -f $@-t $@
  62. EXTRA_DIST += %D%/gen-perl-protos
  63. # vim: ft=automake noet