[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-xjo8r7nuqy9mvlfrmx9zcfwb@git.kernel.org>
Date: Wed, 18 Feb 2015 10:40:01 -0800
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: namhyung@...nel.org, linux-kernel@...r.kernel.org,
jolsa@...nel.org, paulus@...ba.org, alexis.berlemont@...il.com,
fweisbec@...il.com, mingo@...nel.org, bp@...en8.de,
eranian@...gle.com, tglx@...utronix.de, will.deacon@....com,
dsahern@...il.com, hpa@...or.com, acme@...hat.com,
cjashfor@...ux.vnet.ibm.com, sukadev@...ux.vnet.ibm.com,
peterz@...radead.org
Subject: [tip:perf/core] tools lib api: Use tools build framework
Commit-ID: b4f9166847354cb839c275c062c6b17afba49211
Gitweb: http://git.kernel.org/tip/b4f9166847354cb839c275c062c6b17afba49211
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Fri, 9 Jan 2015 16:38:25 +0100
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 12 Feb 2015 17:54:39 -0300
tools lib api: Use tools build framework
Move the libapikfs library building under tools build framework.
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Tested-by: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
Tested-by: Will Deacon <will.deacon@....com>
Cc: Alexis Berlemont <alexis.berlemont@...il.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Corey Ashford <cjashfor@...ux.vnet.ibm.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/n/tip-xjo8r7nuqy9mvlfrmx9zcfwb@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/lib/api/Build | 2 ++
tools/lib/api/Makefile | 62 ++++++++++++++++++++----------------------------
tools/lib/api/fd/Build | 1 +
tools/lib/api/fs/Build | 4 ++++
tools/perf/Makefile.perf | 12 ++--------
5 files changed, 35 insertions(+), 46 deletions(-)
diff --git a/tools/lib/api/Build b/tools/lib/api/Build
new file mode 100644
index 0000000..64dd8d4
--- /dev/null
+++ b/tools/lib/api/Build
@@ -0,0 +1,2 @@
+libapikfs-y += fd/
+libapikfs-y += fs/
diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile
index 212aa4f..1aa47c2 100644
--- a/tools/lib/api/Makefile
+++ b/tools/lib/api/Makefile
@@ -1,53 +1,43 @@
include ../../scripts/Makefile.include
include ../../perf/config/utilities.mak # QUIET_CLEAN
+ifeq ($(srctree),)
+srctree := $(patsubst %/,%,$(dir $(shell pwd)))
+srctree := $(patsubst %/,%,$(dir $(srctree)))
+srctree := $(patsubst %/,%,$(dir $(srctree)))
+#$(info Determined 'srctree' to be $(srctree))
+endif
+
CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
-# guard against environment variables
-LIB_H=
-LIB_OBJS=
-
-LIB_H += fs/debugfs.h
-LIB_H += fs/tracefs.h
-LIB_H += fs/findfs.h
-LIB_H += fs/fs.h
-# See comment below about piggybacking...
-LIB_H += fd/array.h
-
-LIB_OBJS += $(OUTPUT)fs/debugfs.o
-LIB_OBJS += $(OUTPUT)fs/tracefs.o
-LIB_OBJS += $(OUTPUT)fs/findfs.o
-LIB_OBJS += $(OUTPUT)fs/fs.o
-# XXX piggybacking here, need to introduce libapikfd, or rename this
-# to plain libapik.a and make it have it all api goodies
-LIB_OBJS += $(OUTPUT)fd/array.o
+MAKEFLAGS += --no-print-directory
-LIBFILE = libapikfs.a
+LIBFILE = $(OUTPUT)libapikfs.a
-CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
-EXTLIBS = -lelf -lpthread -lrt -lm
-ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-ALL_LDFLAGS = $(LDFLAGS)
+CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
+CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 -fPIC
+CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
RM = rm -f
-$(LIBFILE): $(LIB_OBJS)
- $(QUIET_AR)$(RM) $@ && $(AR) rcs $(OUTPUT)$@ $(LIB_OBJS)
+build := -f $(srctree)/tools/build/Makefile.build dir=. obj
+API_IN := $(OUTPUT)libapikfs-in.o
-$(LIB_OBJS): $(LIB_H)
+export srctree OUTPUT CC LD CFLAGS V
-libapi_dirs:
- $(QUIET_MKDIR)mkdir -p $(OUTPUT)fd $(OUTPUT)fs
+all: $(LIBFILE)
-$(OUTPUT)%.o: %.c libapi_dirs
- $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
-$(OUTPUT)%.s: %.c libapi_dirs
- $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
-$(OUTPUT)%.o: %.S libapi_dirs
- $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
+$(API_IN): FORCE
+ @$(MAKE) $(build)=libapikfs
+
+$(LIBFILE): $(API_IN)
+ $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(API_IN)
clean:
- $(call QUIET_CLEAN, libapi) $(RM) $(LIB_OBJS) $(LIBFILE)
+ $(call QUIET_CLEAN, libapikfs) $(RM) $(LIBFILE); \
+ find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o | xargs $(RM)
+
+FORCE:
-.PHONY: clean
+.PHONY: clean FORCE
diff --git a/tools/lib/api/fd/Build b/tools/lib/api/fd/Build
new file mode 100644
index 0000000..4ddcb0f
--- /dev/null
+++ b/tools/lib/api/fd/Build
@@ -0,0 +1 @@
+libapikfs-y += array.o
diff --git a/tools/lib/api/fs/Build b/tools/lib/api/fs/Build
new file mode 100644
index 0000000..5f0fe4d
--- /dev/null
+++ b/tools/lib/api/fs/Build
@@ -0,0 +1,4 @@
+libapikfs-y += fs.o
+libapikfs-y += findfs.o
+libapikfs-y += debugfs.o
+libapikfs-y += tracefs.o
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 710731b..cc733ac 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -375,20 +375,12 @@ $(LIBTRACEEVENT)-clean:
install-traceevent-plugins: $(LIBTRACEEVENT)
$(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) install_plugins
-LIBAPIKFS_SOURCES = $(wildcard $(LIB_PATH)fs/*.[ch] $(LIB_PATH)fd/*.[ch])
-
-# if subdir is set, we've been called from above so target has been built
-# already
-$(LIBAPIKFS): $(LIBAPIKFS_SOURCES)
-ifeq ($(subdir),)
- $(QUIET_SUBDIR0)$(LIB_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) libapikfs.a
-endif
+$(LIBAPIKFS): FORCE
+ @$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) $(OUTPUT)libapikfs.a
$(LIBAPIKFS)-clean:
-ifeq ($(subdir),)
$(call QUIET_CLEAN, libapikfs)
@$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
-endif
help:
@echo 'Perf make targets:'
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists