Make fish build more quietly. Merge PR #3248 floam/shutupmake

Makefile now omits most build output by default.

`make V=1`  for verbose output
This commit is contained in:
Aaron Gyes 2016-08-02 16:41:41 -07:00 committed by GitHub
commit 01f09cf4c1
4 changed files with 203 additions and 135 deletions

View file

@ -741,7 +741,7 @@ CITE_BIB_FILES =
# messages are off. # messages are off.
# The default value is: NO. # The default value is: NO.
QUIET = NO QUIET = YES
# The WARNINGS tag can be used to turn on/off the warning messages that are # The WARNINGS tag can be used to turn on/off the warning messages that are
# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES # generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES

View file

@ -741,7 +741,7 @@ CITE_BIB_FILES =
# messages are off. # messages are off.
# The default value is: NO. # The default value is: NO.
QUIET = NO QUIET = YES
# The WARNINGS tag can be used to turn on/off the warning messages that are # The WARNINGS tag can be used to turn on/off the warning messages that are
# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES # generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES

View file

@ -23,6 +23,13 @@
# applications, install them, and recalculate dependencies. # applications, install them, and recalculate dependencies.
# #
# Verbosity
# make V=1 causes a noisy make, V=0 is silent/quiet. If one uses (lower case v)
# $(v) as a substitute for @, it will get swapped out in the default (V=1) case
# and replced with @ in the V=0 case. You can use a bare @ for things that should
# (really) almost never print.
V := 0
# #
# This is the default value for SHELL but I like to be explicit about such # This is the default value for SHELL but I like to be explicit about such
# things. Especially in a project like fish where someone might otherwise # things. Especially in a project like fish where someone might otherwise
@ -38,7 +45,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
# #
# Programs # Programs
# #
CXX := @CXX@ CXX = ${v}@CXX@
INSTALL:=@INSTALL@ INSTALL:=@INSTALL@
SED := @SED@ SED := @SED@
@ -178,8 +185,7 @@ PROGRAMS := fish fish_indent fish_key_reader
# #
# Manual pages to install # Manual pages to install
# #
MANUALS := $(addsuffix .1, $(addprefix share/man/man1/, \ MANUALS := $(addsuffix .1, $(addprefix share/man/man1/, $(PROGRAMS)))
$(PROGRAMS)))
# #
# All translation message catalogs # All translation message catalogs
@ -202,19 +208,56 @@ else
share_man= share_man=
endif endif
#
# Functions for status output
#
TERM_COLORS := $(shell tput colors 2> /dev/null)
define echo_bold
@tput bold 2> /dev/null ||:
$(v)echo $1
@tput sgr0 2> /dev/null ||:
endef
# Assume if someone has a 256-color terminal, italic escapes won't break anything - maybe even works.
# Almost nobody has their termcaps set properly for them.
define echo_italic
@if [ ${TERM_COLORS} -ge 256 ] ; then \
echo \\033[3m$1; \
tput sgr0 2> /dev/null;\
else \
echo $1; \
fi
endef
define showvar
$(v)$(call echo_bold,"$1 = \c")
$(v)$(call echo_italic,"'$2'\c")
$(v)echo $3
endef
# #
# Make everything needed for installing fish # Make everything needed for installing fish
# #
all: $(PROGRAMS) $(user_doc) $(share_man) $(TRANSLATIONS) fish.pc share/__fish_build_paths.fish all: SHOW-VARS $(PROGRAMS) $(user_doc) $(share_man) $(TRANSLATIONS) fish.pc share/__fish_build_paths.fish
@echo fish has now been built. @echo "\nfish has now been built."
@echo Use \'$(MAKE) install\' to install fish. $(v)$(call echo_bold, "Use \`$(notdir $(MAKE)) install' to install fish.")
.PHONY: all .PHONY: all
SHOW-VARS: FORCE
@${call showvar, "prefix",$(prefix),"\t\c"}
@${call showvar, "HAVE_DOXYGEN",$(HAVE_DOXYGEN),"\t\c"}
@${call showvar, "CXX",@CXX@}
@${call showvar, "CXXFLAGS",$(CXXFLAGS)}
.PHONY: FORCE
# #
# Pull version information # Pull version information
# #
FISH-BUILD-VERSION-FILE: FORCE FISH-BUILD-VERSION-FILE: FORCE
@./build_tools/git_version_gen.sh -$(v)tput setaf 3 2> /dev/null
$(v)build_tools/git_version_gen.sh
-$(v)tput sgr0 2> /dev/null
-include FISH-BUILD-VERSION-FILE -include FISH-BUILD-VERSION-FILE
CXXFLAGS += -DFISH_BUILD_VERSION=\"$(FISH_BUILD_VERSION)\" CXXFLAGS += -DFISH_BUILD_VERSION=\"$(FISH_BUILD_VERSION)\"
.PHONY: FORCE .PHONY: FORCE
@ -225,10 +268,10 @@ obj/fish_version.o: FISH-BUILD-VERSION-FILE
# when the source code for the build configuration has changed. # when the source code for the build configuration has changed.
# #
configure: configure.ac configure: configure.ac
./config.status --recheck $(v)./config.status -q --recheck
Makefile: Makefile.in configure Makefile: Makefile.in configure
./config.status $(v)./config.status -q
# #
# Build fish with some debug flags specified. This is GCC specific, # Build fish with some debug flags specified. This is GCC specific,
@ -249,7 +292,8 @@ prof: all
# #
doc: $(HDR_FILES_SRC) Doxyfile.user $(HTML_SRC) $(HELP_SRC) doc.h \ doc: $(HDR_FILES_SRC) Doxyfile.user $(HTML_SRC) $(HELP_SRC) doc.h \
$(HDR_FILES) lexicon_filter $(HDR_FILES) lexicon_filter
(cat Doxyfile.user; echo INPUT_FILTER=./lexicon_filter; \ @echo " doxygen user_doc/html"
$(v)(cat Doxyfile.user; echo INPUT_FILTER=./lexicon_filter; \
echo PROJECT_NUMBER=$(FISH_BUILD_VERSION) | $(SED) "s/-.*//") | \ echo PROJECT_NUMBER=$(FISH_BUILD_VERSION) | $(SED) "s/-.*//") | \
doxygen - && touch user_doc; \ doxygen - && touch user_doc; \
cd user_doc/html && rm -f arrow*.png bc_s.png bdwn.png closed.png \ cd user_doc/html && rm -f arrow*.png bc_s.png bdwn.png closed.png \
@ -260,10 +304,10 @@ doc: $(HDR_FILES_SRC) Doxyfile.user $(HTML_SRC) $(HELP_SRC) doc.h \
# PDF version of the source code documentation. # PDF version of the source code documentation.
# #
doc/refman.pdf: doc doc/refman.pdf: doc
cd doc/latex && \ $(v)cd doc/latex && \
make && \ $(v)$(MAKE) V=$(V) && \
mv refman.pdf ..; $(v)mv refman.pdf ..;
rm -r doc/latex; $(v)rm -rf doc/latex;
# #
# Prep the environment for running the unit tests. When specifying DESTDIR on # Prep the environment for running the unit tests. When specifying DESTDIR on
@ -272,12 +316,12 @@ doc/refman.pdf: doc
# followed by `make install`. # followed by `make install`.
# #
test-prep: test-prep:
rm -rf test $(v)rm -rf test
mkdir test test/data test/home test/temp $(v)mkdir test test/data test/home test/temp
ifdef DESTDIR ifdef DESTDIR
ln -s $(DESTDIR) test/root $(v)ln -s $(DESTDIR) test/root
else else
mkdir test/root $(v)mkdir test/root
endif endif
.PHONY: test-prep .PHONY: test-prep
@ -290,8 +334,8 @@ endif
test: DESTDIR = $(PWD)/test/root/ test: DESTDIR = $(PWD)/test/root/
test: prefix = . test: prefix = .
test: test-prep install-force test_low_level test_high_level test: test-prep install-force test_low_level test_high_level
@rm -f /tmp/file_truncation_test.txt /tmp/tee_test.txt /tmp/fish_foo.txt $(v)rm -f /tmp/file_truncation_test.txt /tmp/tee_test.txt /tmp/fish_foo.txt
@rm -rf /tmp/is_potential_path_test $(v)rm -rf /tmp/is_potential_path_test
.PHONY: test .PHONY: test
# #
@ -333,8 +377,8 @@ test_interactive: $(call filter_up_to,test_interactive,$(active_test_goals))
# builtins # builtins
# #
doc_src/commands.hdr:$(HELP_SRC) doc_src/commands.hdr.in doc_src/commands.hdr:$(HELP_SRC) doc_src/commands.hdr.in
-rm command_list.tmp command_list_toc.tmp $@ $(v)rm -f command_list.tmp command_list_toc.tmp $@
for i in `printf "%s\n" $(HELP_SRC)|sort`; do \ $(v)for i in `printf "%s\n" $(HELP_SRC)|sort`; do \
echo "<hr>" >>command_list.tmp; \ echo "<hr>" >>command_list.tmp; \
cat $$i >>command_list.tmp; \ cat $$i >>command_list.tmp; \
echo >>command_list.tmp; \ echo >>command_list.tmp; \
@ -343,28 +387,28 @@ doc_src/commands.hdr:$(HELP_SRC) doc_src/commands.hdr.in
echo '- <a href="#'$$NAME'">'$$NAME'</a>' >> command_list_toc.tmp; \ echo '- <a href="#'$$NAME'">'$$NAME'</a>' >> command_list_toc.tmp; \
echo "Back to <a href='index.html#toc-commands'>index</a>". >>command_list.tmp; \ echo "Back to <a href='index.html#toc-commands'>index</a>". >>command_list.tmp; \
done done
mv command_list.tmp command_list.txt $(v)mv command_list.tmp command_list.txt
mv command_list_toc.tmp command_list_toc.txt $(v)mv command_list_toc.tmp command_list_toc.txt
cat $@.in | awk '{if ($$0 ~ /@command_list_toc@/) { system("cat command_list_toc.txt"); } else if ($$0 ~ /@command_list@/){ system("cat command_list.txt");} else{ print $$0;}}' >$@ $(v)cat $@.in | awk '{if ($$0 ~ /@command_list_toc@/) { system("cat command_list_toc.txt"); } else if ($$0 ~ /@command_list@/){ system("cat command_list.txt");} else{ print $$0;}}' >$@
toc.txt: $(HDR_FILES:index.hdr=index.hdr.in) toc.txt: $(HDR_FILES:index.hdr=index.hdr.in)
-rm toc.tmp $@ $(v)rm -f toc.tmp $@
# Ugly hack to set the toc initial title for the main page # Ugly hack to set the toc initial title for the main page
echo '- <a href="index.html" id="toc-index">Documentation</a>' > toc.tmp $(v)echo '- <a href="index.html" id="toc-index">Documentation</a>' > toc.tmp
# The first sed command captures the page name, followed by the description # The first sed command captures the page name, followed by the description
# The second sed command captures the command name \1 and the description \2, but only up to a dash # The second sed command captures the command name \1 and the description \2, but only up to a dash
# This is to reduce the size of the TOC in the command listing on the main page # This is to reduce the size of the TOC in the command listing on the main page
for i in $(HDR_FILES:index.hdr=index.hdr.in); do\ $(v)for i in $(HDR_FILES:index.hdr=index.hdr.in); do\
NAME=`basename $$i .hdr`; \ NAME=`basename $$i .hdr`; \
NAME=`basename $$NAME .hdr.in`; \ NAME=`basename $$NAME .hdr.in`; \
$(SED) <$$i >>toc.tmp -n \ $(SED) <$$i >>toc.tmp -n \
-e 's,.*\\page *\([^ ]*\) *\(.*\)$$,- <a href="'$$NAME'.html" id="toc-'$$NAME'">\2</a>,p' \ -e 's,.*\\page *\([^ ]*\) *\(.*\)$$,- <a href="'$$NAME'.html" id="toc-'$$NAME'">\2</a>,p' \
-e 's,.*\\section *\([^ ]*\) *\([^-]*\)\(.*\)$$, - <a href="'$$NAME'.html#\1">\2</a>,p'; \ -e 's,.*\\section *\([^ ]*\) *\([^-]*\)\(.*\)$$, - <a href="'$$NAME'.html#\1">\2</a>,p'; \
done done
mv toc.tmp $@ $(v)mv toc.tmp $@
doc_src/index.hdr: toc.txt doc_src/index.hdr.in doc_src/index.hdr: toc.txt doc_src/index.hdr.in
cat $@.in | awk '{if ($$0 ~ /@toc@/){ system("cat toc.txt");} else{ print $$0;}}' >$@ $(v)cat $@.in | awk '{if ($$0 ~ /@toc@/){ system("cat toc.txt");} else{ print $$0;}}' >$@
# #
# To enable the lexicon filter, we first need to be aware of what fish # To enable the lexicon filter, we first need to be aware of what fish
@ -376,9 +420,10 @@ doc_src/index.hdr: toc.txt doc_src/index.hdr.in
# used in a 'cli' style context. # used in a 'cli' style context.
# #
lexicon.txt: doc_src/commands.hdr $(FUNCTIONS_DIR_FILES) $(COMPLETIONS_DIR_FILES) share/functions/__fish_config_interactive.fish lexicon.txt: doc_src/commands.hdr $(FUNCTIONS_DIR_FILES) $(COMPLETIONS_DIR_FILES) share/functions/__fish_config_interactive.fish
-rm lexicon.tmp lexicon_catalog.tmp lexicon_catalog.txt $@ $(v)rm -f lexicon.tmp lexicon_catalog.tmp lexicon_catalog.txt $@
# Scan sources for commands/functions/binaries/colours. If GNU sed was portable, this could be much smarter. # Scan sources for commands/functions/binaries/colours. If GNU sed was portable, this could be much smarter.
$(SED) <command_list_toc.txt >>lexicon.tmp -n \ @echo " SED "$@
$(v)$(SED) <command_list_toc.txt >>lexicon.tmp -n \
-e "s|^.*>\([a-z][a-z_]*\)</a>|'\1'|w lexicon_catalog.tmp" \ -e "s|^.*>\([a-z][a-z_]*\)</a>|'\1'|w lexicon_catalog.tmp" \
-e "s|'\(.*\)'|bltn \1|p"; mv lexicon_catalog.tmp lexicon_catalog.txt; \ -e "s|'\(.*\)'|bltn \1|p"; mv lexicon_catalog.tmp lexicon_catalog.txt; \
printf "%s\n" $(COMPLETIONS_DIR_FILES) | $(SED) -n \ printf "%s\n" $(COMPLETIONS_DIR_FILES) | $(SED) -n \
@ -389,7 +434,7 @@ lexicon.txt: doc_src/commands.hdr $(FUNCTIONS_DIR_FILES) $(COMPLETIONS_DIR_FILES
-e "s|[^ ]*/\([a-z][a-z_-]*\).fish|'\1'|p" | fgrep -vx -f lexicon_catalog.txt | $(SED) >>lexicon.tmp -n \ -e "s|[^ ]*/\([a-z][a-z_-]*\).fish|'\1'|p" | fgrep -vx -f lexicon_catalog.txt | $(SED) >>lexicon.tmp -n \
-e 'w lexicon_catalog.tmp' \ -e 'w lexicon_catalog.tmp' \
-e "s|'\(.*\)'|func \1|p"; \ -e "s|'\(.*\)'|func \1|p"; \
$(SED) <share/functions/__fish_config_interactive.fish >>lexicon.tmp -n \ $(SED) <share/functions/__fish_config_interactive.fish >>lexicon.tmp -n \
-e '/set_default/s/.*\(fish_[a-z][a-z_]*\).*$$/clrv \1/p'; \ -e '/set_default/s/.*\(fish_[a-z][a-z_]*\).*$$/clrv \1/p'; \
$(SED) <lexicon_filter.in >>lexicon.tmp -n \ $(SED) <lexicon_filter.in >>lexicon.tmp -n \
-e '/^#.!#/s/^#.!# \(.... [a-z][a-z_]*\)/\1/p'; \ -e '/^#.!#/s/^#.!# \(.... [a-z][a-z_]*\)/\1/p'; \
@ -406,11 +451,12 @@ lexicon.txt: doc_src/commands.hdr $(FUNCTIONS_DIR_FILES) $(COMPLETIONS_DIR_FILES
# providing suitable CSS in user_doc.css.in # providing suitable CSS in user_doc.css.in
# #
lexicon_filter: lexicon.txt lexicon_filter.in lexicon_filter: lexicon.txt lexicon_filter.in
-rm $@.tmp $@ $(v)rm -f $@.tmp $@
# Set the shebang as sed can reside in multiple places. @echo " SED "$@
$(SED) <$@.in >$@.tmp -e 's|@sed@|'$(SED)'|' # Set the shebang as sed can reside in multiple places.
# Scan through the lexicon, transforming each line to something useful to Doxygen. $(v)$(SED) <$@.in >$@.tmp -e 's|@sed@|'$(SED)'|'
if echo x | $(SED) "/[[:<:]]x/d" 2>/dev/null; then \ # Scan through the lexicon, transforming each line to something useful to Doxygen.
$(v)if echo x | $(SED) "/[[:<:]]x/d" 2>/dev/null; then \
WORDBL='[[:<:]]'; WORDBR='[[:>:]]'; \ WORDBL='[[:<:]]'; WORDBR='[[:>:]]'; \
else \ else \
WORDBL='\\<'; WORDBR='\\>'; \ WORDBL='\\<'; WORDBR='\\>'; \
@ -427,7 +473,7 @@ lexicon_filter: lexicon.txt lexicon_filter.in
# documentation. # documentation.
# #
doc.h: $(HDR_FILES) doc.h: $(HDR_FILES)
cat $(HDR_FILES) >$@ $(v)cat $(HDR_FILES) >$@
# #
# This rule creates complete doxygen headers from each of the various # This rule creates complete doxygen headers from each of the various
@ -445,7 +491,7 @@ doc.h: $(HDR_FILES)
# if any of the paths change. # if any of the paths change.
# #
%: %.in Makefile FISH-BUILD-VERSION-FILE %: %.in Makefile FISH-BUILD-VERSION-FILE
$(SED) <$< >$@ \ $(v)$(SED) <$< >$@ \
-e "s,@sysconfdir\@,$(sysconfdir),g" \ -e "s,@sysconfdir\@,$(sysconfdir),g" \
-e "s,@datadir\@,$(datadir),g" \ -e "s,@datadir\@,$(datadir),g" \
-e "s,@docdir\@,$(docdir),g" \ -e "s,@docdir\@,$(docdir),g" \
@ -467,7 +513,7 @@ doc.h: $(HDR_FILES)
# Update existing po file or copy messages.pot # Update existing po file or copy messages.pot
# #
%.po:messages.pot %.po:messages.pot
if test -f $*.po; then \ $(v)if test -f $*.po; then \
msgmerge -U --backup=existing $*.po messages.pot;\ msgmerge -U --backup=existing $*.po messages.pot;\
else \ else \
cp messages.pot $*.po;\ cp messages.pot $*.po;\
@ -511,41 +557,43 @@ endif
# There ought to be something simpler. # There ought to be something simpler.
# #
share/man: $(HELP_SRC) lexicon_filter share/man: $(HELP_SRC) lexicon_filter
-mkdir share/man -$(v)mkdir -p share/man
touch share/man @echo " doxygen "$@
-rm -Rf share/man/man1 $(v)touch share/man
-$(v)rm -Rf share/man/man1
PROJECT_NUMBER=`echo $(FISH_BUILD_VERSION)| $(SED) "s/-.*//"` INPUT_FILTER=./lexicon_filter \ PROJECT_NUMBER=`echo $(FISH_BUILD_VERSION)| $(SED) "s/-.*//"` INPUT_FILTER=./lexicon_filter \
./build_tools/build_documentation.sh Doxyfile.help ./doc_src ./share build_tools/build_documentation.sh Doxyfile.help ./doc_src ./share
# #
# The build rules for installing/uninstalling fish # The build rules for installing/uninstalling fish
# #
check-legacy-binaries: check-legacy-binaries:
@SEQLOC=$(prefix)/bin/seq;\ $(v)SEQLOC=$(prefix)/bin/seq;\
if test -f "$$SEQLOC" && grep -q '\(^#!/.*/fish\|^#!/usr/bin/env fish\)' "$$SEQLOC"; then\ if test -f "$$SEQLOC" && grep -q '\(^#!/.*/fish\|^#!/usr/bin/env fish\)' "$$SEQLOC"; then\
echo "An outdated seq from a previous fish install was found. You should remove it with:";\ echo "An outdated seq from a previous fish install was found. You should remove it with:";\
echo " rm '$$SEQLOC'";\ echo " rm '$$SEQLOC'";\
fi; fi;
@SETCOLOR_LOC=$(prefix)/bin/set_color;\ $(v)SETCOLOR_LOC=$(prefix)/bin/set_color;\
if test -x "$$SETCOLOR_LOC" && $$SETCOLOR_LOC -v 2>&1 >/dev/null | grep -q "^set_color, version "; then\ if test -x "$$SETCOLOR_LOC" && $$SETCOLOR_LOC -v 2>&1 >/dev/null | grep -q "^set_color, version "; then\
echo "An outdated set_color from a previous fish install was found. You should remove it with:";\ echo "An outdated set_color from a previous fish install was found. You should remove it with:";\
echo " rm '$$SETCOLOR_LOC'";\ echo " rm '$$SETCOLOR_LOC'";\
fi; fi;
@MIMEDB_LOC=$(prefix)/bin/mimedb;\ $(v)MIMEDB_LOC=$(prefix)/bin/mimedb;\
if test -x "$$MIMEDB_LOC" && $$MIMEDB_LOC --version 2>&1 | grep -q "^mimedb, version "; then\ if test -x "$$MIMEDB_LOC" && $$MIMEDB_LOC --version 2>&1 | grep -q "^mimedb, version "; then\
echo "An outdated mimedb binary from a previous fish install was found. You should remove it with:";\ echo "An outdated mimedb binary from a previous fish install was found. You should remove it with:";\
echo " rm '$$MIMEDB_LOC'";\ echo " rm '$$MIMEDB_LOC'";\
fi; fi;
@FISHD_LOC=$(prefix)/bin/fishd;\ $(v)FISHD_LOC=$(prefix)/bin/fishd;\
if test -x "$$FISHD_LOC" && $$FISHD_LOC --version 2>&1 | grep -q "^fishd: fishd, version "; then\ if test -x "$$FISHD_LOC" && $$FISHD_LOC --version 2>&1 | grep -q "^fishd: fishd, version "; then\
echo "An outdated fishd binary from a previous fish install was found. You should remove it with:";\ echo "An outdated fishd binary from a previous fish install was found. You should remove it with:";\
echo " rm '$$FISHD_LOC'";\ echo " rm '$$FISHD_LOC'";\
fi; fi;
@true; $(v)true;
.PHONY: check-legacy-binaries .PHONY: check-legacy-binaries
install: all install-force check-legacy-binaries install: all install-force check-legacy-binaries
@echo
@echo fish is now installed on your system. @echo fish is now installed on your system.
@echo To run fish, type \'fish\' in your terminal. @echo To run fish, type \'fish\' in your terminal.
@echo @echo
@ -571,86 +619,86 @@ install: all install-force check-legacy-binaries
# Xcode install # Xcode install
# #
xcode-install: xcode-install:
rm -Rf /tmp/fish_build;\ $(v)rm -Rf /tmp/fish_build;\
xcodebuild install DSTROOT=/tmp/fish_build;\ xcodebuild install DSTROOT=/tmp/fish_build;\
ditto /tmp/fish_build / ditto /tmp/fish_build /
.PHONY: xcode-install .PHONY: xcode-install
# #
# Actually do the installation. These 'true' lines are to prevent installs # Actually do the installation. These 'true', ||: (OR noop) lines are to prevent installs
# from failing for (e.g.) missing man pages or extra_dirs outside the # from failing for (e.g.) missing man pages or extra_dirs outside the
# writeable prefix. # writeable prefix.
# #
install-force: all install-translations install-force: all install-translations
$(INSTALL) -m 755 -d $(DESTDIR)$(bindir) $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
for i in $(PROGRAMS); do\ $(v)for i in $(PROGRAMS); do\
$(INSTALL) -m 755 $$i $(DESTDIR)$(bindir) ; \ $(INSTALL) -m 755 $$i $(DESTDIR)$(bindir) ; \
true ;\ true ;\
done; done;
$(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish
$(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish/conf.d $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish/conf.d
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/completions $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/completions
$(INSTALL) -m 755 -d $(DESTDIR)$(extra_completionsdir); true $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(extra_completionsdir) ||:
$(INSTALL) -m 755 -d $(DESTDIR)$(extra_functionsdir); true $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(extra_functionsdir) ||:
$(INSTALL) -m 755 -d $(DESTDIR)$(extra_confdir); true $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(extra_confdir) ||:
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/functions $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/functions
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/man/man1 $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/man/man1
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools/web_config $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools/web_config
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools/web_config/js $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools/web_config/js
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools/web_config/partials $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools/web_config/partials
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools/web_config/sample_prompts $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools/web_config/sample_prompts
$(INSTALL) -m 644 etc/config.fish $(DESTDIR)$(sysconfdir)/fish/ $(v)$(INSTALL) -m 644 etc/config.fish $(DESTDIR)$(sysconfdir)/fish/
$(INSTALL) -m 644 share/config.fish $(DESTDIR)$(datadir)/fish/ $(v)$(INSTALL) -m 644 share/config.fish $(DESTDIR)$(datadir)/fish/
$(INSTALL) -m 644 share/__fish_build_paths.fish $(DESTDIR)$(datadir)/fish/ $(v)$(INSTALL) -m 644 share/__fish_build_paths.fish $(DESTDIR)$(datadir)/fish/
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/pkgconfig $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/pkgconfig
$(INSTALL) -m 644 fish.pc $(DESTDIR)$(datadir)/pkgconfig $(v)$(INSTALL) -m 644 fish.pc $(DESTDIR)$(datadir)/pkgconfig
for i in $(COMPLETIONS_DIR_FILES:%='%'); do \ $(v)for i in $(COMPLETIONS_DIR_FILES:%='%'); do \
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/completions/; \ $(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/completions/; \
true; \ true; \
done; done;
for i in $(FUNCTIONS_DIR_FILES:%='%'); do \ $(v)for i in $(FUNCTIONS_DIR_FILES:%='%'); do \
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/functions/; \ $(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/functions/; \
true; \ true; \
done; done;
for i in share/man/man1/*.1; do \ $(v)for i in share/man/man1/*.1; do \
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/man/man1/; \ $(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/man/man1/; \
true; \ true; \
done; done;
for i in share/tools/*.py; do\ $(v)for i in share/tools/*.py; do\
$(INSTALL) -m 755 $$i $(DESTDIR)$(datadir)/fish/tools/; \ $(INSTALL) -m 755 $$i $(DESTDIR)$(datadir)/fish/tools/; \
true; \ true; \
done; done;
for i in share/tools/web_config/*; do\ $(v)for i in share/tools/web_config/*.*; do\
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/tools/web_config/; \ $(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/tools/web_config/; \
true; \ true; \
done; done;
for i in share/tools/web_config/js/*; do\ $(v)for i in share/tools/web_config/js/*.*; do\
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/tools/web_config/js/; \ $(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/tools/web_config/js/; \
true; \ true; \
done; done;
for i in share/tools/web_config/partials/*; do\ $(v)for i in share/tools/web_config/partials/*; do\
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/tools/web_config/partials/; \ $(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/tools/web_config/partials/; \
true; \ true; \
done; done;
for i in share/tools/web_config/sample_prompts/*.fish; do\ $(v)for i in share/tools/web_config/sample_prompts/*.fish; do\
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/tools/web_config/sample_prompts/; \ $(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/tools/web_config/sample_prompts/; \
true; \ true; \
done; done;
for i in share/tools/web_config/*.py; do\ $(v)for i in share/tools/web_config/*.py; do\
$(INSTALL) -m 755 $$i $(DESTDIR)$(datadir)/fish/tools/web_config/; \ $(INSTALL) -m 755 $$i $(DESTDIR)$(datadir)/fish/tools/web_config/; \
true; \ true; \
done; done;
$(INSTALL) -m 755 -d $(DESTDIR)$(docdir) $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
for i in user_doc/html/* CHANGELOG.md; do \ $(v) for i in user_doc/html/* CHANGELOG.md; do \
if test -f $$i; then \ if test -f $$i; then \
$(INSTALL) -m 644 $$i $(DESTDIR)$(docdir); \ $(INSTALL) -m 644 $$i $(DESTDIR)$(docdir); \
fi; \ fi; \
done; done;
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1 $(v)$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1;
for i in $(MANUALS); do \ $(v) for i in $(MANUALS); do \
$(INSTALL) -m 644 $$i $(DESTDIR)$(mandir)/man1/; \ $(INSTALL) -m 644 $$i $(DESTDIR)$(mandir)/man1/; \
true; \ true; \
done; done;
@ -660,27 +708,27 @@ install-force: all install-translations
# Uninstall this fish version # Uninstall this fish version
# #
uninstall: uninstall-translations uninstall: uninstall-translations
-for i in $(PROGRAMS); do \ -$(v) for i in $(PROGRAMS); do \
rm -f $(DESTDIR)$(bindir)/$$i; \ rm -f $(DESTDIR)$(bindir)/$$i; \
done; done;
-rm -rf $(DESTDIR)$(sysconfdir)/fish -$(v) rm -rf $(DESTDIR)$(sysconfdir)/fish
-if test -d $(DESTDIR)$(datadir)/fish; then \ -$(v) if test -d $(DESTDIR)$(datadir)/fish; then \
rm -r $(DESTDIR)$(datadir)/fish; \ rm -r $(DESTDIR)$(datadir)/fish; \
fi fi
-if test -d $(DESTDIR)$(docdir); then \ -$(v) if test -d $(DESTDIR)$(docdir); then \
rm -rf $(DESTDIR)$(docdir);\ rm -rf $(DESTDIR)$(docdir);\
fi fi
-if test -f $(DESTDIR)$(datadir)/pkgconfig/fish.pc; then \ -$(v) if test -f $(DESTDIR)$(datadir)/pkgconfig/fish.pc; then \
rm -f $(DESTDIR)$(datadir)/pkgconfig/fish.pc;\ rm -f $(DESTDIR)$(datadir)/pkgconfig/fish.pc;\
fi fi
-for i in $(MANUALS); do \ -$(v) for i in $(MANUALS); do \
rm -rf $(DESTDIR)$(mandir)/man1/`basename $$i`*; \ rm -rf $(DESTDIR)$(mandir)/man1/`basename $$i`*; \
done; done;
.PHONY: uninstall .PHONY: uninstall
install-translations: $(TRANSLATIONS) install-translations: $(TRANSLATIONS)
ifdef HAVE_GETTEXT ifdef HAVE_GETTEXT
for i in $(TRANSLATIONS); do \ $(v)for i in $(TRANSLATIONS); do \
$(INSTALL) -m 755 -d $(DESTDIR)$(localedir)/`basename $$i .gmo`/LC_MESSAGES; \ $(INSTALL) -m 755 -d $(DESTDIR)$(localedir)/`basename $$i .gmo`/LC_MESSAGES; \
$(INSTALL) -m 644 $$i $(DESTDIR)$(localedir)/`basename $$i .gmo`/LC_MESSAGES/fish.mo; \ $(INSTALL) -m 644 $$i $(DESTDIR)$(localedir)/`basename $$i .gmo`/LC_MESSAGES/fish.mo; \
echo $(DESTDIR)$(localedir)/`basename $$i .gmo`/LC_MESSAGES/fish.mo;\ echo $(DESTDIR)$(localedir)/`basename $$i .gmo`/LC_MESSAGES/fish.mo;\
@ -689,7 +737,7 @@ endif
.PHONY: install-translations .PHONY: install-translations
uninstall-translations: uninstall-translations:
rm -f $(DESTDIR)$(localedir)/*/LC_MESSAGES/fish.mo $(v)rm -f $(DESTDIR)$(localedir)/*/LC_MESSAGES/fish.mo
.PHONY: uninstall-translations .PHONY: uninstall-translations
# #
@ -700,42 +748,47 @@ uninstall-translations:
# How basic files get compiled # How basic files get compiled
# #
obj/%.o: src/%.cpp | obj obj/%.o: src/%.cpp | obj
@echo " CXX "$@
$(CXX) $(CXXFLAGS) -c $< -o $@ $(CXX) $(CXXFLAGS) -c $< -o $@
# #
# obj directory # obj directory
# #
obj: obj:
mkdir obj $(v)mkdir obj
# #
# Build the fish program. # Build the fish program.
# #
fish: obj/fish.o $(FISH_OBJS) $(EXTRA_PCRE2) fish: obj/fish.o $(FISH_OBJS) $(EXTRA_PCRE2)
@echo " CXXLD "$@
$(CXX) $(CXXFLAGS) $(LDFLAGS_FISH) $(FISH_OBJS) obj/fish.o $(LIBS) -o $@ $(CXX) $(CXXFLAGS) $(LDFLAGS_FISH) $(FISH_OBJS) obj/fish.o $(LIBS) -o $@
$(PCRE2_LIB): $(PCRE2_H) $(PCRE2_LIB): $(PCRE2_H)
$(MAKE) -C $(PCRE2_DIR) libpcre2-$(PCRE2_WIDTH).la $(v)$(MAKE) V=$(V) -C $(PCRE2_DIR) libpcre2-$(PCRE2_WIDTH).la
$(PCRE2_H): $(PCRE2_H):
(cd $(PCRE2_DIR) && ./config.status) $(v)(cd $(PCRE2_DIR) && ./config.status)
# #
# Build the fish_tests program. # Build the fish_tests program.
# #
fish_tests: $(FISH_TESTS_OBJS) $(EXTRA_PCRE2) fish_tests: $(FISH_TESTS_OBJS) $(EXTRA_PCRE2)
@echo " CXXLD "$@
$(CXX) $(CXXFLAGS) $(LDFLAGS_FISH) $(FISH_TESTS_OBJS) $(LIBS) -o $@ $(CXX) $(CXXFLAGS) $(LDFLAGS_FISH) $(FISH_TESTS_OBJS) $(LIBS) -o $@
# #
# Build the fish_indent program. # Build the fish_indent program.
# #
fish_indent: $(FISH_INDENT_OBJS) $(EXTRA_PCRE2) fish_indent: $(FISH_INDENT_OBJS) $(EXTRA_PCRE2)
@echo " CXXLD "$@
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(FISH_INDENT_OBJS) $(LIBS) -o $@ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(FISH_INDENT_OBJS) $(LIBS) -o $@
# #
# Build the fish_key_reader program to show input from the terminal. # Build the fish_key_reader program to show input from the terminal.
# #
fish_key_reader: $(FISH_KEYREAD_OBJS) $(EXTRA_PCRE2) fish_key_reader: $(FISH_KEYREAD_OBJS) $(EXTRA_PCRE2)
@echo " CXXLD "$@
$(CXX) $(CXXFLAGS) $(LDFLAGS_FISH) $^ $(LIBS) -o $@ $(CXX) $(CXXFLAGS) $(LDFLAGS_FISH) $^ $(LIBS) -o $@
# #
@ -750,23 +803,24 @@ fish_key_reader: $(FISH_KEYREAD_OBJS) $(EXTRA_PCRE2)
# behind. # behind.
# #
depend: depend:
mkdir -p /tmp/fish_make_depend/src @echo "Running makedepend..."
cp src/*.cpp src/*.h /tmp/fish_make_depend/src $(v)mkdir -p /tmp/fish_make_depend/src
cp config.h /tmp/fish_make_depend/ $(v)cp src/*.cpp src/*.h /tmp/fish_make_depend/src
mv $(subst obj/,/tmp/fish_make_depend/src/,$(FISH_ALL_OBJS:.o=.cpp)) /tmp/fish_make_depend/ $(v)cp config.h /tmp/fish_make_depend/
cd /tmp/fish_make_depend && \ $(v)mv $(subst obj/,/tmp/fish_make_depend/src/,$(FISH_ALL_OBJS:.o=.cpp)) /tmp/fish_make_depend/
$(v)cd /tmp/fish_make_depend && \
makedepend -f$(CURDIR)/Makefile.in -pobj/ -Y -Isrc *.cpp makedepend -f$(CURDIR)/Makefile.in -pobj/ -Y -Isrc *.cpp
rm -Rf /tmp/fish_make_depend $(v)rm -Rf /tmp/fish_make_depend
./config.status $(v)./config.status
.PHONY: depend .PHONY: depend
# #
# Lint the code. This only deals with C++ files. # Lint the code. This only deals with C++ files.
# #
lint: lint:
build_tools/lint.fish $(CXX) $(CXXFLAGS) $(v)build_tools/lint.fish $(CXX) $(CXXFLAGS)
lint-all: lint-all:
build_tools/lint.fish $(CXX) --all $(CXXFLAGS) $(v)build_tools/lint.fish $(CXX) --all $(CXXFLAGS)
.PHONY: lint lint-all .PHONY: lint lint-all
# #
@ -774,9 +828,9 @@ lint-all:
# fish scripts (*.fish). # fish scripts (*.fish).
# #
style: style:
build_tools/style.fish $(v)build_tools/style.fish
style-all: style-all:
build_tools/style.fish --all $(v)build_tools/style.fish --all
.PHONY: style style-all .PHONY: style style-all
# #
@ -787,8 +841,8 @@ style-all:
# Restore the source tree to the state right after extracting a tarball. # Restore the source tree to the state right after extracting a tarball.
# #
distclean: clean distclean: clean
$(MAKE) -C $(PCRE2_DIR) distclean || true $(v)$(MAKE) -C $(PCRE2_DIR) distclean ||:
rm -f config.status config.log config.h Makefile $(v)rm -f config.status config.log config.h Makefile
.PHONY: distclean .PHONY: distclean
# #
@ -800,23 +854,32 @@ distclean: clean
# them. # them.
# #
clean: clean:
$(MAKE) -C $(PCRE2_DIR) clean || true $(v)$(call echo_bold, "Removing everything built by the Makefile")
rm -f obj/*.o *.o doc.h doc.tmp $(v)$(MAKE) -s -C $(PCRE2_DIR) clean ||:
rm -f doc_src/*.doxygen doc_src/*.cpp doc_src/*.o doc_src/commands.hdr $(v)rm -f obj/*.o *.o doc.h doc.tmp
rm -f tests/tmp.err tests/tmp.out tests/tmp.status tests/foo.txt $(v)rm -f doc_src/*.doxygen doc_src/*.cpp doc_src/*.o doc_src/commands.hdr
rm -f $(PROGRAMS) fish_tests fish_key_reader $(v)rm -f tests/tmp.err tests/tmp.out tests/tmp.status tests/foo.txt
rm -f command_list.txt command_list_toc.txt toc.txt $(v)rm -f $(PROGRAMS) fish_tests fish_key_reader
rm -f doc_src/index.hdr doc_src/commands.hdr $(v)rm -f command_list.txt command_list_toc.txt toc.txt
rm -f lexicon_filter lexicon.txt lexicon.log $(v)rm -f doc_src/index.hdr doc_src/commands.hdr
rm -f compile_commands.json xcodebuild.log $(v)rm -f lexicon_filter lexicon.txt lexicon.log
rm -f FISH-BUILD-VERSION-FILE fish.pc share/__fish_build_paths.fish $(v)rm -f compile_commands.json xcodebuild.log
if test "$(HAVE_DOXYGEN)" = 1; then \ $(v)rm -f FISH-BUILD-VERSION-FILE fish.pc share/__fish_build_paths.fish
$(v)if test "$(HAVE_DOXYGEN)" = 1; then \
rm -rf doc user_doc share/man; \ rm -rf doc user_doc share/man; \
fi fi
rm -f po/*.gmo $(v)rm -f po/*.gmo
rm -rf obj build test $(v)rm -rf obj build test
.PHONY: clean .PHONY: clean
# Veto'd Verbose
# $(v)cmd = @cmd if V=0,
# cmd if V=1
# @cmd = @cmd always
V1 :=
V0 := @
v = $(V$(V))
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.

View file

@ -132,13 +132,18 @@ if test "$RESULT" = 0 ; then
fi fi
# Destroy TMPLOC # Destroy TMPLOC
echo "Cleaning up '$TMPLOC'" if test "$RESULT" -ne 0; then
echo "Cleaning up '$TMPLOC'"
fi
rm -Rf "$TMPLOC" rm -Rf "$TMPLOC"
if test "$RESULT" = 0; then if test "$RESULT" -ne 0; then
# Tell the user what we did tput smso 2> /dev/null || true
echo "Output man pages into '${OUTPUTDIR}'" echo "Doxygen failed creating manpages. See the output log for details."
tput sgr0 2> /dev/null || true
else else
echo "Doxygen failed. See the output log for details." tput bold 2> /dev/null || true
echo Built manpages
tput sgr0 2> /dev/null || true
fi fi
exit $RESULT exit $RESULT