summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f5c010b)
This instructs "make" to pass all the lines in the recipe to a
single invocation of the shell. This has no disadvantage and improves
performance slightly. Best out of five "make -j 4" runs:
Before: 0m3.510s
After: 0m3.280s
Speedup: 6.55%
With .ONESHELL given, only the first line of each recipe will be
checked for the special '@' prefix character. This made it necessary
to modify the "Q" macro slightly. Rename it to "SAY" while at it.
The second issue with .ONESHELL is that a failure of any but the
final recipe line will not be noticed by make. To work around this,
we set .SHELLFLAGS to '-ec'. The '-e' flag instructs the shell to
exit at any failure anywhere in the command line.
ifeq ("$(origin CC)", "default")
CC := cc
endif
ifeq ("$(origin CC)", "default")
CC := cc
endif
+.ONESHELL:
+.SHELLFLAGS := -ec
LOGLEVELS := LL_DEBUG,LL_INFO,LL_NOTICE,LL_WARNING,LL_ERROR,LL_CRIT,LL_EMERG
vardir := /var/paraslash
LOGLEVELS := LL_DEBUG,LL_INFO,LL_NOTICE,LL_WARNING,LL_ERROR,LL_CRIT,LL_EMERG
vardir := /var/paraslash
$(object_dir) $(man_dir) $(dep_dir) $(m4depdir) $(lls_suite_dir) \
$(yy_build_dir):
$(object_dir) $(man_dir) $(dep_dir) $(m4depdir) $(lls_suite_dir) \
$(yy_build_dir):
CPPFLAGS += -DBINDIR='"$(bindir)"'
CPPFLAGS += -DCOPYRIGHT_YEAR='"$(COPYRIGHT_YEAR)"'
CPPFLAGS += -DBINDIR='"$(bindir)"'
CPPFLAGS += -DCOPYRIGHT_YEAR='"$(COPYRIGHT_YEAR)"'
# To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands
ifeq ("$(origin V)", "command line")
# To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands
ifeq ("$(origin V)", "command line")
+ SAY = @echo '$(strip $(1))'
endif
audiod_commands := $(addprefix $(lls_suite_dir)/, \
endif
audiod_commands := $(addprefix $(lls_suite_dir)/, \
$(man_dir)/para_%.1: $(lls_suite_dir)/%.lsg.man \
$(lls_m4_dir)/copyright.m4 | $(man_dir)
$(man_dir)/para_%.1: $(lls_suite_dir)/%.lsg.man \
$(lls_m4_dir)/copyright.m4 | $(man_dir)
- @[ -z "$(Q)" ] || echo 'LLSMAN $<'
- $(Q) cat $< $(all_commands) > $@
- $(Q) $(M4) -D COPYRIGHT_YEAR=$(COPYRIGHT_YEAR) $(lls_m4_dir)/copyright.m4 >> $@
+ $(call SAY, LLSMAN $<)
+ cat $< $(all_commands) > $@
+ $(M4) -D COPYRIGHT_YEAR=$(COPYRIGHT_YEAR) $(lls_m4_dir)/copyright.m4 >> $@
$(object_dir)/%.o: %.c | $(object_dir)
$(object_dir)/%.o: %.c | $(object_dir)
$(object_dir)/compress_filter.o: CFLAGS += -O3
$(object_dir)/%.o: %.c | $(object_dir) $(dep_dir) $(lsg_h) $(yy_h)
$(object_dir)/compress_filter.o: CFLAGS += -O3
$(object_dir)/%.o: %.c | $(object_dir) $(dep_dir) $(lsg_h) $(yy_h)
- @[ -z "$(Q)" ] || echo 'CC $<'
- $(Q) $(CC) -c -o $@ -MMD -MF $(dep_dir)/$(*F).d -MT $@ $(CPPFLAGS) \
+ $(call SAY, CC $<)
+ $(CC) -c -o $@ -MMD -MF $(dep_dir)/$(*F).d -MT $@ $(CPPFLAGS) \
$(STRICT_CFLAGS) $(CFLAGS) $<
para_recv para_afh para_play para_server: LDFLAGS += $(id3tag_ldflags)
$(STRICT_CFLAGS) $(CFLAGS) $<
para_recv para_afh para_play para_server: LDFLAGS += $(id3tag_ldflags)
$(foreach exe,$(executables),$(eval para_$(exe): $$($(exe)_objs)))
$(prefixed_executables):
$(foreach exe,$(executables),$(eval para_$(exe): $$($(exe)_objs)))
$(prefixed_executables):
- @[ -z "$(Q)" ] || echo 'LD $@'
- $(Q) $(CC) $^ -o $@ $(LDFLAGS)
+ $(call SAY, LD $@)
+ $(CC) $^ -o $@ $(LDFLAGS)
- @[ -z "$(Q)" ] || echo 'MOSTLYCLEAN'
- $(Q) rm -f para_*
- $(Q) rm -rf $(object_dir)
+ $(call SAY, MOSTLYCLEAN)
+ rm -f para_*
+ rm -rf $(object_dir)
- @[ -z "$(Q)" ] || echo 'CLEAN'
- $(Q) rm -rf $(build_dir)
+ $(call SAY, CLEAN)
+ rm -rf $(build_dir)
- @[ -z "$(Q)" ] || echo 'DISTCLEAN'
- $(Q) rm -f Makefile autoscan.log config.status config.log
- $(Q) rm -f config.h configure config.h.in
+ $(call SAY, DISTCLEAN)
+ rm -f Makefile autoscan.log config.status config.log
+ rm -f config.h configure config.h.in
maintainer-clean: distclean
maintainer-clean: distclean
- @[ -z "$(Q)" ] || echo 'MAINTAINER-CLEAN'
- $(Q) rm -f *.tar.bz2 *.tar.xz
- $(Q) rm -f GPATH GRTAGS GSYMS GTAGS
+ $(call SAY, MAINTAINER-CLEAN)
+ rm -f *.tar.bz2 *.tar.xz
+ rm -f GPATH GRTAGS GSYMS GTAGS
INSTALL ?= install
INSTALL_PROGRAM ?= $(INSTALL)
INSTALL ?= install
INSTALL_PROGRAM ?= $(INSTALL)
$(MKDIR_P) $(DESTDIR)$(vardir) >/dev/null 2>&1 || true # not fatal, so don't complain
$(tarball) dist tarball:
$(MKDIR_P) $(DESTDIR)$(vardir) >/dev/null 2>&1 || true # not fatal, so don't complain
$(tarball) dist tarball:
- $(Q) rm -rf $(tarball) $(tarball_pfx)
- $(Q) git archive --format=tar --prefix=$(tarball_pfx)/ HEAD \
- | tar --delete $(tarball_delete) > $(tarball_pfx).tar
- $(Q) $(MKDIR_P) $(tarball_pfx)
- $(Q) ./GIT-VERSION-GEN > $(tarball_pfx)/VERSION
- $(Q) cp $(autocrap) $(tarball_pfx)
- $(Q) tar rf $(tarball_pfx).tar $(tarball_pfx)/*
- $(Q) xz -9 $(tarball_pfx).tar
- $(Q) ls -l $(tarball)
- $(Q) ln -sf $(tarball) paraslash-git.tar.xz
- $(Q) rm -rf $(tarball_pfx)
+ $(call SAY, DIST)
+ rm -rf $(tarball) $(tarball_pfx)
+ git archive --format=tar --prefix=$(tarball_pfx)/ HEAD \
+ | tar --delete $(tarball_delete) > $(tarball_pfx).tar
+ $(MKDIR_P) $(tarball_pfx)
+ ./GIT-VERSION-GEN > $(tarball_pfx)/VERSION
+ cp $(autocrap) $(tarball_pfx)
+ tar rf $(tarball_pfx).tar $(tarball_pfx)/*
+ xz -9 $(tarball_pfx).tar
+ ls -l $(tarball)
+ ln -sf $(tarball) paraslash-git.tar.xz
+ rm -rf $(tarball_pfx)
lls_m4_include_dir := $(lls_m4_dir)/include
$(lls_suite_dir)/%.m4d: $(lls_m4_dir)/%.suite.m4 | $(lls_suite_dir)
lls_m4_include_dir := $(lls_m4_dir)/include
$(lls_suite_dir)/%.m4d: $(lls_m4_dir)/%.suite.m4 | $(lls_suite_dir)
- @[ -z "$(Q)" ] || echo 'M4D $<'
- $(Q) $(M4) -Pg -I $(lls_m4_include_dir) -s $< \
+ $(call SAY, M4D $<)
+ $(M4) -Pg -I $(lls_m4_include_dir) -s $< \
| awk '{if ($$1 ~ /#line/) {gsub(/"/, "", $$3); if ($$3 != "$<") \
print "$(lls_suite_dir)/$(*F).suite: " $$3}}' | sort | uniq > $@
$(lls_suite_dir)/%.suite: $(lls_m4_dir)/%.suite.m4 | $(lls_suite_dir)
| awk '{if ($$1 ~ /#line/) {gsub(/"/, "", $$3); if ($$3 != "$<") \
print "$(lls_suite_dir)/$(*F).suite: " $$3}}' | sort | uniq > $@
$(lls_suite_dir)/%.suite: $(lls_m4_dir)/%.suite.m4 | $(lls_suite_dir)
- @[ -z "$(Q)" ] || echo 'M4 $<'
- $(Q) $(M4) -Pg -I $(lls_m4_include_dir) -D GIT_VERSION=$(GIT_VERSION) \
+ $(call SAY, M4 $<)
+ $(M4) -Pg -I $(lls_m4_include_dir) -D GIT_VERSION=$(GIT_VERSION) \
-D COPYRIGHT_YEAR=$(COPYRIGHT_YEAR) -D LOGLEVELS=$(LOGLEVELS) \
$< > $@
$(lls_suite_dir)/%.lsg.c: $(lls_suite_dir)/%.suite
-D COPYRIGHT_YEAR=$(COPYRIGHT_YEAR) -D LOGLEVELS=$(LOGLEVELS) \
$< > $@
$(lls_suite_dir)/%.lsg.c: $(lls_suite_dir)/%.suite
- @[ -z "$(Q)" ] || echo 'LSGC $<'
- $(Q) $(LOPSUBGEN) --gen-c --output-dir $(lls_suite_dir) < $<
+ $(call SAY, LSGC $<)
+ $(LOPSUBGEN) --gen-c --output-dir $(lls_suite_dir) < $<
$(lls_suite_dir)/%.lsg.h: $(lls_suite_dir)/%.suite
$(lls_suite_dir)/%.lsg.h: $(lls_suite_dir)/%.suite
- @[ -z "$(Q)" ] || echo 'LSGH $<'
- $(Q) $(LOPSUBGEN) --gen-header --output-dir $(lls_suite_dir) < $<
+ $(call SAY, LSGH $<)
+ $(LOPSUBGEN) --gen-header --output-dir $(lls_suite_dir) < $<
$(lls_suite_dir)/%.lsg.man: $(lls_suite_dir)/%.suite
$(lls_suite_dir)/%.lsg.man: $(lls_suite_dir)/%.suite
- @[ -z "$(Q)" ] || echo 'LSGM $<'
- $(Q) $(LOPSUBGEN) --gen-man --output-dir $(lls_suite_dir) < $<
+ $(call SAY, LSGM $<)
+ $(LOPSUBGEN) --gen-man --output-dir $(lls_suite_dir) < $<
$(object_dir)/%.o: $(lls_suite_dir)/%.c | $(object_dir)
$(object_dir)/%.o: $(lls_suite_dir)/%.c | $(object_dir)
- @[ -z "$(Q)" ] || echo 'CC $<'
- $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(STRICT_CFLAGS) $<
+ $(call SAY, CC $<)
+ $(CC) -c -o $@ $(CPPFLAGS) $(STRICT_CFLAGS) $<
test: $(tests)
$(tests): all
test: $(tests)
$(tests): all
- $(Q) $@ $(test_options)
+ $(call SAY, $(@))
+ $@ $(test_options)
- $(Q) for t in $(tests); do $$t $(test_options) -h; done
+ @for t in $(tests); do $$t $(test_options) -h; done
test-clean:
$(RM) -r $(results_dir)
test-clean:
$(RM) -r $(results_dir)