aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2015-01-09 10:38:25 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-02-12 15:54:39 -0500
commitb4f9166847354cb839c275c062c6b17afba49211 (patch)
treef06b122fd7db299d60c31ba918ad683f89b2761f /tools/lib
parentf819f703a42eed63443cef796b1852e6baf985bd (diff)
tools lib api: Use tools build framework
Move the libapikfs library building under tools build framework. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Tested-by: Will Deacon <will.deacon@arm.com> Cc: Alexis Berlemont <alexis.berlemont@gmail.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-xjo8r7nuqy9mvlfrmx9zcfwb@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/api/Build2
-rw-r--r--tools/lib/api/Makefile62
-rw-r--r--tools/lib/api/fd/Build1
-rw-r--r--tools/lib/api/fs/Build4
4 files changed, 33 insertions, 36 deletions
diff --git a/tools/lib/api/Build b/tools/lib/api/Build
new file mode 100644
index 000000000000..64dd8d466d2c
--- /dev/null
+++ b/tools/lib/api/Build
@@ -0,0 +1,2 @@
1libapikfs-y += fd/
2libapikfs-y += fs/
diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile
index 212aa4fd65a0..1aa47c271313 100644
--- a/tools/lib/api/Makefile
+++ b/tools/lib/api/Makefile
@@ -1,53 +1,43 @@
1include ../../scripts/Makefile.include 1include ../../scripts/Makefile.include
2include ../../perf/config/utilities.mak # QUIET_CLEAN 2include ../../perf/config/utilities.mak # QUIET_CLEAN
3 3
4ifeq ($(srctree),)
5srctree := $(patsubst %/,%,$(dir $(shell pwd)))
6srctree := $(patsubst %/,%,$(dir $(srctree)))
7srctree := $(patsubst %/,%,$(dir $(srctree)))
8#$(info Determined 'srctree' to be $(srctree))
9endif
10
4CC = $(CROSS_COMPILE)gcc 11CC = $(CROSS_COMPILE)gcc
5AR = $(CROSS_COMPILE)ar 12AR = $(CROSS_COMPILE)ar
6 13
7# guard against environment variables 14MAKEFLAGS += --no-print-directory
8LIB_H=
9LIB_OBJS=
10
11LIB_H += fs/debugfs.h
12LIB_H += fs/tracefs.h
13LIB_H += fs/findfs.h
14LIB_H += fs/fs.h
15# See comment below about piggybacking...
16LIB_H += fd/array.h
17
18LIB_OBJS += $(OUTPUT)fs/debugfs.o
19LIB_OBJS += $(OUTPUT)fs/tracefs.o
20LIB_OBJS += $(OUTPUT)fs/findfs.o
21LIB_OBJS += $(OUTPUT)fs/fs.o
22# XXX piggybacking here, need to introduce libapikfd, or rename this
23# to plain libapik.a and make it have it all api goodies
24LIB_OBJS += $(OUTPUT)fd/array.o
25 15
26LIBFILE = libapikfs.a 16LIBFILE = $(OUTPUT)libapikfs.a
27 17
28CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC 18CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
29EXTLIBS = -lelf -lpthread -lrt -lm 19CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 -fPIC
30ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 20CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
31ALL_LDFLAGS = $(LDFLAGS)
32 21
33RM = rm -f 22RM = rm -f
34 23
35$(LIBFILE): $(LIB_OBJS) 24build := -f $(srctree)/tools/build/Makefile.build dir=. obj
36 $(QUIET_AR)$(RM) $@ && $(AR) rcs $(OUTPUT)$@ $(LIB_OBJS) 25API_IN := $(OUTPUT)libapikfs-in.o
37 26
38$(LIB_OBJS): $(LIB_H) 27export srctree OUTPUT CC LD CFLAGS V
39 28
40libapi_dirs: 29all: $(LIBFILE)
41 $(QUIET_MKDIR)mkdir -p $(OUTPUT)fd $(OUTPUT)fs
42 30
43$(OUTPUT)%.o: %.c libapi_dirs 31$(API_IN): FORCE
44 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< 32 @$(MAKE) $(build)=libapikfs
45$(OUTPUT)%.s: %.c libapi_dirs 33
46 $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $< 34$(LIBFILE): $(API_IN)
47$(OUTPUT)%.o: %.S libapi_dirs 35 $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(API_IN)
48 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
49 36
50clean: 37clean:
51 $(call QUIET_CLEAN, libapi) $(RM) $(LIB_OBJS) $(LIBFILE) 38 $(call QUIET_CLEAN, libapikfs) $(RM) $(LIBFILE); \
39 find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o | xargs $(RM)
40
41FORCE:
52 42
53.PHONY: clean 43.PHONY: clean FORCE
diff --git a/tools/lib/api/fd/Build b/tools/lib/api/fd/Build
new file mode 100644
index 000000000000..4ddcb0ff7f49
--- /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 000000000000..5f0fe4dfaae6
--- /dev/null
+++ b/tools/lib/api/fs/Build
@@ -0,0 +1,4 @@
1libapikfs-y += fs.o
2libapikfs-y += findfs.o
3libapikfs-y += debugfs.o
4libapikfs-y += tracefs.o