Skip to content

Commit 7c422f5

Browse files
olsajiriacmel
authored andcommitted
tools build: Build fixdep helper from perf and basic libs
Adding the fixdep target into the Makefile.include to ease up building of fixdep helper, that needs to be built before we dive in to the build itself. The user can invoke the fixdep target to build the helper. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1443004442-32660-8-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 324c824 commit 7c422f5

7 files changed

Lines changed: 32 additions & 12 deletions

File tree

‎tools/build/Documentation/Build.txt‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ It defines following interface:
113113
make $(build)=ex
114114

115115

116+
Fixdep
117+
------
118+
It is necessary to build the fixdep helper before invoking the build.
119+
The Makefile.include file adds the fixdep target, that could be
120+
invoked by the user.
121+
122+
116123
Rules
117124
-----
118125

‎tools/build/Makefile.include‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
2+
3+
fixdep:
4+
$(Q)$(MAKE) -C $(srctree)/tools/build fixdep
5+
6+
.PHONY: fixdep

‎tools/build/tests/ex/Makefile‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@ export CC := gcc
33
export LD := ld
44
export AR := ar
55

6+
ex:
7+
68
include $(srctree)/tools/build/Makefile.include
79

810
ex: ex-in.o libex-in.o
911
gcc -o $@ $^
1012

11-
ex.%: FORCE
13+
ex.%: fixdep FORCE
1214
make -f $(srctree)/tools/build/Makefile.build dir=. $@
1315

14-
ex-in.o: FORCE
16+
ex-in.o: fixdep FORCE
1517
make $(build)=ex
1618

17-
libex-in.o: FORCE
19+
libex-in.o: fixdep FORCE
1820
make $(build)=libex
1921

2022
clean:

‎tools/lib/api/Makefile‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ RM = rm -f
2323

2424
API_IN := $(OUTPUT)libapi-in.o
2525

26+
all:
27+
2628
export srctree OUTPUT CC LD CFLAGS V
2729
include $(srctree)/tools/build/Makefile.include
2830

29-
all: $(LIBFILE)
31+
all: fixdep $(LIBFILE)
3032

3133
$(API_IN): FORCE
3234
@$(MAKE) $(build)=libapi

‎tools/lib/bpf/Makefile‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ endif
123123
# the same command line setup.
124124
MAKEOVERRIDES=
125125

126+
all:
127+
126128
export srctree OUTPUT CC LD CFLAGS V
127129
include $(srctree)/tools/build/Makefile.include
128130

@@ -133,7 +135,7 @@ CMD_TARGETS = $(LIB_FILE)
133135

134136
TARGETS = $(CMD_TARGETS)
135137

136-
all: $(VERSION_FILES) all_cmd
138+
all: fixdep $(VERSION_FILES) all_cmd
137139

138140
all_cmd: $(CMD_TARGETS)
139141

‎tools/lib/lockdep/Makefile‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ else
9393
print_install = echo ' INSTALL '$1' to $(DESTDIR_SQ)$2';
9494
endif
9595

96+
all:
97+
9698
export srctree OUTPUT CC LD CFLAGS V
9799
include $(srctree)/tools/build/Makefile.include
98100

@@ -109,7 +111,7 @@ CMD_TARGETS = $(LIB_FILE)
109111
TARGETS = $(CMD_TARGETS)
110112

111113

112-
all: all_cmd
114+
all: fixdep all_cmd
113115

114116
all_cmd: $(CMD_TARGETS)
115117

‎tools/perf/Makefile.perf‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
306306
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
307307
$(PERF_IN) $(LIBS) -o $@
308308

309-
$(GTK_IN): FORCE
309+
$(GTK_IN): fixdep FORCE
310310
$(Q)$(MAKE) $(build)=gtk
311311

312312
$(OUTPUT)libperf-gtk.so: $(GTK_IN) $(PERFLIBS)
@@ -349,7 +349,7 @@ endif
349349
__build-dir = $(subst $(OUTPUT),,$(dir $@))
350350
build-dir = $(if $(__build-dir),$(__build-dir),.)
351351

352-
prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
352+
prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h fixdep
353353

354354
$(OUTPUT)%.o: %.c prepare FORCE
355355
$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
@@ -389,18 +389,18 @@ $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
389389

390390
LIBPERF_IN := $(OUTPUT)libperf-in.o
391391

392-
$(LIBPERF_IN): FORCE
392+
$(LIBPERF_IN): fixdep FORCE
393393
$(Q)$(MAKE) $(build)=libperf
394394

395395
$(LIB_FILE): $(LIBPERF_IN)
396396
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS)
397397

398398
LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ)
399399

400-
$(LIBTRACEEVENT): FORCE
400+
$(LIBTRACEEVENT): fixdep FORCE
401401
$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a
402402

403-
libtraceevent_plugins: FORCE
403+
libtraceevent_plugins: fixdep FORCE
404404
$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) plugins
405405

406406
$(LIBTRACEEVENT_DYNAMIC_LIST): libtraceevent_plugins
@@ -413,7 +413,7 @@ $(LIBTRACEEVENT)-clean:
413413
install-traceevent-plugins: $(LIBTRACEEVENT)
414414
$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) install_plugins
415415

416-
$(LIBAPI): FORCE
416+
$(LIBAPI): fixdep FORCE
417417
$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) $(OUTPUT)libapi.a
418418

419419
$(LIBAPI)-clean:

0 commit comments

Comments
 (0)