Skip to content

Commit

Permalink
Make the build summary more pretty
Browse files Browse the repository at this point in the history
  • Loading branch information
timangus committed Mar 26, 2013
1 parent 946c89b commit 838fcf4
Showing 1 changed file with 27 additions and 33 deletions.
60 changes: 27 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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
Expand Down

0 comments on commit 838fcf4

Please sign in to comment.