mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 20:54:40 +08:00
bd71f0a096
darcs-hash:20061101181221-ac50b-227b2d2f6f5122c9f25c471872376884bdace13c.gz
1040 lines
31 KiB
Makefile
1040 lines
31 KiB
Makefile
#
|
|
# Copyright (C) 2005-2006 Axel Liljencrantz
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License version 2 as
|
|
# published by the Free Software Foundation.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
#
|
|
|
|
#
|
|
# @configure_input@
|
|
#
|
|
|
|
#
|
|
# Makefile for the fish shell. Can build fish and associated
|
|
# applications, install them, recalculate dependencies and also create
|
|
# binary distributions in tar.bz2, tar.gz and rpm formats.
|
|
#
|
|
|
|
#
|
|
# The fish buildprocess is quite complex. Do not stare directly into
|
|
# the Makefile. Doing so may cause nausea, dizziness and
|
|
# hallucinations.
|
|
#
|
|
|
|
|
|
#
|
|
# Programs
|
|
#
|
|
|
|
CC := @CC@
|
|
INSTALL:=@INSTALL@
|
|
|
|
|
|
#
|
|
# Installation directories
|
|
#
|
|
|
|
prefix = @prefix@
|
|
exec_prefix = @exec_prefix@
|
|
datadir = @datadir@
|
|
bindir = @bindir@
|
|
mandir = @mandir@
|
|
sysconfdir = @sysconfdir@
|
|
docdir = @docdir@
|
|
localedir = @localedir@
|
|
prefix = @prefix@
|
|
optbindirs = @optbindirs@
|
|
|
|
|
|
#
|
|
# Various flags
|
|
#
|
|
|
|
MACROS=-DLOCALEDIR=\"$(localedir)\" -DPREFIX=L\"$(prefix)\" -DDATADIR=L\"$(datadir)\" -DSYSCONFDIR=L\"$(sysconfdir)\"
|
|
CFLAGS=@CFLAGS@ $(MACROS)
|
|
CPPFLAGS=@CPPFLAGS@
|
|
LDFLAGS= @LIBS@ @LDFLAGS@
|
|
|
|
|
|
#
|
|
# Set to 1 if we have gettext
|
|
#
|
|
|
|
HAVE_GETTEXT=@HAVE_GETTEXT@
|
|
|
|
|
|
#
|
|
#Additional .c files used by common.o. These also have a corresponding
|
|
#.h file.
|
|
#
|
|
|
|
COMMON_FILES := util.c halloc.c halloc_util.c fallback.c
|
|
|
|
|
|
#
|
|
# All objects that the system needs to build fish, except main.o
|
|
#
|
|
|
|
FISH_OBJS := function.o builtin.o complete.o env.o exec.o expand.o \
|
|
highlight.o history.o kill.o parser.o proc.o reader.o sanity.o \
|
|
tokenizer.o wildcard.o wgetopt.o wutil.o input.o output.o intern.o \
|
|
env_universal.o env_universal_common.o input_common.o event.o \
|
|
signal.o io.o parse_util.o common.o screen.o path.o
|
|
|
|
|
|
#
|
|
# Additional files used by builtin.o
|
|
#
|
|
|
|
BUILTIN_FILES := builtin_help.c builtin_set.c builtin_commandline.c \
|
|
builtin_ulimit.c builtin_complete.c builtin_jobs.c
|
|
|
|
|
|
#
|
|
# All objects that the system needs to build fish_pager
|
|
#
|
|
|
|
FISH_PAGER_OBJS := fish_pager.o output.o wutil.o tokenizer.o \
|
|
input_common.o env_universal.o env_universal_common.o common.o
|
|
|
|
|
|
#
|
|
# All objects that the system needs to build fish_tests
|
|
#
|
|
|
|
FISH_TESTS_OBJS := $(FISH_OBJS) fish_tests.o
|
|
|
|
|
|
#
|
|
# All objects that the system needs to build fishd
|
|
#
|
|
|
|
FISHD_OBJS := fishd.o env_universal_common.o wutil.o \
|
|
doc_src/fishd.o common.o
|
|
|
|
|
|
#
|
|
# All objects needed to build mimedb
|
|
#
|
|
|
|
MIME_OBJS := mimedb.o xdgmimealias.o xdgmime.o xdgmimeglob.o \
|
|
xdgmimeint.o xdgmimemagic.o xdgmimeparent.o wutil.o common.o
|
|
|
|
|
|
#
|
|
# Files containing documentation for builtins.
|
|
#
|
|
|
|
BUILTIN_DOC_SRC := doc_src/source.txt doc_src/and.txt \
|
|
doc_src/begin.txt doc_src/bg.txt doc_src/bind.txt \
|
|
doc_src/block.txt doc_src/break.txt doc_src/builtin.txt \
|
|
doc_src/case.txt doc_src/cd.txt doc_src/command.txt \
|
|
doc_src/commandline.txt doc_src/complete.txt doc_src/continue.txt \
|
|
doc_src/else.txt doc_src/end.txt doc_src/eval.txt doc_src/exec.txt \
|
|
doc_src/exit.txt doc_src/fg.txt doc_src/for.txt \
|
|
doc_src/function.txt doc_src/functions.txt doc_src/if.txt \
|
|
doc_src/jobs.txt doc_src/not.txt doc_src/or.txt doc_src/random.txt \
|
|
doc_src/return.txt doc_src/read.txt doc_src/set.txt \
|
|
doc_src/status.txt doc_src/switch.txt doc_src/ulimit.txt \
|
|
doc_src/while.txt
|
|
|
|
|
|
#
|
|
# Files generated by running doxygen on the files in $(BUILTIN_DOC_SRC)
|
|
#
|
|
|
|
BUILTIN_DOC_HDR := $(BUILTIN_DOC_SRC:.txt=.doxygen)
|
|
|
|
HDR_FILES := doc_src/index.hdr doc_src/commands.hdr doc_src/design.hdr doc_src/license.hdr doc_src/faq.hdr
|
|
|
|
#
|
|
# Files containing documentation for external commands.
|
|
#
|
|
|
|
CMD_DOC_SRC := doc_src/contains.txt doc_src/count.txt doc_src/dirh.txt \
|
|
doc_src/dirs.txt doc_src/fish.txt doc_src/fish_pager.txt \
|
|
doc_src/fishd.txt doc_src/help.txt doc_src/isatty.txt \
|
|
doc_src/mimedb.txt doc_src/nextd.txt doc_src/open.txt \
|
|
doc_src/popd.txt doc_src/prevd.txt doc_src/psub.txt \
|
|
doc_src/pushd.txt doc_src/set_color.txt doc_src/trap.txt \
|
|
doc_src/type.txt doc_src/umask.txt doc_src/vared.txt
|
|
|
|
|
|
#
|
|
# Files generated by running doxygen on the files in $(CMD_DOC_SRC)
|
|
#
|
|
|
|
CMD_DOC_HDR := $(CMD_DOC_SRC:.txt=.doxygen)
|
|
|
|
|
|
#
|
|
# Files in the test directory
|
|
#
|
|
|
|
TEST_IN := $(wildcard tests/test*.in)
|
|
|
|
|
|
#
|
|
# Files that should be added to the tar archives
|
|
#
|
|
|
|
#
|
|
# Files in ./doc_src/
|
|
#
|
|
|
|
DOC_SRC_DIR_FILES := doc_src/Doxyfile.in doc_src/index.hdr \
|
|
doc_src/license.hdr doc_src/faq.hdr doc_src/design.hdr \
|
|
$(BUILTIN_DOC_SRC) $(CMD_DOC_SRC)
|
|
|
|
|
|
#
|
|
# Files in ./. There is some overlap between the variables in the
|
|
# list, so when copying these files, cp will complain that some files
|
|
# are specified more than once.
|
|
#
|
|
|
|
MAIN_DIR_FILES := Doxyfile Doxyfile.user Makefile.in configure \
|
|
configure.ac config.h.in install-sh set_color.c count.c \
|
|
key_reader.c gen_hdr.sh gen_hdr2.c $(MIME_OBJS:.o=.h) \
|
|
$(MIME_OBJS:.o=.c) $(FISH_OBJS:.o=.h) $(BUILTIN_FILES) \
|
|
$(COMMON_FILES) $(COMMON_FILES:.c=.h) $(FISH_OBJS:.o=.c) \
|
|
builtin_help.hdr fish.spec.in INSTALL README user_doc.head.html \
|
|
xsel-0.9.6.tar ChangeLog config.sub config.guess fish_tests.c \
|
|
main.c fish_pager.c fishd.c seq.in
|
|
|
|
|
|
#
|
|
# Files in ./etc/
|
|
#
|
|
|
|
ETC_DIR_FILES :=etc/config.fish.in etc/fish_inputrc
|
|
|
|
|
|
#
|
|
# Files in ./share/
|
|
#
|
|
|
|
SHARE_DIR_FILES :=share/config.fish.in share/config_interactive.fish.in
|
|
|
|
|
|
#
|
|
# Files in ./tests/
|
|
#
|
|
|
|
TESTS_DIR_FILES := $(TEST_IN) $(TEST_IN:.in=.out) $(TEST_IN:.in=.err) \
|
|
$(TEST_IN:.in=.status) tests/test.fish tests/gen_output.fish
|
|
|
|
|
|
#
|
|
# Files in ./share/completions/
|
|
#
|
|
|
|
COMPLETIONS_DIR_FILES := $(wildcard share/completions/*.fish)
|
|
|
|
|
|
#
|
|
# Files in ./share/functions/
|
|
#
|
|
|
|
FUNCTIONS_DIR_FILES := $(wildcard share/functions/*.fish)
|
|
|
|
|
|
#
|
|
# Programs to install
|
|
#
|
|
|
|
PROGRAMS:=fish set_color @XSEL@ @SEQ_FALLBACK@ mimedb count fish_pager fishd
|
|
|
|
|
|
#
|
|
# Manual pagess to install
|
|
#
|
|
|
|
MANUALS:=doc_src/builtin_doc/man/man1/fish.1 @XSEL_MAN_PATH@ \
|
|
doc_src/builtin_doc/man/man1/mimedb.1 \
|
|
doc_src/builtin_doc/man/man1/set_color.1 \
|
|
doc_src/builtin_doc/man/man1/count.1 \
|
|
doc_src/builtin_doc/man/man1/fishd.1 \
|
|
doc_src/builtin_doc/man/man1/fish_pager.1
|
|
|
|
|
|
#
|
|
# All translation message catalogs
|
|
#
|
|
|
|
TRANSLATIONS_SRC := $(wildcard po/*.po)
|
|
TRANSLATIONS := $(TRANSLATIONS_SRC:.po=.gmo)
|
|
|
|
|
|
#
|
|
# Make everything needed for installing fish
|
|
#
|
|
|
|
all: $(PROGRAMS) user_doc etc/config.fish share/config.fish share/config_interactive.fish $(TRANSLATIONS)
|
|
@echo fish has now been built.
|
|
@echo Use \'make install\' to install fish.
|
|
.PHONY: all
|
|
|
|
|
|
#
|
|
# These dependencies make sure that autoconf and configure are run
|
|
# when the source code for the build configuration has changed.
|
|
#
|
|
|
|
configure: configure.ac
|
|
./config.status --recheck
|
|
|
|
Makefile: Makefile.in configure
|
|
./config.status
|
|
|
|
|
|
#
|
|
# Build fish with some debug flags specified. This is GCC specific,
|
|
# and should only be used when debuging fish.
|
|
#
|
|
|
|
debug:
|
|
make fish CFLAGS="@CFLAGS@ $(MACROS) -O0 -Wno-unused -Werror -g"
|
|
.PHONY: debug
|
|
|
|
|
|
#
|
|
# User documentation, describing the features of the fish shell.
|
|
#
|
|
|
|
user_doc: $(HDR_FILES) Doxyfile.user user_doc.head.html $(CMD_DOC_SRC) $(BUILTIN_DOC_SRC)
|
|
$(MAKE) doc.h # Depend on the sources (*.hdr) and manually make the intermediate as needed
|
|
doxygen Doxyfile.user
|
|
touch user_doc
|
|
|
|
|
|
#
|
|
# Source code documentation. Also includes user documentation.
|
|
#
|
|
|
|
doc: *.h *.c doc.h Doxyfile builtin_help.c
|
|
doxygen;
|
|
|
|
|
|
#
|
|
# PDF version of the source code documentation.
|
|
#
|
|
|
|
doc/refman.pdf: doc
|
|
cd doc/latex;
|
|
make;
|
|
mv refman.pdf ..;
|
|
cd ../..;
|
|
rm -r doc/latex;
|
|
|
|
|
|
#
|
|
# This target runs both the low level code tests and the high level script tests.
|
|
#
|
|
|
|
test: $(PROGRAMS) fish_tests
|
|
./fish_tests; cd tests; ../fish <test.fish;
|
|
.PHONY: test
|
|
|
|
|
|
#
|
|
# Build the xsel program, which is maintained in its own tarball
|
|
#
|
|
|
|
xsel-0.9.6:
|
|
tar -xf xsel-0.9.6.tar
|
|
|
|
xsel-0.9.6/xsel: xsel-0.9.6
|
|
cd xsel-0.9.6; ./configure; make
|
|
|
|
|
|
#
|
|
# commands.hdr collects documentation on all commands, functions and
|
|
# builtins
|
|
#
|
|
|
|
doc_src/commands.hdr:$(BUILTIN_DOC_SRC) $(CMD_DOC_SRC)
|
|
rm -f commands.tmp;
|
|
echo "/** \page commands Commands" >>commands.tmp;
|
|
echo "Fish ships with a large number of builtin commands, shellscript functions and external commandss. These are all described below. " >>commands.tmp;
|
|
for i in `printf "%s\n" $(BUILTIN_DOC_SRC) $(CMD_DOC_SRC)|sort`; do \
|
|
echo "<hr>" >>commands.tmp; \
|
|
cat $$i >>commands.tmp; \
|
|
echo >>commands.tmp; \
|
|
echo >>commands.tmp; \
|
|
echo "Back to <a href='index.html#toc-commands'>index</a>". >>commands.tmp; \
|
|
done
|
|
echo "*/" >>commands.tmp
|
|
mv commands.tmp doc_src/commands.hdr
|
|
|
|
|
|
#
|
|
# doc.h is a compilation of the various snipptes of text used both for
|
|
# the user documentation and for internal help functions into a single
|
|
# file that can be parsed dy Doxygen to generate the user
|
|
# documentation.
|
|
#
|
|
|
|
doc.h:$(HDR_FILES)
|
|
rm -f doc.h
|
|
echo "/** \mainpage Fish user documentation" >doc.tmp
|
|
echo "\section toc Table of contents" >>doc.tmp
|
|
echo '- <a href="index.html" name="toc-index">Fish user documentation</a>' >>doc.tmp
|
|
for i in $(HDR_FILES); do\
|
|
sed <$$i >>doc.tmp -n \
|
|
-e 's,.*\\page *\([^ ]*\) *\(.*\)$$,- <a href="'`basename $$i .hdr`'.html" name="toc-'`basename $$i .hdr`'">\2</a>,p' \
|
|
-e 's,.*\\section *\([^ ]*\) *\(.*\)$$, - <a href="'`basename $$i .hdr`'.html#\1" name="toc-'`basename $$i .hdr`'">\2</a>,p'; \
|
|
done
|
|
cat $(HDR_FILES) >>doc.tmp;
|
|
mv doc.tmp doc.h
|
|
|
|
|
|
#
|
|
# This rule creates complete doxygen headers from each of the various
|
|
# snipptes of text used both for the user documentation and for
|
|
# internal help functions, that can be parsed to Doxygen to generate
|
|
# the internal help function text.
|
|
#
|
|
|
|
%.doxygen:%.txt
|
|
echo "/** \page " `basename $*` >$@;
|
|
cat $*.txt >>$@;
|
|
echo "*/" >>$@
|
|
|
|
%: %.in Makefile
|
|
sed <$@.in >$@ -e "s,@sysconfdir\@,$(sysconfdir),g" -e "s,@datadir\@,$(datadir),g" -e "s,@docdir\@,$(docdir),g" -e "s|@configure_input\@|$@, generated from $@.in by the Makefile. DO NOT MANUALLY EDIT THIS FILE!|g" -e "s,@prefix\@,$(prefix),g" -e "s,@optbindirs\@,$(optbindirs),g"
|
|
#-e "s,@\@,$(),"
|
|
|
|
|
|
#
|
|
# Compile translation files to binary format
|
|
#
|
|
|
|
%.gmo:
|
|
if test $(HAVE_GETTEXT) = 1; then \
|
|
msgfmt -o $*.gmo $*.po; \
|
|
fi
|
|
|
|
|
|
#
|
|
# Update existing po file or copy messages.pot
|
|
#
|
|
|
|
%.po:messages.pot
|
|
if test $(HAVE_GETTEXT) = 1;then \
|
|
if test -f $*.po; then \
|
|
msgmerge -U --backup=existing $*.po messages.pot;\
|
|
else \
|
|
cp messages.pot $*.po;\
|
|
fi; \
|
|
fi
|
|
|
|
|
|
#
|
|
# Create a template translation object
|
|
#
|
|
|
|
messages.pot: *.c *.h etc/*.in share/fish share/completions/*.fish share/functions/*.fish seq
|
|
if test $(HAVE_GETTEXT) = 1;then \
|
|
xgettext -k_ -kN_ *.c *.h -o messages.pot; \
|
|
if xgettext -j -k_ -kN_ -LShell etc/*.in share/fish share/completions/*.fish share/functions/*.fish seq -o messages.pot; then true; else \
|
|
echo "Your xgettext version is too old to build the messages.pot file"\
|
|
rm messages.pot\
|
|
false;\
|
|
fi; \
|
|
fi
|
|
|
|
builtin.o: $(BUILTIN_FILES)
|
|
|
|
common.o: $(COMMON_FILES)
|
|
|
|
|
|
#
|
|
# Generate the internal help functions by making doxygen create
|
|
# man-pages which are then converted into C code. The convertion path
|
|
# looks like this:
|
|
#
|
|
# .txt file
|
|
# ||
|
|
# (make)
|
|
# ||
|
|
# \/
|
|
# .doxygen file
|
|
# ||
|
|
# (doxygen)
|
|
# ||
|
|
# \/
|
|
# man file
|
|
# ||
|
|
# (man)
|
|
# ||
|
|
# \/
|
|
# formated text
|
|
# with escape
|
|
# sequences
|
|
# ||
|
|
# \/
|
|
# (gen_hdr2)
|
|
# ||
|
|
# \/
|
|
# .c file
|
|
#
|
|
# Which is an awful, clunky and ugly way of producing
|
|
# documentation. There ought to be something simpler.
|
|
#
|
|
|
|
doc_src/builtin_doc: $(BUILTIN_DOC_SRC) doc_src/count.txt builtin_help.hdr $(CMD_DOC_SRC)
|
|
for i in $(BUILTIN_DOC_SRC) $(CMD_DOC_SRC); do \
|
|
FILE=doc_src/`basename $$i .txt`.doxygen; \
|
|
echo "/** \page" `basename $$i .txt` >$$FILE; \
|
|
cat $$i >>$$FILE; \
|
|
echo "*/" >>$$FILE; \
|
|
done
|
|
cd doc_src; doxygen; cd ..;
|
|
for i in doc_src/builtin_doc/man/man1/*.1; do \
|
|
CMD_NAME=`basename $$i .1`; \
|
|
sed -e "s/\(.\)\\.SH/\1/" -e "s/$$CMD_NAME *\\\\- *\"\(.*\)\"/\1/" <$$i >$$i.tmp; \
|
|
mv $$i.tmp $$i; \
|
|
done
|
|
touch doc_src/builtin_doc
|
|
|
|
builtin_help.c: doc_src/builtin_doc gen_hdr.sh
|
|
$(MAKE) gen_hdr2 # Don't depend on gen_hdr2, because then we would need to rebuild the docs whenever we use a fresh tarball
|
|
cp builtin_help.hdr builtin_help.c;
|
|
if test -x gen_hdr.sh; then true; else chmod 755 gen_hdr.sh; fi
|
|
for i in $(BUILTIN_DOC_HDR) doc_src/count.doxygen ; do \
|
|
echo ' hash_put( &tbl, L"'`basename $$i .doxygen`'",' >>$@; \
|
|
./gen_hdr.sh $$i >>$@; \
|
|
printf " );\n\n" >>$@; \
|
|
done;
|
|
echo "}" >>builtin_help.c
|
|
|
|
|
|
#
|
|
# Generate help texts for external fish commands, like set_color and
|
|
# mimedb.
|
|
#
|
|
|
|
%.c : %.doxygen
|
|
$(MAKE) gen_hdr2 builtin_help.c # These should really be filed as dependencis for %.c above instead, but that seems to confuse make
|
|
echo "// This file was automatically generated, do not edit" >$@
|
|
echo "#include <stdlib.h>" >>$@
|
|
echo "#include <stdio.h>" >>$@
|
|
echo >>$@
|
|
echo "void print_help()" >>$@
|
|
echo "{" >>$@
|
|
echo ' printf( "%s",' >>$@
|
|
chmod 755 gen_hdr.sh
|
|
./gen_hdr.sh $*.doxygen >>$@
|
|
echo ");" >>$@
|
|
echo "}" >>$@
|
|
|
|
#
|
|
# The build rules for installing/uninstalling fish
|
|
#
|
|
|
|
#
|
|
# Check for an incompatible installed fish version, and fail with an
|
|
# error if found
|
|
#
|
|
|
|
check-uninstall:
|
|
if test -f $(DESTDIR)$(sysconfdir)/fish.d/fish_function.fish -o -f $(DESTDIR)$(sysconfdir)/fish.d/fish_complete.fish; then \
|
|
echo;\
|
|
echo ERROR;\
|
|
echo;\
|
|
echo An older fish installation using an incompatible filesystem hierarchy was detected;\
|
|
echo You must uninstall this fish version before proceeding;\
|
|
echo type \'make uninstall-legacy\' to uninstall these files,;\
|
|
echo or type \'make force-install\' to force installation.;\
|
|
echo The latter may result in a broken installation.;\
|
|
echo;\
|
|
false;\
|
|
fi;
|
|
if test -f $(DESTDIR)$(sysconfdir)/fish; then \
|
|
echo;\
|
|
echo ERROR;\
|
|
echo;\
|
|
echo An older fish installation using an incompatible filesystem hierarchy was detected;\
|
|
echo You must remove the file $(DESTDIR)$(sysconfdir)/fish before proceeding;\
|
|
echo type \'make uninstall-legacy\' to uninstall this file,;\
|
|
echo or remove it manually using \'rm $(DESTDIR)$(sysconfdir)/fish\'.;\
|
|
echo;\
|
|
false;\
|
|
fi;
|
|
.PHONY: check-uninstall
|
|
|
|
|
|
#
|
|
# This check makes sure that the install-sh script is executable. The
|
|
# darcs repo doesn't preserve the executable bit, so this needs to be
|
|
# run after checkout.
|
|
#
|
|
|
|
install-sh:
|
|
if test -x install-sh; then true; else chmod 755 install-sh; fi
|
|
.PHONY: install-sh
|
|
|
|
|
|
#
|
|
# Try to install after checking for incompatible installed versions.
|
|
#
|
|
|
|
install: all install-sh check-uninstall install-force
|
|
.PHONY: install
|
|
|
|
|
|
#
|
|
# Force installation, even in presense of incompatible previous
|
|
# version. This may fail.
|
|
#
|
|
|
|
install-force: all install-translations
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
|
|
for i in $(PROGRAMS); do\
|
|
$(INSTALL) -m 755 $$i $(DESTDIR)$(bindir) ; \
|
|
done;
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/completions
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/functions
|
|
$(INSTALL) -m 644 etc/config.fish $(DESTDIR)$(sysconfdir)/fish/
|
|
$(INSTALL) -m 644 share/config.fish $(DESTDIR)$(datadir)/fish/
|
|
$(INSTALL) -m 644 share/config_interactive.fish $(DESTDIR)$(datadir)/fish/
|
|
for i in $(COMPLETIONS_DIR_FILES); do \
|
|
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/completions/; \
|
|
done;
|
|
for i in $(FUNCTIONS_DIR_FILES); do \
|
|
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/functions/; \
|
|
done;
|
|
$(INSTALL) -m 644 etc/fish_inputrc $(DESTDIR)$(sysconfdir)/fish/fish_inputrc;
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
|
|
for i in user_doc/html/* ChangeLog; do \
|
|
if test -f $$i; then \
|
|
$(INSTALL) -m 644 $$i $(DESTDIR)$(docdir); \
|
|
fi; \
|
|
done;
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
|
|
for i in $(MANUALS); do \
|
|
$(INSTALL) -m 644 $$i $(DESTDIR)$(mandir)/man1/; \
|
|
done;
|
|
@echo fish is now installed on your system.
|
|
@echo To run fish, type \'fish\' in your terminal.
|
|
@echo
|
|
@echo To use fish as your login shell:
|
|
@echo \* add the line \'$(DESTDIR)$(bindir)/fish\' to the file \'/etc/shells\'.
|
|
@echo \* use the command \'chsh -s $(DESTDIR)$(bindir)/fish\'.
|
|
@echo
|
|
@echo Have fun!
|
|
.PHONY: install-force
|
|
|
|
|
|
#
|
|
# Uninstall this fish version
|
|
#
|
|
|
|
uninstall: uninstall-translations
|
|
-for i in $(PROGRAMS); do \
|
|
rm -f $(DESTDIR)$(bindir)/$$i; \
|
|
done;
|
|
-rm -f $(DESTDIR)$(bindir)/xsel
|
|
-rm -f $(DESTDIR)$(sysconfdir)/fish/config.fish
|
|
-rm -f $(DESTDIR)$(sysconfdir)/fish/fish_inputrc
|
|
-rmdir $(DESTDIR)$(sysconfdir)/fish
|
|
-if test -d $(DESTDIR)$(datadir)/fish; then \
|
|
rm -r $(DESTDIR)$(datadir)/fish; \
|
|
fi
|
|
-if test -d $(DESTDIR)$(docdir); then \
|
|
rm -r $(DESTDIR)$(docdir);\
|
|
fi
|
|
-for i in $(MANUALS); do \
|
|
rm -f $(DESTDIR)$(mandir)/man1/`basename $$i`*; \
|
|
done;
|
|
.PHONY: uninstall
|
|
|
|
|
|
#
|
|
# Uninstall an older fish release. This is not the default uninstall
|
|
# since there is a slight chance that it removes a file put in place by
|
|
# the sysadmin. But if 'make install' detects a file confligt, it
|
|
# suggests using this target.
|
|
#
|
|
|
|
uninstall-legacy: uninstall
|
|
-rm -f $(DESTDIR)$(sysconfdir)/fish.d/fish_interactive.fish
|
|
-rm -f $(DESTDIR)$(sysconfdir)/fish.d/fish_complete.fish
|
|
-rm -f $(DESTDIR)$(sysconfdir)/fish.d/fish_function.fish
|
|
-if test -d $(DESTDIR)$(sysconfdir)/fish.d/completions; then \
|
|
for i in $(COMPLETIONS_DIR_FILES); do \
|
|
basename=`basename $$i`; \
|
|
if test -f $(DESTDIR)$(sysconfdir)/fish.d/completions/$$basename; then \
|
|
rm $(DESTDIR)$(sysconfdir)/fish.d/completions/$$basename; \
|
|
fi; \
|
|
done; \
|
|
fi;
|
|
-rmdir $(DESTDIR)$(sysconfdir)/fish.d/completions
|
|
-rmdir $(DESTDIR)$(sysconfdir)/fish.d
|
|
-rm $(DESTDIR)$(sysconfdir)/fish
|
|
@echo The previous fish installation has been removed.
|
|
.PHONY: uninstall-legacy
|
|
|
|
install-translations: $(TRANSLATIONS)
|
|
if test $(HAVE_GETTEXT) = 1; then \
|
|
for i in $(TRANSLATIONS); do \
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/locale/`basename $$i .gmo`/LC_MESSAGES; \
|
|
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/locale/`basename $$i .gmo`/LC_MESSAGES/fish.mo; \
|
|
echo $(DESTDIR)$(datadir)/locale/`basename $$i .gmo`/LC_MESSAGES/fish.mo;\
|
|
done; \
|
|
fi;
|
|
.PHONY: install-translations
|
|
|
|
uninstall-translations:
|
|
if test $(HAVE_GETTEXT) = 1; then \
|
|
for i in $(TRANSLATIONS_SRC); do \
|
|
rm -f $(DESTDIR)$(datadir)/locale/*/LC_MESSAGES/fish.mo; \
|
|
done; \
|
|
fi
|
|
.PHONY: uninstall-translations
|
|
|
|
|
|
#
|
|
# The build rules for all the commands
|
|
#
|
|
|
|
#
|
|
# Build the fish program.
|
|
#
|
|
|
|
fish: $(FISH_OBJS) main.o
|
|
$(CC) $(FISH_OBJS) main.o $(LDFLAGS) -o $@
|
|
|
|
|
|
#
|
|
# Build the fish_pager program.
|
|
#
|
|
|
|
fish_pager: $(FISH_PAGER_OBJS)
|
|
$(CC) $(FISH_PAGER_OBJS) $(LDFLAGS) -o $@
|
|
|
|
|
|
#
|
|
# Build the fishd program.
|
|
#
|
|
|
|
fishd: $(FISHD_OBJS)
|
|
$(CC) $(FISHD_OBJS) $(LDFLAGS) -o $@
|
|
|
|
|
|
#
|
|
# Build the fish_tests program.
|
|
#
|
|
|
|
fish_tests: $(FISH_TESTS_OBJS)
|
|
$(CC) $(FISH_TESTS_OBJS) $(LDFLAGS) -o $@
|
|
|
|
|
|
#
|
|
# Build the mimedb program.
|
|
#
|
|
# mimedb does not need any libraries, so we don't use LDFLAGS here.
|
|
#
|
|
|
|
mimedb: $(MIME_OBJS) doc_src/mimedb.o
|
|
$(CC) $(MIME_OBJS) doc_src/mimedb.o $(LDFLAGS) -o $@
|
|
|
|
|
|
#
|
|
# Build the count program.
|
|
#
|
|
# count does not need any libraries, so we don't use LDFLAGS here.
|
|
#
|
|
|
|
count: count.o
|
|
$(CC) count.o -o $@
|
|
|
|
|
|
#
|
|
# Build the set_color program
|
|
#
|
|
|
|
set_color: set_color.o doc_src/set_color.o common.o
|
|
$(CC) set_color.o doc_src/set_color.o common.o wutil.o $(LDFLAGS) -o $@
|
|
|
|
|
|
#
|
|
# Test program for the tokenizer library
|
|
#
|
|
|
|
tokenizer_test: tokenizer.c tokenizer.h wutil.o common.o
|
|
$(CC) $(CFLAGS) tokenizer.c wutil.o common.o -D TOKENIZER_TEST $(LDFLAGS) -o $@
|
|
|
|
|
|
#
|
|
# Neat little program to show output from terminal
|
|
#
|
|
|
|
key_reader: key_reader.o input_common.o common.o env_universal.o env_universal_common.o wutil.o
|
|
$(CC) key_reader.o input_common.o common.o env_universal.o env_universal_common.o wutil.o $(LDFLAGS) -o $@
|
|
|
|
|
|
#
|
|
# Update dependencies
|
|
#
|
|
depend:
|
|
makedepend -fMakefile.in -Y *.c
|
|
./config.status
|
|
.PHONY: depend
|
|
|
|
|
|
#
|
|
# Copy all the source files into a new directory and use tar to create
|
|
# an archive from it. Simplest way I could think of to make an archive
|
|
# witout backups, autogenerated files, etc.
|
|
#
|
|
# Uses install instead of mkdir so build won't fail if the directory
|
|
# exists
|
|
#
|
|
|
|
fish-@PACKAGE_VERSION@.tar: $(DOC_SRC_DIR_FILES) $(MAIN_DIR_FILES) $(ETC_DIR_FILES) $(TEST_DIR_FILES) $(SHARE_DIR_FILES) $(FUNCTIONS_DIR_FILES) $(COMPLETIONS_DIR_FILES) ChangeLog user_doc doc_src/builtin_doc
|
|
rm -rf fish-@PACKAGE_VERSION@
|
|
$(INSTALL) -d fish-@PACKAGE_VERSION@
|
|
$(INSTALL) -d fish-@PACKAGE_VERSION@/doc_src
|
|
$(INSTALL) -d fish-@PACKAGE_VERSION@/user_doc
|
|
$(INSTALL) -d fish-@PACKAGE_VERSION@/etc
|
|
$(INSTALL) -d fish-@PACKAGE_VERSION@/share
|
|
$(INSTALL) -d fish-@PACKAGE_VERSION@/share/completions
|
|
$(INSTALL) -d fish-@PACKAGE_VERSION@/share/functions
|
|
$(INSTALL) -d fish-@PACKAGE_VERSION@/tests
|
|
$(INSTALL) -d fish-@PACKAGE_VERSION@/po
|
|
cp -f $(DOC_SRC_DIR_FILES) fish-@PACKAGE_VERSION@/doc_src
|
|
cp -f $(MAIN_DIR_FILES) fish-@PACKAGE_VERSION@/
|
|
cp -f $(ETC_DIR_FILES) fish-@PACKAGE_VERSION@/etc/
|
|
cp -f $(SHARE_DIR_FILES) fish-@PACKAGE_VERSION@/share/
|
|
cp -f $(COMPLETIONS_DIR_FILES) fish-@PACKAGE_VERSION@/share/completions/
|
|
cp -f $(FUNCTIONS_DIR_FILES) fish-@PACKAGE_VERSION@/share/functions/
|
|
cp -f $(TESTS_DIR_FILES) fish-@PACKAGE_VERSION@/tests/
|
|
cp -f $(TRANSLATIONS_SRC) fish-@PACKAGE_VERSION@/po/
|
|
cp -rf user_doc fish-@PACKAGE_VERSION@/
|
|
cp -rf doc_src/builtin_doc fish-@PACKAGE_VERSION@/doc_src/
|
|
tar -c fish-@PACKAGE_VERSION@ >fish-@PACKAGE_VERSION@.tar
|
|
rm -rf fish-@PACKAGE_VERSION@
|
|
|
|
|
|
#
|
|
# Just an alias for fish-@PACKAGE_VERSION@.tar
|
|
#
|
|
|
|
tar: fish-@PACKAGE_VERSION@.tar
|
|
.PHONY: tar
|
|
|
|
|
|
#
|
|
# Make compressed tar archives
|
|
#
|
|
|
|
fish-@PACKAGE_VERSION@.tar.gz: fish-@PACKAGE_VERSION@.tar
|
|
gzip -f --best -c fish-@PACKAGE_VERSION@.tar >fish-@PACKAGE_VERSION@.tar.gz
|
|
|
|
fish-@PACKAGE_VERSION@.tar.bz2: fish-@PACKAGE_VERSION@.tar
|
|
bzip2 -f --best -k fish-@PACKAGE_VERSION@.tar
|
|
|
|
dist: fish-@PACKAGE_VERSION@.tar.bz2
|
|
.PHONY: dist
|
|
|
|
#
|
|
# Build the RPM spec file.
|
|
#
|
|
|
|
fish.spec: fish.spec.in
|
|
./config.status
|
|
|
|
|
|
#
|
|
# Create .rpm file for the current systems architecture and an
|
|
# .src.rpm file.
|
|
#
|
|
|
|
rpm: fish-@PACKAGE_VERSION@.tar.bz2 fish.spec
|
|
@if which rpmbuild; then true; else \
|
|
echo Could not find the rpmbuild command, needed to build an rpm; \
|
|
echo You may be able to install it using the following command:; \
|
|
echo \'yum install rpm-build\'; \
|
|
false; \
|
|
fi
|
|
cp fish.spec /usr/src/redhat/SPECS/
|
|
cp fish-@PACKAGE_VERSION@.tar.bz2 /usr/src/redhat/SOURCES/
|
|
rpmbuild -ba --clean /usr/src/redhat/SPECS/fish.spec
|
|
mv /usr/src/redhat/RPMS/*/fish*@PACKAGE_VERSION@*.rpm .
|
|
mv /usr/src/redhat/SRPMS/fish*@PACKAGE_VERSION@*.src.rpm .
|
|
.PHONY: rpm
|
|
|
|
|
|
#
|
|
# Cleanup targets
|
|
#
|
|
|
|
#
|
|
# distclean should restore the tree to the state right after extracting a tarball.
|
|
#
|
|
|
|
distclean: clean
|
|
rm -f fish.spec doc_src/Doxyfile
|
|
rm -f etc/config.fish share/config_interactive.fish seq share/config.fish
|
|
rm -f config.status config.log config.h Makefile
|
|
.PHONY: distclean
|
|
|
|
|
|
#
|
|
# clean removes everything built by the makefile, but not things that
|
|
# are created by the configure script.
|
|
#
|
|
|
|
clean:
|
|
rm -f *.o doc.h doc.tmp doc_src/*.doxygen doc_src/*.c doc_src/*.o doc_src/commands.hdr
|
|
rm -f tests/tmp.err tests/tmp.out tests/tmp.status tests/foo.txt
|
|
rm -f tokenizer_test fish key_reader set_color gen_hdr2 mimedb
|
|
rm -f fishd fish_pager count fish_tests
|
|
rm -f fish-@PACKAGE_VERSION@.tar
|
|
rm -f fish-@PACKAGE_VERSION@.tar.gz
|
|
rm -f fish-@PACKAGE_VERSION@.tar.bz2
|
|
rm -rf doc;
|
|
rm -rf fish-@PACKAGE_VERSION@
|
|
rm -rf xsel-0.9.6/
|
|
rm -f $(TRANSLATIONS)
|
|
.PHONY: clean
|
|
|
|
|
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
|
|
|
builtin.o: config.h fallback.h util.h wutil.h builtin.h function.h complete.h
|
|
builtin.o: proc.h io.h parser.h event.h reader.h env.h common.h wgetopt.h
|
|
builtin.o: sanity.h tokenizer.h wildcard.h input_common.h input.h intern.h
|
|
builtin.o: signal.h halloc.h halloc_util.h parse_util.h expand.h path.h
|
|
builtin.o: builtin_help.c builtin_set.c builtin_commandline.c
|
|
builtin.o: builtin_complete.c builtin_ulimit.c builtin_jobs.c
|
|
builtin_commandline.o: config.h signal.h fallback.h util.h wutil.h builtin.h
|
|
builtin_commandline.o: common.h wgetopt.h reader.h proc.h io.h parser.h
|
|
builtin_commandline.o: event.h tokenizer.h input_common.h input.h
|
|
builtin_commandline.o: parse_util.h
|
|
builtin_complete.o: config.h signal.h fallback.h util.h wutil.h builtin.h
|
|
builtin_complete.o: common.h complete.h wgetopt.h parser.h proc.h io.h
|
|
builtin_complete.o: event.h reader.h
|
|
builtin_help.o: config.h util.h common.h halloc_util.h
|
|
builtin_jobs.o: config.h fallback.h util.h wutil.h builtin.h proc.h io.h
|
|
builtin_jobs.o: parser.h event.h common.h wgetopt.h
|
|
builtin_set.o: config.h signal.h fallback.h util.h wutil.h builtin.h env.h
|
|
builtin_set.o: expand.h common.h wgetopt.h proc.h io.h parser.h event.h
|
|
builtin_ulimit.o: config.h fallback.h util.h builtin.h common.h wgetopt.h
|
|
common.o: config.h fallback.h util.h wutil.h common.h expand.h proc.h io.h
|
|
common.o: wildcard.h parser.h event.h util.c halloc.c halloc.h halloc_util.c
|
|
common.o: fallback.c
|
|
complete.o: config.h signal.h fallback.h util.h tokenizer.h wildcard.h proc.h
|
|
complete.o: io.h parser.h event.h function.h complete.h builtin.h env.h
|
|
complete.o: exec.h expand.h common.h reader.h history.h intern.h parse_util.h
|
|
complete.o: halloc.h halloc_util.h wutil.h path.h
|
|
count.o: config.h
|
|
env.o: config.h signal.h fallback.h util.h wutil.h proc.h io.h common.h env.h
|
|
env.o: sanity.h expand.h history.h reader.h parser.h event.h env_universal.h
|
|
env.o: env_universal_common.h input_common.h complete.h
|
|
env_universal.o: config.h signal.h fallback.h util.h common.h wutil.h
|
|
env_universal.o: env_universal_common.h env_universal.h
|
|
env_universal_common.o: config.h signal.h fallback.h util.h common.h wutil.h
|
|
env_universal_common.o: env_universal_common.h
|
|
event.o: config.h signal.h fallback.h util.h wutil.h function.h proc.h io.h
|
|
event.o: parser.h event.h common.h halloc_util.h
|
|
exec.o: config.h signal.h fallback.h util.h common.h wutil.h proc.h io.h
|
|
exec.o: exec.h parser.h event.h builtin.h function.h env.h wildcard.h
|
|
exec.o: sanity.h expand.h env_universal.h env_universal_common.h halloc.h
|
|
exec.o: halloc_util.h parse_util.h
|
|
expand.o: config.h signal.h fallback.h util.h common.h wutil.h env.h proc.h
|
|
expand.o: io.h parser.h event.h expand.h wildcard.h exec.h tokenizer.h
|
|
expand.o: complete.h parse_util.h halloc.h halloc_util.h
|
|
fallback.o: config.h fallback.h util.h
|
|
fishd.o: config.h signal.h fallback.h util.h common.h wutil.h
|
|
fishd.o: env_universal_common.h halloc.h halloc_util.h path.h
|
|
fish_pager.o: config.h signal.h fallback.h util.h wutil.h common.h complete.h
|
|
fish_pager.o: output.h input_common.h env_universal.h env_universal_common.h
|
|
fish_pager.o: halloc.h halloc_util.h
|
|
fish_tests.o: config.h signal.h fallback.h util.h common.h proc.h io.h
|
|
fish_tests.o: reader.h builtin.h function.h complete.h wutil.h env.h expand.h
|
|
fish_tests.o: parser.h event.h tokenizer.h output.h exec.h halloc_util.h
|
|
function.o: config.h signal.h wutil.h fallback.h util.h function.h proc.h
|
|
function.o: io.h parser.h event.h common.h intern.h reader.h parse_util.h
|
|
function.o: env.h expand.h
|
|
halloc.o: config.h fallback.h util.h common.h halloc.h
|
|
halloc_util.o: config.h fallback.h util.h common.h halloc.h
|
|
highlight.o: config.h signal.h fallback.h util.h wutil.h highlight.h
|
|
highlight.o: tokenizer.h proc.h io.h parser.h event.h parse_util.h builtin.h
|
|
highlight.o: function.h env.h expand.h sanity.h common.h complete.h output.h
|
|
highlight.o: halloc.h halloc_util.h wildcard.h path.h
|
|
history2.o: config.h fallback.h util.h wutil.h history.h common.h halloc.h
|
|
history2.o: halloc_util.h intern.h path.h
|
|
history.o: config.h fallback.h util.h wutil.h history.h common.h halloc.h
|
|
history.o: halloc_util.h intern.h path.h signal.h
|
|
input.o: config.h signal.h fallback.h util.h wutil.h reader.h proc.h io.h
|
|
input.o: common.h sanity.h input_common.h input.h parser.h event.h env.h
|
|
input.o: expand.h output.h intern.h
|
|
input_common.o: config.h fallback.h util.h common.h wutil.h input_common.h
|
|
input_common.o: env_universal.h env_universal_common.h
|
|
intern.o: config.h fallback.h util.h wutil.h common.h intern.h
|
|
io.o: config.h fallback.h util.h wutil.h exec.h proc.h io.h common.h halloc.h
|
|
key_reader.o: config.h fallback.h input_common.h
|
|
kill.o: config.h signal.h fallback.h util.h wutil.h kill.h proc.h io.h
|
|
kill.o: sanity.h common.h env.h exec.h halloc.h path.h
|
|
main.o: config.h signal.h fallback.h util.h common.h reader.h builtin.h
|
|
main.o: function.h complete.h wutil.h env.h sanity.h proc.h io.h parser.h
|
|
main.o: event.h expand.h intern.h exec.h output.h halloc.h halloc_util.h
|
|
main.o: history.h path.h
|
|
mimedb.o: config.h xdgmime.h fallback.h util.h
|
|
output.o: config.h signal.h fallback.h util.h wutil.h expand.h common.h
|
|
output.o: output.h halloc_util.h highlight.h
|
|
parser.o: config.h signal.h fallback.h util.h common.h wutil.h proc.h io.h
|
|
parser.o: parser.h event.h tokenizer.h exec.h wildcard.h function.h builtin.h
|
|
parser.o: env.h expand.h reader.h sanity.h env_universal.h
|
|
parser.o: env_universal_common.h intern.h parse_util.h halloc.h halloc_util.h
|
|
parser.o: path.h
|
|
parse_util.o: config.h fallback.h util.h wutil.h common.h tokenizer.h
|
|
parse_util.o: parse_util.h expand.h intern.h exec.h proc.h io.h env.h
|
|
parse_util.o: wildcard.h halloc_util.h
|
|
path.o: config.h fallback.h util.h common.h env.h wutil.h halloc.h
|
|
path.o: halloc_util.h path.h expand.h
|
|
proc.o: config.h signal.h fallback.h util.h wutil.h proc.h io.h common.h
|
|
proc.o: reader.h sanity.h env.h parser.h event.h halloc.h halloc_util.h
|
|
proc.o: output.h
|
|
reader.o: config.h signal.h fallback.h util.h wutil.h highlight.h reader.h
|
|
reader.o: proc.h io.h parser.h event.h complete.h history.h common.h sanity.h
|
|
reader.o: env.h exec.h expand.h tokenizer.h kill.h input_common.h input.h
|
|
reader.o: function.h output.h screen.h parse_util.h
|
|
sanity.o: config.h signal.h fallback.h util.h common.h sanity.h proc.h io.h
|
|
sanity.o: history.h reader.h kill.h wutil.h
|
|
screen.o: config.h fallback.h common.h util.h wutil.h output.h highlight.h
|
|
screen.o: screen.h
|
|
set_color.o: config.h fallback.h
|
|
signal.o: config.h signal.h common.h util.h fallback.h wutil.h event.h
|
|
signal.o: reader.h proc.h io.h
|
|
test.o: stringtab.h
|
|
tokenizer.o: config.h fallback.h util.h wutil.h tokenizer.h common.h
|
|
tokenizer.o: wildcard.h
|
|
util.o: config.h fallback.h util.h common.h wutil.h
|
|
wgetopt.o: config.h wgetopt.h wutil.h fallback.h
|
|
wildcard.o: config.h fallback.h util.h wutil.h complete.h common.h wildcard.h
|
|
wildcard.o: reader.h expand.h
|
|
wutil.o: config.h fallback.h util.h common.h wutil.h halloc.h halloc_util.h
|
|
xdgmimealias.o: xdgmimealias.h xdgmime.h xdgmimeint.h
|
|
xdgmime.o: xdgmime.h xdgmimeint.h xdgmimeglob.h xdgmimemagic.h xdgmimealias.h
|
|
xdgmime.o: xdgmimeparent.h
|
|
xdgmimeglob.o: xdgmimeglob.h xdgmime.h xdgmimeint.h
|
|
xdgmimeint.o: xdgmimeint.h xdgmime.h
|
|
xdgmimemagic.o: xdgmimemagic.h xdgmime.h xdgmimeint.h
|
|
xdgmimeparent.o: xdgmimeparent.h xdgmime.h xdgmimeint.h
|