@@ -631,30 +631,32 @@ legal-info: dirs legal-info-clean legal-info-prepare $(TARGETS_LEGAL_INFO) \
show-targets:
@echo $(TARGETS)
+BR2_GRAPH_OUT := $(or $(GRAPH_OUT),pdf)
+
graph-build: $(O)/build/build-time.log
@install -d $(O)/graphs
$(foreach o,name build duration,./support/scripts/graph-build-time \
--type=histogram --order=$(o) \
- --output=$(O)/graphs/build.hist-$(o).pdf \
+ --output=$(O)/graphs/build.hist-$(o).$(BR2_GRAPH_OUT) \
$(if $(GRAPH_ALT),--alternate-colors) \
<$(<)$(sep))
$(foreach t,packages steps,./support/scripts/graph-build-time \
--type=pie-$(t) \
- --output=$(O)/graphs/build.pie-$(t).pdf \
+ --output=$(O)/graphs/build.pie-$(t).$(BR2_GRAPH_OUT) \
$(if $(GRAPH_ALT),--alternate-colors) \
<$(<)$(sep))
graph-depends:
@install -d $(O)/graphs
@./support/scripts/graph-depends \
- |dot -Tpdf -o $(O)/graphs/graph-depends.pdf
- -o $(O)/graphs/graph-depends.pdf
+ |dot -T$(BR2_GRAPH_OUT) \
+ -o $(O)/graphs/$(@).$(BR2_GRAPH_OUT)
%-graph-depends:
@install -d $(O)/graphs
@./support/scripts/graph-depends $(@:-graph-depends=) \
- |dot -Tpdf \
- -o $(O)/graphs/$(@).pdf
+ |dot -T$(BR2_GRAPH_OUT) \
+ -o $(O)/graphs/$(@).$(BR2_GRAPH_OUT)
else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
@@ -880,6 +882,7 @@ endif
@echo ' make V=0|1 - 0 => quiet build (default), 1 => verbose build'
@echo ' make O=dir - Locate all output files in "dir", including .config'
@echo ' make GRAPH_ALT=1 - use alternate color-scheme for build-time graphs'
+ @echo ' make GRAPH_OUT=pdf|png - generate either pdf (default) or png graphs'
@echo
@echo 'Built-in configs:'
@$(foreach b, $(sort $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig))), \
@@ -51,7 +51,6 @@
import matplotlib
import numpy
-matplotlib.use('PDF')
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
@@ -258,7 +257,7 @@ parser.add_argument("--order", metavar="GRAPH_ORDER",
parser.add_argument("--alternate-colors", action="store_true",
help="Use alternate colour-scheme")
parser.add_argument("--output", metavar="OUTPUT", required=True,
- help="Output file (PDF extension)")
+ help="Output file (.pdf or .png extension)")
args = parser.parse_args()
d = read_data()