diff --git a/Makefile b/Makefile index 4ef30086..d665263f 100644 --- a/Makefile +++ b/Makefile @@ -1152,11 +1152,30 @@ release: OPTIMIZE="-DNDEBUG $(OPTIMIZE)" OPTIMIZEVM="-DNDEBUG $(OPTIMIZEVM)" \ CLIENT_CFLAGS="$(CLIENT_CFLAGS)" SERVER_CFLAGS="$(SERVER_CFLAGS)" V=$(V) +ifneq ($(call bin_path, tput),) + TERM_COLUMNS=$(shell echo $$((`tput cols`-4))) +else + TERM_COLUMNS=76 +endif + +NAKED_TARGETS=$(shell echo $(TARGETS) | sed -e "s!$(B)/!!g") + +print_list=@for i in $(1); \ + do \ + echo " $$i"; \ + done + +ifneq ($(call bin_path, fmt),) + print_wrapped=@echo $(1) | fmt -w $(TERM_COLUMNS) | sed -e "s/^\(.*\)$$/ \1/" +else + print_wrapped=$(print_list) +endif + # Create the build directories, check libraries and print out # an informational message, then start building targets: makedirs @echo "" - @echo "Building $(CLIENTBIN) in $(B):" + @echo "Building in $(B):" @echo " PLATFORM: $(PLATFORM)" @echo " ARCH: $(ARCH)" @echo " VERSION: $(VERSION)" @@ -1168,50 +1187,25 @@ ifeq ($(PLATFORM),mingw32) endif @echo "" @echo " CFLAGS:" - -@for i in $(CFLAGS); \ - do \ - echo " $$i"; \ - done - -@for i in $(OPTIMIZE); \ - do \ - echo " $$i"; \ - done + $(call print_wrapped, $(CFLAGS) $(OPTIMIZE)) @echo "" @echo " CLIENT_CFLAGS:" - -@for i in $(CLIENT_CFLAGS); \ - do \ - echo " $$i"; \ - done + $(call print_wrapped, $(CLIENT_CFLAGS)) @echo "" @echo " SERVER_CFLAGS:" - -@for i in $(SERVER_CFLAGS); \ - do \ - echo " $$i"; \ - done + $(call print_wrapped, $(SERVER_CFLAGS)) @echo "" @echo " LDFLAGS:" - -@for i in $(LDFLAGS); \ - do \ - echo " $$i"; \ - done + $(call print_wrapped, $(LDFLAGS)) @echo "" @echo " LIBS:" - -@for i in $(LIBS); \ - do \ - echo " $$i"; \ - done + $(call print_wrapped, $(LIBS)) @echo "" @echo " CLIENT_LIBS:" - -@for i in $(CLIENT_LIBS); \ - do \ - echo " $$i"; \ - done + $(call print_wrapped, $(CLIENT_LIBS)) @echo "" @echo " Output:" - -@for i in $(TARGETS); \ - do \ - echo " $$i"; \ - done + $(call print_list, $(NAKED_TARGETS)) @echo "" ifneq ($(TARGETS),) ifndef DEBUG_MAKEFILE