summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2023-02-23 16:11:46 (EST)
committer P. J. McDermott <pj@pehjota.net>2023-02-23 16:13:08 (EST)
commit3433b09d9a92fbcf679a8750c9c77884140a771c (patch)
treea808f444ab5011cbdcf6ea55d5d704e4e8363c66
parentc5a712c8e03f3a56df39bc499583b3741c2aea39 (diff)
downloadxcftools-3433b09d9a92fbcf679a8750c9c77884140a771c.zip
xcftools-3433b09d9a92fbcf679a8750c9c77884140a771c.tar.gz
xcftools-3433b09d9a92fbcf679a8750c9c77884140a771c.tar.bz2
Support silent makefile rules with `make V=1`
-rw-r--r--Makefile.in96
1 files changed, 59 insertions, 37 deletions
diff --git a/Makefile.in b/Makefile.in
index a90482d..72a114c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -65,28 +65,50 @@ LINGUAS = da
MANLINGUAS = da
endif
+DEFAULT_VERBOSITY = 1
+V_CC = $(V_CC_$(V))
+V_CC_ = $(V_CC_$(DEFAULT_VERBOSITY))
+V_CC_0 = @echo ' CC ' '$@';
+V_CC_1 =
+V_CCLD = $(V_CCLD_$(V))
+V_CCLD_ = $(V_CCLD_$(DEFAULT_VERBOSITY))
+V_CCLD_0 = @echo ' CCLD ' '$@';
+V_CCLD_1 =
+V_GEN = $(V_GEN_$(V))
+V_GEN_ = $(V_GEN_$(DEFAULT_VERBOSITY))
+V_GEN_0 = @echo ' GEN ' '$@';
+V_GEN_1 =
+V_at = $(V_at_$(V))
+V_at_ = $(V_at_$(DEFAULT_VERBOSITY))
+V_at_0 = @
+V_at_1 =
+V_echo = $(V_echo_$(V))
+V_echo_ = $(V_echo_$(DEFAULT_VERBOSITY))
+V_echo_0 = :
+V_echo_1 = echo
+
%.$o: %.c
- $(CC) $(CFLAGS) -o $@ -c $<
+ $(V_CC)$(CC) $(CFLAGS) -o $@ -c $<
all: $(BINARIES) $(SCRIPTS) $(MANPAGES) po/stamp manpo/all
xcfinfo$e: xcfinfo.$o $(FILEIO).$o enums.$o xcf-general.$o utils.$o nlsini.$o
- $(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
+ $(V_CCLD)$(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
xcf2pnm$e: xcf2pnm.$o $(FILEIO).$o enums.$o xcf-general.$o utils.$o nlsini.$o \
pixels.$o flatten.$o flatspec.$o scaletab.$o table.$o
- $(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
+ $(V_CCLD)$(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
xcf2png$e: xcf2png.$o $(FILEIO).$o enums.$o xcf-general.$o utils.$o nlsini.$o \
pixels.$o flatten.$o flatspec.$o scaletab.$o table.$o palette.$o
- $(CC) $(LDFLAGS) $^ -o $@ $(LIBS) -lpng
+ $(V_CCLD)$(CC) $(LDFLAGS) $^ -o $@ $(LIBS) -lpng
xcfview: xcfview.in Makefile
- sed '1s,/usr/bin/perl,@PERL@,' < $< > $@
+ $(V_GEN)sed '1s,/usr/bin/perl,@PERL@,' < $< > $@
testscale$e: testscale.$o
- $(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
+ $(V_CCLD)$(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
install: all
for p in $(BINARIES) ; do \
@@ -116,24 +138,24 @@ C_GENERATED = enums.c table.c nlsini.c
ENUMSOURCES = gimp/base-enums.h gimp/gimpbaseenums.h gimp/xcf-private.h
enums.h: mkenumsh.pl $(ENUMSOURCES)
- $(PERL) $< $(ENUMSOURCES) > $@
+ $(V_GEN)$(PERL) $< $(ENUMSOURCES) > $@
enums.c: mkenumsc.pl enums.h
- $(PERL) $< enums.h > $@
+ $(V_GEN)$(PERL) $< enums.h > $@
table.c: mktablec.pl config.h
- $(PERL) $< > $@
+ $(V_GEN)$(PERL) $< > $@
nlsini.c: Makefile
- echo >$@ "#include \"xcftools.h\""
- echo >>$@ "#ifndef nls_init"
- echo >>$@ "void nls_init(void) {"
- echo >>$@ " bindtextdomain(\"$(APPNAME)\",\"$(localedir)\");"
- echo >>$@ " textdomain(\"$(APPNAME)\"); }"
- echo >>$@ "#endif"
+ $(V_GEN)echo >$@ "#include \"xcftools.h\""
+ $(V_at)echo >>$@ "#ifndef nls_init"
+ $(V_at)echo >>$@ "void nls_init(void) {"
+ $(V_at)echo >>$@ " bindtextdomain(\"$(APPNAME)\",\"$(localedir)\");"
+ $(V_at)echo >>$@ " textdomain(\"$(APPNAME)\"); }"
+ $(V_at)echo >>$@ "#endif"
%.oi: options.i mkopti.pl config.h
- $(PERL) mkopti.pl $*
+ $(V_GEN)$(PERL) mkopti.pl $*
%.1: %.oi %.10 config.h mancombine.pl
- $(PERL) mancombine.pl $*.10 > $@
+ $(V_GEN)$(PERL) mancombine.pl $*.10 > $@
#############################################################################
#
@@ -143,30 +165,30 @@ POTFILES_NONC = $(patsubst %$e,%.oi,$(BINARIES)) options.i
po/$(APPNAME).pot$(SUPPRESS_AUTOFOO): $(POTFILES_NONC) \
$(filter-out table.c nlsini.c, $(C_GENERATED) $(wildcard *.c))
- xgettext -o $@.tmp -C -k_ -kN_ \
+ $(V_GEN)xgettext -o $@.tmp -C -k_ -kN_ \
--foreign-user --msgid-bugs-address=henning@makholm.net \
--flag=FatalGeneric:2:c-format \
--flag=FatalUnexpected:1:c-format \
--flag=FatalBadXCF:1:c-format \
--flag=FatalUnsupportedXCF:1:c-format \
$^
- if diff $@ $@.tmp | \
+ $(V_at)if diff $@ $@.tmp | \
grep -v '^\([^<>]\|. \?"POT-Creation-Date:\)' > /dev/null; \
then mv -f $@.tmp $@ ; \
- else echo OK, $@ is unchanged ; rm $@.tmp ; fi
+ else $(V_echo) OK, $@ is unchanged ; rm $@.tmp ; fi
po/%.po: po/$(APPNAME).pot
- test -f $@
- msgmerge -U $@ $<
- touch $@
+ $(V_GEN)test -f $@
+ $(V_at)msgmerge -U $@ $<
+ $(V_at)touch $@
po/%.mo: po/%.po
- msgfmt -c -o$@ $<
+ $(V_GEN)msgfmt -c -o$@ $<
po/stamp: $(patsubst %,po/%.mo,$(LINGUAS))
- if ! make -q po/$(APPNAME).pot ; then \
+ $(V_GEN)if ! make -q po/$(APPNAME).pot ; then \
touch po/$(APPNAME).pot ; touch po/*.po ; touch po/*.mo ; fi
- touch $@
+ $(V_at)touch $@
# Manpage localization stuff
@@ -174,30 +196,30 @@ POTFILES_MAN = options.mi $(patsubst %.1,%.10,$(MANPAGES)) \
exit.1i
options.mi: manpo/optipot.pl options.i
- $(PERL) manpo/optipot.pl > $@
+ $(V_GEN)$(PERL) manpo/optipot.pl > $@
manpo/manpages.pot$(SUPPRESS_AUTOFOO): manpo/mantranslate.pl $(POTFILES_MAN)
- $(PERL) manpo/mantranslate.pl -x $(POTFILES_MAN) > $@.tmp
- if diff $@ $@.tmp | \
+ $(V_GEN)$(PERL) manpo/mantranslate.pl -x $(POTFILES_MAN) > $@.tmp
+ $(V_at)if diff $@ $@.tmp | \
grep -v '^\([^<>]\|. \?"POT-Creation-Date:\)' > /dev/null; \
then mv -f $@.tmp $@ ; \
- else echo OK, $@ is unchanged ; rm $@.tmp ; fi
+ else $(V_echo) OK, $@ is unchanged ; rm $@.tmp ; fi
manpo/%.po: manpo/manpages.pot
- test -f $@
- msgmerge -U $@ $<
- touch $@
+ $(V_GEN)test -f $@
+ $(V_at)msgmerge -U $@ $<
+ $(V_at)touch $@
manpo/stamp: $(patsubst %,manpo/%.po,$(MANLINGUAS))
- if ! make -q manpo/manpages.pot ; then \
+ $(V_GEN)if ! make -q manpo/manpages.pot ; then \
touch manpo/manpages.pot ; touch $^ ; fi
- touch $@
+ $(V_at)touch $@
manpo/all: manpo/stamp $(MANPAGES)
- for L in $(MANLINGUAS) ; do \
+ $(V_GEN)for L in $(MANLINGUAS) ; do \
for P in $(patsubst %.1,%,$(MANPAGES)) ; do \
$(PERL) manpo/mantranslate.pl manpo/$$L.po $$P.1 \
> manpo/$$P.$$L.1 || exit 1; done ; done ;
- touch $@
+ $(V_at)touch $@
#############################################################################
#