180eeb67fSAndi Kleenpmu-events-y += pmu-events.o 27a759cd8SJiada WangJDIR = pmu-events/arch/$(SRCARCH) 380eeb67fSAndi KleenJSON = $(shell [ -d $(JDIR) ] && \ 480eeb67fSAndi Kleen find $(JDIR) -name '*.json' -o -name 'mapfile.csv') 5517db3b5SJohn GarryJDIR_TEST = pmu-events/arch/test 6517db3b5SJohn GarryJSON_TEST = $(shell [ -d $(JDIR_TEST) ] && \ 7517db3b5SJohn Garry find $(JDIR_TEST) -name '*.json') 800facc76SIan RogersJEVENTS_PY = pmu-events/jevents.py 9e9d32c1bSJohn Garry 10b4f04660SIan Rogersifeq ($(JEVENTS_ARCH),) 11b4f04660SIan RogersJEVENTS_ARCH=$(SRCARCH) 12b4f04660SIan Rogersendif 13b4f04660SIan Rogers 1480eeb67fSAndi Kleen# 1580eeb67fSAndi Kleen# Locate/process JSON files in pmu-events/arch/ 1680eeb67fSAndi Kleen# directory and create tables in pmu-events.c. 1780eeb67fSAndi Kleen# 1800facc76SIan Rogers 1900facc76SIan Rogersifeq ($(NO_JEVENTS),1) 2000facc76SIan Rogers$(OUTPUT)pmu-events/pmu-events.c: pmu-events/empty-pmu-events.c 2100facc76SIan Rogers $(call rule_mkdir) 2200facc76SIan Rogers $(Q)$(call echo-cmd,gen)cp $< $@ 2300facc76SIan Rogerselse 24*40769665SIan Rogers$(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS_PY) pmu-events/metric.py 2500facc76SIan Rogers $(call rule_mkdir) 26b4f04660SIan Rogers $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(JEVENTS_ARCH) pmu-events/arch $@ 2700facc76SIan Rogersendif 28