xref: /openbmc/linux/tools/perf/pmu-events/Build (revision 00facc76)
180eeb67fSAndi Kleenhostprogs := jevents
280eeb67fSAndi Kleen
380eeb67fSAndi Kleenjevents-y	+= json.o jsmn.o jevents.o
46fdbd824SLaura AbbottHOSTCFLAGS_jevents.o	= -I$(srctree)/tools/include
580eeb67fSAndi Kleenpmu-events-y	+= pmu-events.o
67a759cd8SJiada WangJDIR		=  pmu-events/arch/$(SRCARCH)
780eeb67fSAndi KleenJSON		=  $(shell [ -d $(JDIR) ] &&				\
880eeb67fSAndi Kleen			find $(JDIR) -name '*.json' -o -name 'mapfile.csv')
9517db3b5SJohn GarryJDIR_TEST	=  pmu-events/arch/test
10517db3b5SJohn GarryJSON_TEST	=  $(shell [ -d $(JDIR_TEST) ] &&			\
11517db3b5SJohn Garry			find $(JDIR_TEST) -name '*.json')
12*00facc76SIan RogersJEVENTS_PY	=  pmu-events/jevents.py
13e9d32c1bSJohn Garry
1480eeb67fSAndi Kleen#
1580eeb67fSAndi Kleen# Locate/process JSON files in pmu-events/arch/
1680eeb67fSAndi Kleen# directory and create tables in pmu-events.c.
1780eeb67fSAndi Kleen#
18*00facc76SIan Rogers
19*00facc76SIan Rogersifeq ($(NO_JEVENTS),1)
20*00facc76SIan Rogers$(OUTPUT)pmu-events/pmu-events.c: pmu-events/empty-pmu-events.c
21*00facc76SIan Rogers	$(call rule_mkdir)
22*00facc76SIan Rogers	$(Q)$(call echo-cmd,gen)cp $< $@
23*00facc76SIan Rogerselse
24*00facc76SIan Rogers$(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS_PY)
25*00facc76SIan Rogers	$(call rule_mkdir)
26*00facc76SIan Rogers	$(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(SRCARCH) pmu-events/arch $@
27*00facc76SIan Rogersendif
28