michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: USE_RCS_MK := 1 michael@0: include $(topsrcdir)/config/makefiles/rcs.mk michael@0: michael@0: DEFINES += -DMOZ_APP_VERSION='"$(MOZ_APP_VERSION)"' michael@0: michael@0: MOZ_HISTOGRAMS_VERSION ?= $(call getSourceRepo)/rev/$(firstword $(shell hg -R $(topsrcdir) parent --template='{node|short}\n' 2>/dev/null)) michael@0: ifdef MOZ_HISTOGRAMS_VERSION michael@0: DEFINES += -DHISTOGRAMS_FILE_VERSION='$(MOZ_HISTOGRAMS_VERSION)' michael@0: endif michael@0: michael@0: INSTALL_TARGETS += histoenums michael@0: histoenums_FILES := TelemetryHistogramEnums.h michael@0: histoenums_DEST = $(DIST)/include/mozilla michael@0: histoenums_TARGET := export michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: michael@0: histograms_file := $(srcdir)/Histograms.json michael@0: histogram_enum_file := TelemetryHistogramEnums.h michael@0: histogram_data_file := TelemetryHistogramData.inc michael@0: michael@0: enum_python_deps := \ michael@0: $(srcdir)/gen-histogram-enum.py \ michael@0: $(srcdir)/histogram_tools.py \ michael@0: $(NULL) michael@0: michael@0: data_python_deps := \ michael@0: $(srcdir)/gen-histogram-data.py \ michael@0: $(srcdir)/histogram_tools.py \ michael@0: $(NULL) michael@0: michael@0: $(histogram_enum_file): $(histograms_file) $(enum_python_deps) michael@0: $(PYTHON) $(srcdir)/gen-histogram-enum.py $< > $@ michael@0: $(histogram_data_file): $(histograms_file) $(data_python_deps) michael@0: $(PYTHON) $(srcdir)/gen-histogram-data.py $< > $@ michael@0: michael@0: GARBAGE += $(histogram_enum_file)