1 pmu-events-y += pmu-events.o 1 pmu-events-y += pmu-events.o 2 JDIR = pmu-events/arch/$(SRCARCH) 2 JDIR = pmu-events/arch/$(SRCARCH) 3 JSON = $(shell [ -d $(JDIR) ] && 3 JSON = $(shell [ -d $(JDIR) ] && \ 4 find $(JDIR) -name '*. 4 find $(JDIR) -name '*.json' -o -name 'mapfile.csv') 5 JDIR_TEST = pmu-events/arch/test 5 JDIR_TEST = pmu-events/arch/test 6 JSON_TEST = $(shell [ -d $(JDIR_TEST) ] 6 JSON_TEST = $(shell [ -d $(JDIR_TEST) ] && \ 7 find $(JDIR_TEST) -nam 7 find $(JDIR_TEST) -name '*.json') 8 JEVENTS_PY = pmu-events/jevents.py 8 JEVENTS_PY = pmu-events/jevents.py 9 METRIC_PY = pmu-events/metric.py << 10 METRIC_TEST_PY = pmu-events/metric_test.py << 11 EMPTY_PMU_EVENTS_C = pmu-events/empty-pmu-even << 12 PMU_EVENTS_C = $(OUTPUT)pmu-events/pmu-eve << 13 METRIC_TEST_LOG = $(OUTPUT)pmu-events/metric_ << 14 TEST_EMPTY_PMU_EVENTS_C = $(OUTPUT)pmu-events/ << 15 EMPTY_PMU_EVENTS_TEST_LOG = $(OUTPUT)pmu-event << 16 9 17 ifeq ($(JEVENTS_ARCH),) 10 ifeq ($(JEVENTS_ARCH),) 18 JEVENTS_ARCH=$(SRCARCH) 11 JEVENTS_ARCH=$(SRCARCH) 19 endif 12 endif 20 JEVENTS_MODEL ?= all << 21 13 22 # 14 # 23 # Locate/process JSON files in pmu-events/arch 15 # Locate/process JSON files in pmu-events/arch/ 24 # directory and create tables in pmu-events.c. 16 # directory and create tables in pmu-events.c. 25 # 17 # 26 18 27 ifeq ($(NO_JEVENTS),1) 19 ifeq ($(NO_JEVENTS),1) 28 $(PMU_EVENTS_C): $(EMPTY_PMU_EVENTS_C) !! 20 $(OUTPUT)pmu-events/pmu-events.c: pmu-events/empty-pmu-events.c 29 $(call rule_mkdir) 21 $(call rule_mkdir) 30 $(Q)$(call echo-cmd,gen)cp $< $@ 22 $(Q)$(call echo-cmd,gen)cp $< $@ 31 else 23 else 32 $(METRIC_TEST_LOG): $(METRIC_TEST_PY) $(METRIC !! 24 $(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS_PY) pmu-events/metric.py 33 $(call rule_mkdir) 25 $(call rule_mkdir) 34 $(Q)$(call echo-cmd,test)$(PYTHON) $< !! 26 $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(JEVENTS_ARCH) pmu-events/arch $@ 35 << 36 $(TEST_EMPTY_PMU_EVENTS_C): $(JSON) $(JSON_TES << 37 $(call rule_mkdir) << 38 $(Q)$(call echo-cmd,gen)$(PYTHON) $(JE << 39 << 40 $(EMPTY_PMU_EVENTS_TEST_LOG): $(EMPTY_PMU_EVEN << 41 $(call rule_mkdir) << 42 $(Q)$(call echo-cmd,test)diff -u $^ 2> << 43 << 44 $(PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENT << 45 $(call rule_mkdir) << 46 $(Q)$(call echo-cmd,gen)$(PYTHON) $(JE << 47 endif 27 endif 48 << 49 # pmu-events.c file is generated in the OUTPUT << 50 # separate rule to depend on it properly << 51 $(OUTPUT)pmu-events/pmu-events.o: $(PMU_EVENTS << 52 $(call rule_mkdir) << 53 $(call if_changed_dep,cc_o_c) <<
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.