$(shell echo BR2_EXTERNAL ?= $(BR2_EXTERNAL) > $(BR2_EXTERNAL_FILE))
endif
+# Need that early, before we scan packages
+# Avoids doing the $(or...) everytime
+BR2_GRAPH_OUT := $(or $(GRAPH_OUT),pdf)
BUILD_DIR:=$(BASE_DIR)/build
STAMP_DIR:=$(BASE_DIR)/stamps
@install -d $(O)/graphs
$(foreach o,name build duration,./support/scripts/graph-build-time \
--type=histogram --order=$(o) --input=$(<) \
- --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) --input=$(<) \
- --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/$(@).pdf
+ |dot -T$(BR2_GRAPH_OUT) -o $(O)/graphs/$(@).$(BR2_GRAPH_OUT)
else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
is the recommended way of setting it.
* +GRAPH_ALT+, if set and non-empty, to use an alternate color-scheme in
build-time graphs
+* +GRAPH_OUT+ to set the filetype of generated graphs, either +pdf+ (the
+ default), or +png+.
An example that uses config files located in the toplevel directory and
in your $HOME:
$(1)-graph-depends:
@$(INSTALL) -d $(O)/graphs
@./support/scripts/graph-depends $(1) \
- |dot -Tpdf -o $(O)/graphs/$$(@).pdf
+ |dot -T$(BR2_GRAPH_OUT) -o $(O)/graphs/$$(@).$(BR2_GRAPH_OUT)
$(1)-dirclean: $$($(2)_TARGET_DIRCLEAN)
import matplotlib
import numpy
-matplotlib.use('PDF')
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
parser.add_argument("--input", '-i', metavar="OUTPUT",
help="Input file (usually $(O)/build/build-time.log)")
parser.add_argument("--output", '-o', metavar="OUTPUT", required=True,
- help="Output file (PDF extension)")
+ help="Output file (.pdf or .png extension)")
args = parser.parse_args()
d = read_data(args.input)