bin: Rely only on the shebang line
[automake.git] / lib / am / lisp.am
blobae1f50da5ecefd89f20b5978713425be52003dde
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1996-2018 Free Software Foundation, Inc.
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2, or (at your option)
7 ## any later version.
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 ## GNU General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program.  If not, see <https://www.gnu.org/licenses/>.
17 if %?INSTALL%
18 include inst-vars.am
19 endif %?INSTALL%
21 ## ---------- ##
22 ## Building.  ##
23 ## ---------- ##
25 .el.elc:
26 ## We add $(builddir) and $(srcdir) to load-path, so that any '.el' files
27 ## that $< depends upon can be found (including generated ones).
28 ## We prefer files from the build directory to those from the source
29 ## directory, in true VPATH spirit.
30 ## The destination file is normally determined by appending "c" to the
31 ## input (which would erronously put it in $(srcdir) in VPATH builds),
32 ## so we override that, too.
33         if test '$(EMACS)' != no; then \
34           am__dir=. am__subdir_includes=''; \
35           case $@ in */*) \
36             am__dir=`echo '$@' | sed 's,/[^/]*$$,,'`; \
37             am__subdir_includes="-L $$am__dir -L $(srcdir)/$$am__dir"; \
38           esac; \
39 ## Emacs byte-compilation won't create this automatically, sadly.
40           test -d "$$am__dir" || $(MKDIR_P) "$$am__dir" || exit 1; \
41           $(EMACS) --batch \
42             $(AM_ELCFLAGS) $(ELCFLAGS) \
43             $$am__subdir_includes -L $(builddir) -L $(srcdir) \
44             --eval '(setq byte-compile-dest-file-function (lambda (_) "$@"))' \
45             -f batch-byte-compile '$<'; \
46         else :; fi
49 ## ------------ ##
50 ## Installing.  ##
51 ## ------------ ##
53 if %?INSTALL%
54 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
56 ?BASE?%DIR%LISP_INSTALL = $(INSTALL_DATA)
57 ?!BASE?%DIR%LISP_INSTALL = $(install_sh_DATA)
59 ?EXEC?.PHONY install-exec-am: install-%DIR%LISP
60 ?!EXEC?.PHONY install-data-am: install-%DIR%LISP
62 install-%DIR%LISP: $(%DIR%_LISP) $(ELCFILES)
63         @$(NORMAL_INSTALL)
64 ## Do not install anything if EMACS was not found.
65         @if test "$(EMACS)" != no && test -n "$(%NDIR%dir)"; then \
66 ?!BASE?   $(am__vpath_adj_setup) \
67 ## Funny invocation because Makefile variable can be empty, leading to
68 ## a syntax error in sh.
69           list='$(%DIR%_LISP)'; \
70           if test -n "$$list"; then \
71             echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
72             $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
73           fi; \
74           for p in $$list; do \
75 ## A lisp file can be in the source directory or the build directory.
76             if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
77 ?BASE?      $(am__strip_dir) \
78 ?!BASE?     $(am__vpath_adj) \
79             echo " $(%DIR%LISP_INSTALL) '$$d$$p' '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
80             $(%DIR%LISP_INSTALL) "$$d$$p" "$(DESTDIR)$(%NDIR%dir)/$$f" || exit $$?; \
81 ## Only install .elc file if it exists.
82             if test -f $${p}c; then \
83               echo " $(%DIR%LISP_INSTALL) '$${p}c' '$(DESTDIR)$(%NDIR%dir)/$${f}c'"; \
84               $(%DIR%LISP_INSTALL) "$${p}c" "$(DESTDIR)$(%NDIR%dir)/$${f}c" || exit $$?; \
85             else : ; fi; \
86           done; \
87         else : ; fi
88 endif %?INSTALL%
91 ## -------------- ##
92 ## Uninstalling.  ##
93 ## -------------- ##
95 if %?INSTALL%
96 .PHONY uninstall-am: uninstall-%DIR%LISP
97 uninstall-%DIR%LISP:
98         @$(NORMAL_UNINSTALL)
99 ## Do not uninstall anything if EMACS was not found.
100         @test "$(EMACS)" != no && test -n "$(%NDIR%dir)" || exit 0; \
101         list='$(%DIR%_LISP)'; \
102 ?BASE?  files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
103 ?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
104         files="$$files "`echo "$$files" | sed 's|$$|c|'`; \
105         dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
106 endif %?INSTALL%
109 ## ---------- ##
110 ## Cleaning.  ##
111 ## ---------- ##
113 .PHONY clean-am: clean-lisp
114 clean-lisp:
115         -rm -f $(ELCFILES)
118 ## -------------- ##
119 ## Distributing.  ##
120 ## -------------- ##
122 if %?DIST%
123 DIST_COMMON += %DISTVAR%
124 endif %?DIST%