summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile60
1 files changed, 27 insertions, 33 deletions
diff --git a/Makefile b/Makefile
index ddabdf2c..718e061d 100644
--- a/Makefile
+++ b/Makefile
@@ -1101,11 +1101,30 @@ ifeq ($(BUILD_MASTER_SERVER),1)
$(MAKE) -C $(MASTERDIR) release
endif
+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)"
@@ -1117,50 +1136,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