ggo_dir := ggo
object_dir := objects
+man_dir := man/man1
m4_ggos := afh audioc audiod client filter gui recv server write
all_ggos := $(m4_ggos) dccp_recv oggdec_filter alsa_write oss_write fade http_recv \
$(ggo_dir) skencil)
tarball := @PACKAGE_TARNAME@-$(PACKAGE_VERSION).tar.bz2
+# To put more focus on warnings, be less verbose as default
+# Use 'make V=1' to see the full commands
+ifdef V
+ ifeq ("$(origin V)", "command line")
+ BUILD_VERBOSE = $(V)
+ endif
+endif
+ifndef BUILD_VERBOSE
+ BUILD_VERBOSE = 0
+endif
+ifeq ($(BUILD_VERBOSE),1)
+ Q =
+else
+ Q = @
+endif
+
.PHONY: all clean distclean maintainer-clean install man tarball\
.FORCE-GIT-VERSION-FILE
all: $(BINARIES) $(man_pages)
-include $(ggo_dir)/makefile
%_command_list.c: %.cmd
- ./command_util.sh c < $< >$@
+ @[ -z "$(Q)" ] || echo 'GEN $@'
+ $(Q) ./command_util.sh c < $< >$@
%_command_list.h: %.cmd
- ./command_util.sh h < $< >$@
+ @[ -z "$(Q)" ] || echo 'GEN $@'
+ $(Q) ./command_util.sh h < $< >$@
%_command_list.man: %.cmd
- ./command_util.sh man < $< > $@
+ @[ -z "$(Q)" ] || echo 'GEN $@'
+ $(Q) ./command_util.sh man < $< > $@
server_command_lists_ch = server_command_list.c afs_command_list.c \
server_command_list.h afs_command_list.h
server_command_lists_man = server_command_list.man afs_command_list.man
-man/man1/para_server.1: para_server $(server_command_lists_man)
- mkdir -p man/man1
- opts="-h --detailed-help -N `for i in $(server_command_lists_man); do printf "%s\n" "-i $$i"; done`"; \
+man/man1/para_server.1: para_server $(server_command_lists_man) | $(man_dir)
+ @[ -z "$(Q)" ] || echo 'HELP2MAN $<'
+ $(Q) opts="-h --detailed-help -N `for i in $(server_command_lists_man); do printf "%s\n" "-i $$i"; done`"; \
help2man $$opts ./para_server > $@
-man/man1/para_audiod.1: para_audiod audiod_command_list.man
- mkdir -p man/man1
- help2man -h --detailed-help -N -i audiod_command_list.man ./para_audiod > $@
+man/man1/para_audiod.1: para_audiod audiod_command_list.man | $(man_dir)
+ @[ -z "$(Q)" ] || echo 'HELP2MAN $<'
+ $(Q) help2man -h --detailed-help -N -i audiod_command_list.man ./para_audiod > $@
-man/man1/%.1: %
- mkdir -p man/man1
- help2man -h --detailed-help -N ./$< > $@
+man/man1/%.1: % | $(man_dir)
+ @[ -z "$(Q)" ] || echo 'HELP2MAN $<'
+ $(Q) help2man -h --detailed-help -N ./$< > $@
man/html/%.html: man/man1/%.1
- mkdir -p man/html
- man2html $< > $@
+ @[ -z "$(Q)" ] || echo 'MAN2HTML $<'
+ $(Q) mkdir -p man/html
+ $(Q) man2html $< > $@
web/%.man.in.html: man/man1/%.1
- man2html $< | sed -e '/^<\/BODY>/,$$d' -e '1,/<\/HEAD><BODY>/d' > $@
+ @[ -z "$(Q)" ] || echo 'MAN2HTML $<'
+ $(Q) mkdir -p man/html
+ $(Q) man2html $< | sed -e '/^<\/BODY>/,$$d' -e '1,/<\/HEAD><BODY>/d' > $@
$(object_dir):
mkdir -p $@
+$(man_dir):
+ mkdir -p $@
$(object_dir)/oggdec_filter.o: oggdec_filter.c | $(object_dir)
- $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
+ @[ -z "$(Q)" ] || echo 'CC $<'
+ $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
$(object_dir)/ogg_afh.o: ogg_afh.c | $(object_dir)
- $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
+ @[ -z "$(Q)" ] || echo 'CC $<'
+ $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
$(object_dir)/mp3dec_filter.o: mp3dec_filter.c | $(object_dir)
- $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @mad_cppflags@ $<
+ @[ -z "$(Q)" ] || echo 'CC $<'
+ $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @mad_cppflags@ $<
$(object_dir)/aacdec_filter.o: aacdec_filter.c | $(object_dir)
- $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
+ @[ -z "$(Q)" ] || echo 'CC $<'
+ $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
$(object_dir)/aac_common.o: aac_common.c | $(object_dir)
- $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
+ @[ -z "$(Q)" ] || echo 'CC $<'
+ $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
$(object_dir)/aac_afh.o: aac_afh.c | $(object_dir)
- $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
+ @[ -z "$(Q)" ] || echo 'CC $<'
+ $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
$(object_dir)/%.cmdline.o: $(cmdline_dir)/%.cmdline.c $(cmdline_dir)/%.cmdline.h | $(object_dir)
- $(CC) -c $(CPPFLAGS) -o $@ $<
+ @[ -z "$(Q)" ] || echo 'CC $<'
+ $(Q) $(CC) -c $(CPPFLAGS) -o $@ $<
$(object_dir)/%.o: %.c | $(object_dir)
- $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
+ @[ -z "$(Q)" ] || echo 'CC $<'
+ $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
# We depend on the *.cmdline.[ch] files as these must be present for depend.sh
# to work. The first dependency is explititly given as it is used by $<.
+
$(object_dir)/%.cmdline.d: %.cmdline.c $(cmdline_generated) | $(object_dir)
- ./depend.sh $(object_dir) $(CPPFLAGS) $< > $@
+ @[ -z "$(Q)" ] || echo 'DEP $<'
+ $(Q) ./depend.sh $(object_dir) $(CPPFLAGS) $< > $@
+
$(object_dir)/%.d: %.c $(cmdline_generated) | $(object_dir)
- ./depend.sh $(object_dir) $(CPPFLAGS) $< > $@
+ @[ -z "$(Q)" ] || echo 'DEP $<'
+ $(Q) ./depend.sh $(object_dir) $(CPPFLAGS) $< > $@
recv_objs := $(addprefix $(object_dir)/, @recv_objs@)
filter_objs := $(addprefix $(object_dir)/, @filter_objs@)
-include $(all_objs:.o=.d)
para_recv: $(recv_objs)
- $(CC) $(LDFLAGS) $(recv_objs) -o $@ @recv_ldflags@
+ @[ -z "$(Q)" ] || echo 'LD $@'
+ $(Q) $(CC) $(LDFLAGS) $(recv_objs) -o $@ @recv_ldflags@
para_filter: $(filter_objs)
- $(CC) $(LDFLAGS) $(filter_objs) -o $@ @filter_ldflags@
+ @[ -z "$(Q)" ] || echo 'LD $@'
+ $(Q) $(CC) $(LDFLAGS) $(filter_objs) -o $@ @filter_ldflags@
para_client: $(client_objs)
- $(CC) $(LDFLAGS) -o $@ $(client_objs) @client_ldflags@
+ @[ -z "$(Q)" ] || echo 'LD $@'
+ $(Q) $(CC) $(LDFLAGS) -o $@ $(client_objs) @client_ldflags@
para_gui: $(gui_objs)
- $(CC) $(LDFLAGS) -o $@ $(gui_objs) -lncurses
+ @[ -z "$(Q)" ] || echo 'LD $@'
+ $(Q) $(CC) $(LDFLAGS) -o $@ $(gui_objs) -lncurses
para_audiod: audiod_command_list.c audiod_command_list.h $(audiod_objs)
- $(CC) $(LDFLAGS) -o $@ $(audiod_objs) @audiod_ldflags@
+ @[ -z "$(Q)" ] || echo 'LD $@'
+ $(Q) $(CC) $(LDFLAGS) -o $@ $(audiod_objs) @audiod_ldflags@
para_audioc: $(audioc_objs)
- $(CC) $(LDFLAGS) -o $@ $(audioc_objs) @audioc_ldflags@
+ @[ -z "$(Q)" ] || echo 'LD $@'
+ $(Q) $(CC) $(LDFLAGS) -o $@ $(audioc_objs) @audioc_ldflags@
para_fade: $(fade_objs)
- $(CC) $(LDFLAGS) -o $@ $(fade_objs) @fade_ldflags@
+ @[ -z "$(Q)" ] || echo 'LD $@'
+ $(Q) $(CC) $(LDFLAGS) -o $@ $(fade_objs) @fade_ldflags@
para_server: $(server_command_lists_ch) $(server_objs)
- $(CC) $(LDFLAGS) -o $@ $(server_objs) @server_ldflags@
+ @[ -z "$(Q)" ] || echo 'LD $@'
+ $(Q) $(CC) $(LDFLAGS) -o $@ $(server_objs) @server_ldflags@
para_write: $(write_objs)
- $(CC) $(LDFLAGS) -o $@ $(write_objs) @write_ldflags@
+ @[ -z "$(Q)" ] || echo 'LD $@'
+ $(Q) $(CC) $(LDFLAGS) -o $@ $(write_objs) @write_ldflags@
para_afh: $(afh_objs)
- $(CC) $(LDFLAGS) -o $@ $(afh_objs) @afh_ldflags@
+ @[ -z "$(Q)" ] || echo 'LD $@'
+ $(Q) $(CC) $(LDFLAGS) -o $@ $(afh_objs) @afh_ldflags@
clean:
- rm -f $(BINARIES) $(object_dir)/*.o
+ @[ -z "$(Q)" ] || echo 'CLEAN'
+ $(Q) rm -f $(BINARIES) $(object_dir)/*.o
clean2: clean
- rm -rf man $(object_dir)
- rm -f *_command_list.*
+ @[ -z "$(Q)" ] || echo 'CLEAN2'
+ $(Q) rm -rf man $(object_dir)
+ $(Q) rm -f *_command_list.*
distclean: clean2
- rm -f Makefile autoscan.log config.status config.log && \
- rm -rf autom4te.cache aclocal.m4
- rm -f GPATH GRTAGS GSYMS GTAGS
+ @[ -z "$(Q)" ] || echo 'DISTCLEAN'
+ $(Q) rm -f Makefile autoscan.log config.status config.log
+ $(Q) rm -rf autom4te.cache aclocal.m4
+ $(Q) rm -f GPATH GRTAGS GSYMS GTAGS
maintainer-clean: distclean
rm -f $(ggo_generated) *.tar.bz2 \
mkdir -p $(cmdline_dir)
$(cmdline_dir)/%_recv.cmdline.h $(cmdline_dir)/%_recv.cmdline.c: $(ggo_dir)/%_recv.ggo | $(cmdline_dir)
- gengetopt $(module_ggo_opts) \
+ @[ -z "$(Q)" ] || echo 'GGO $<'
+ $(Q) gengetopt $(module_ggo_opts) \
--output-dir=$(cmdline_dir) \
--set-package=$(subst .ggo,,$(<F)) \
--arg-struct-name=$(subst .ggo,,$(<F))_args_info \
--func-name $(subst .ggo,,$(<F))_cmdline_parser < $<
$(cmdline_dir)/%_filter.cmdline.h $(cmdline_dir)/%_filter.cmdline.c: $(ggo_dir)/%_filter.ggo | $(cmdline_dir)
- gengetopt $(module_ggo_opts) \
+ @[ -z "$(Q)" ] || echo 'GGO $<'
+ $(Q) gengetopt $(module_ggo_opts) \
--output-dir=$(cmdline_dir) \
--set-package=$(subst .ggo,,$(<F)) \
--arg-struct-name=$(subst .ggo,,$(<F))_args_info \
--file-name=$(subst .ggo,,$(<F)).cmdline \
--func-name=$(subst _filter.ggo,,$(<F))_cmdline_parser < $<
$(cmdline_dir)/%_write.cmdline.h $(cmdline_dir)/%_write.cmdline.c: $(ggo_dir)/%_write.ggo | $(cmdline_dir)
- gengetopt -S $(module_ggo_opts) \
+ @[ -z "$(Q)" ] || echo 'GGO $<'
+ $(Q) gengetopt -S $(module_ggo_opts) \
--output-dir=$(cmdline_dir) \
--set-package=$(subst .ggo,,$(<F)) \
--arg-struct-name=$(subst .ggo,,$(<F))_args_info \
endef
$(cmdline_dir)/%.cmdline.h $(cmdline_dir)/%.cmdline.c: $(ggo_dir)/%.ggo | $(cmdline_dir)
- gengetopt $(ggo-opts) < $<
+ @[ -z "$(Q)" ] || echo 'GGO $<'
+ $(Q) gengetopt $(ggo-opts) < $<
$(ggo_dir)/server.ggo $(ggo_dir)/audiod.ggo: \
$(ggo_dir)/loglevel.m4 $(ggo_dir)/color.m4 \
$(ggo_dir)/client.ggo: $(ggo_dir)/loglevel.m4 $(ggo_dir)/config_file.m4
$(ggo_dir)/%.ggo: $(ggo_dir)/%.m4 $(ggo_dir)/header.m4
- cd $(ggo_dir); m4 $(<F) > $(@F)
+ @[ -z "$(Q)" ] || echo 'M4 $<'
+ $(Q) cd $(ggo_dir); m4 $(<F) > $(@F)