autoconf: Transformation Rules

1 
1 15.7.3 Transformation Rules
1 ---------------------------
1 
1 Here is how to use the variable `program_transform_name' in a
1 `Makefile.in':
1 
1      PROGRAMS = cp ls rm
1      transform = @program_transform_name@
1      install:
1              for p in $(PROGRAMS); do \
1                $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p | \
1                                                    sed '$(transform)'`; \
1              done
1 
1      uninstall:
1              for p in $(PROGRAMS); do \
1                rm -f $(DESTDIR)$(bindir)/`echo $$p | sed '$(transform)'`; \
1              done
1 
1    It is guaranteed that `program_transform_name' is never empty, and
1 that there are no useless separators.  Therefore you may safely embed
1 `program_transform_name' within a sed program using `;':
1 
1      transform = @program_transform_name@
1      transform_exe = s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/
1 
1    Whether to do the transformations on documentation files (Texinfo or
1 `man') is a tricky question; there seems to be no perfect answer, due
1 to the several reasons for name transforming.  Documentation is not
1 usually particular to a specific architecture, and Texinfo files do not
1 conflict with system documentation.  But they might conflict with
1 earlier versions of the same files, and `man' pages sometimes do
1 conflict with system documentation.  As a compromise, it is probably
1 best to do name transformations on `man' pages but not on Texinfo
1 manuals.
1