Skip to content

Commit

Permalink
perf tools: Remove auto-generated bison/flex files
Browse files Browse the repository at this point in the history
These should not be in the Git history - they are auto-generated.

Extend the Makefile rules of the parser files to include the generation
run.

Signed-off-by: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
[ committer note: Fixed up O= handling ]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
Ingo Molnar authored and acmel committed Mar 30, 2012
1 parent 64c17be commit 65f3e56
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 8,476 deletions.
47 changes: 30 additions & 17 deletions tools/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \

CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
FLEX = $(CROSS_COMPILE)flex
BISON= $(CROSS_COMPILE)bison

# Additional ARCH settings for x86
ifeq ($(ARCH),i386)
Expand Down Expand Up @@ -184,7 +182,7 @@ endif

### --- END CONFIGURATION SECTION ---

BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)/util -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
BASIC_LDFLAGS =

# Guard against environment variables
Expand Down Expand Up @@ -236,6 +234,25 @@ endif

export PERL_PATH

FLEX = $(CROSS_COMPILE)flex
BISON= $(CROSS_COMPILE)bison

event-parser:
$(QUIET_BISON)$(BISON) -v util/parse-events.y -d -o $(OUTPUT)util/parse-events-bison.c
$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c

$(OUTPUT)util/parse-events-flex.c: event-parser
$(OUTPUT)util/parse-events-bison.c: event-parser

pmu-parser:
$(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c
$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c

$(OUTPUT)util/pmu-flex.c: pmu-parser
$(OUTPUT)util/pmu-bison.c: pmu-parser

$(OUTPUT)util/parse-events.o: event-parser pmu-parser

LIB_FILE=$(OUTPUT)libperf.a

LIB_H += ../../include/linux/perf_event.h
Expand Down Expand Up @@ -754,6 +771,15 @@ $(OUTPUT)perf.o perf.spec \
.SUFFIXES:
.SUFFIXES: .o .c .S .s

# These two need to be here so that when O= is not used they take precedence
# over the general rule for .o

$(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<

$(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<

$(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
$(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS
Expand Down Expand Up @@ -790,12 +816,6 @@ $(OUTPUT)util/ui/browsers/map.o: util/ui/browsers/map.c $(OUTPUT)PERF-CFLAGS
$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<

$(OUTPUT)util/parse-events-flex.o: util/parse-events-flex.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<

$(OUTPUT)util/pmu-flex.o: util/pmu-flex.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<

$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<

Expand Down Expand Up @@ -883,14 +903,6 @@ cscope:
$(RM) cscope*
$(FIND) . -name '*.[hcS]' -print | xargs cscope -b

event-parser:
$(QUIET_BISON)$(BISON) -v util/parse-events.y -d -o util/parse-events-bison.c
$(QUIET_FLEX)$(FLEX) --header-file=util/parse-events-flex.h -t util/parse-events.l > util/parse-events-flex.c

pmu-parser:
$(QUIET_BISON)$(BISON) -v util/pmu.y -d -o util/pmu-bison.c
$(QUIET_FLEX)$(FLEX) --header-file=util/pmu-flex.h -t util/pmu.l > util/pmu-flex.c

### Detect prefix changes
TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\
$(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
Expand Down Expand Up @@ -978,6 +990,7 @@ clean:
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope*
$(MAKE) -C Documentation/ clean
$(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS
$(RM) $(OUTPUT)util/*-{bison,flex}*
$(python-clean)

.PHONY: all install clean strip
Expand Down
Loading

0 comments on commit 65f3e56

Please sign in to comment.