Commit 7c422f55 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

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: default avatarJiri 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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 324c824a
...@@ -113,6 +113,13 @@ It defines following interface: ...@@ -113,6 +113,13 @@ It defines following interface:
make $(build)=ex make $(build)=ex
Fixdep
------
It is necessary to build the fixdep helper before invoking the build.
The Makefile.include file adds the fixdep target, that could be
invoked by the user.
Rules Rules
----- -----
......
build := -f $(srctree)/tools/build/Makefile.build dir=. obj build := -f $(srctree)/tools/build/Makefile.build dir=. obj
fixdep:
$(Q)$(MAKE) -C $(srctree)/tools/build fixdep
.PHONY: fixdep
...@@ -3,18 +3,20 @@ export CC := gcc ...@@ -3,18 +3,20 @@ export CC := gcc
export LD := ld export LD := ld
export AR := ar export AR := ar
ex:
include $(srctree)/tools/build/Makefile.include include $(srctree)/tools/build/Makefile.include
ex: ex-in.o libex-in.o ex: ex-in.o libex-in.o
gcc -o $@ $^ gcc -o $@ $^
ex.%: FORCE ex.%: fixdep FORCE
make -f $(srctree)/tools/build/Makefile.build dir=. $@ make -f $(srctree)/tools/build/Makefile.build dir=. $@
ex-in.o: FORCE ex-in.o: fixdep FORCE
make $(build)=ex make $(build)=ex
libex-in.o: FORCE libex-in.o: fixdep FORCE
make $(build)=libex make $(build)=libex
clean: clean:
......
...@@ -23,10 +23,12 @@ RM = rm -f ...@@ -23,10 +23,12 @@ RM = rm -f
API_IN := $(OUTPUT)libapi-in.o API_IN := $(OUTPUT)libapi-in.o
all:
export srctree OUTPUT CC LD CFLAGS V export srctree OUTPUT CC LD CFLAGS V
include $(srctree)/tools/build/Makefile.include include $(srctree)/tools/build/Makefile.include
all: $(LIBFILE) all: fixdep $(LIBFILE)
$(API_IN): FORCE $(API_IN): FORCE
@$(MAKE) $(build)=libapi @$(MAKE) $(build)=libapi
......
...@@ -123,6 +123,8 @@ endif ...@@ -123,6 +123,8 @@ endif
# the same command line setup. # the same command line setup.
MAKEOVERRIDES= MAKEOVERRIDES=
all:
export srctree OUTPUT CC LD CFLAGS V export srctree OUTPUT CC LD CFLAGS V
include $(srctree)/tools/build/Makefile.include include $(srctree)/tools/build/Makefile.include
...@@ -133,7 +135,7 @@ CMD_TARGETS = $(LIB_FILE) ...@@ -133,7 +135,7 @@ CMD_TARGETS = $(LIB_FILE)
TARGETS = $(CMD_TARGETS) TARGETS = $(CMD_TARGETS)
all: $(VERSION_FILES) all_cmd all: fixdep $(VERSION_FILES) all_cmd
all_cmd: $(CMD_TARGETS) all_cmd: $(CMD_TARGETS)
......
...@@ -93,6 +93,8 @@ else ...@@ -93,6 +93,8 @@ else
print_install = echo ' INSTALL '$1' to $(DESTDIR_SQ)$2'; print_install = echo ' INSTALL '$1' to $(DESTDIR_SQ)$2';
endif endif
all:
export srctree OUTPUT CC LD CFLAGS V export srctree OUTPUT CC LD CFLAGS V
include $(srctree)/tools/build/Makefile.include include $(srctree)/tools/build/Makefile.include
...@@ -109,7 +111,7 @@ CMD_TARGETS = $(LIB_FILE) ...@@ -109,7 +111,7 @@ CMD_TARGETS = $(LIB_FILE)
TARGETS = $(CMD_TARGETS) TARGETS = $(CMD_TARGETS)
all: all_cmd all: fixdep all_cmd
all_cmd: $(CMD_TARGETS) all_cmd: $(CMD_TARGETS)
......
...@@ -306,7 +306,7 @@ $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST) ...@@ -306,7 +306,7 @@ $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \ $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
$(PERF_IN) $(LIBS) -o $@ $(PERF_IN) $(LIBS) -o $@
$(GTK_IN): FORCE $(GTK_IN): fixdep FORCE
$(Q)$(MAKE) $(build)=gtk $(Q)$(MAKE) $(build)=gtk
$(OUTPUT)libperf-gtk.so: $(GTK_IN) $(PERFLIBS) $(OUTPUT)libperf-gtk.so: $(GTK_IN) $(PERFLIBS)
...@@ -349,7 +349,7 @@ endif ...@@ -349,7 +349,7 @@ endif
__build-dir = $(subst $(OUTPUT),,$(dir $@)) __build-dir = $(subst $(OUTPUT),,$(dir $@))
build-dir = $(if $(__build-dir),$(__build-dir),.) build-dir = $(if $(__build-dir),$(__build-dir),.)
prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h fixdep
$(OUTPUT)%.o: %.c prepare FORCE $(OUTPUT)%.o: %.c prepare FORCE
$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@ $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
...@@ -389,7 +389,7 @@ $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h) ...@@ -389,7 +389,7 @@ $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
LIBPERF_IN := $(OUTPUT)libperf-in.o LIBPERF_IN := $(OUTPUT)libperf-in.o
$(LIBPERF_IN): FORCE $(LIBPERF_IN): fixdep FORCE
$(Q)$(MAKE) $(build)=libperf $(Q)$(MAKE) $(build)=libperf
$(LIB_FILE): $(LIBPERF_IN) $(LIB_FILE): $(LIBPERF_IN)
...@@ -397,10 +397,10 @@ $(LIB_FILE): $(LIBPERF_IN) ...@@ -397,10 +397,10 @@ $(LIB_FILE): $(LIBPERF_IN)
LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ)
$(LIBTRACEEVENT): FORCE $(LIBTRACEEVENT): fixdep FORCE
$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a
libtraceevent_plugins: FORCE libtraceevent_plugins: fixdep FORCE
$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) plugins $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) plugins
$(LIBTRACEEVENT_DYNAMIC_LIST): libtraceevent_plugins $(LIBTRACEEVENT_DYNAMIC_LIST): libtraceevent_plugins
...@@ -413,7 +413,7 @@ $(LIBTRACEEVENT)-clean: ...@@ -413,7 +413,7 @@ $(LIBTRACEEVENT)-clean:
install-traceevent-plugins: $(LIBTRACEEVENT) install-traceevent-plugins: $(LIBTRACEEVENT)
$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) install_plugins $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) install_plugins
$(LIBAPI): FORCE $(LIBAPI): fixdep FORCE
$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) $(OUTPUT)libapi.a $(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) $(OUTPUT)libapi.a
$(LIBAPI)-clean: $(LIBAPI)-clean:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment