tools/: Convert to new topic libraries
Move debugfs.* to api/fs/. We have a common tools/lib/api/ place where the Makefile lives and then we place the headers in subdirs. For example, all the fs-related stuff goes to tools/lib/api/fs/ from which we get libapikfs.a (acme got almost the naming he wanted :-)) and we link it into the tools which need it - in this case perf and tools/vm/page-types. acme: "Looking at the implementation, I think some tools can even link directly to the .o files, avoiding the .a file altogether. But that is just an optimization/finer granularity tools/lib/ cherrypicking that toolers can make use of." Fixup documentation cleaning target while at it. Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Ingo Molnar <mingo@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Robert Richter <rric@kernel.org> Cc: Stanislav Fomichev <stfomichev@yandex-team.ru> Cc: Stephane Eranian <eranian@google.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386605664-24041-2-git-send-email-bp@alien8.de Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

parent
b283d2f3b7
commit
553873e1df
@@ -1,4 +1,5 @@
|
||||
include ../../scripts/Makefile.include
|
||||
include ../../perf/config/utilities.mak # QUIET_CLEAN
|
||||
|
||||
CC = $(CROSS_COMPILE)gcc
|
||||
AR = $(CROSS_COMPILE)ar
|
||||
@@ -7,11 +8,11 @@ AR = $(CROSS_COMPILE)ar
|
||||
LIB_H=
|
||||
LIB_OBJS=
|
||||
|
||||
LIB_H += debugfs.h
|
||||
LIB_H += fs/debugfs.h
|
||||
|
||||
LIB_OBJS += $(OUTPUT)debugfs.o
|
||||
LIB_OBJS += $(OUTPUT)fs/debugfs.o
|
||||
|
||||
LIBFILE = liblk.a
|
||||
LIBFILE = libapikfs.a
|
||||
|
||||
CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
|
||||
EXTLIBS = -lelf -lpthread -lrt -lm
|
||||
@@ -25,14 +26,17 @@ $(LIBFILE): $(LIB_OBJS)
|
||||
|
||||
$(LIB_OBJS): $(LIB_H)
|
||||
|
||||
$(OUTPUT)%.o: %.c
|
||||
libapi_dirs:
|
||||
$(QUIET_MKDIR)mkdir -p $(OUTPUT)fs/
|
||||
|
||||
$(OUTPUT)%.o: %.c libapi_dirs
|
||||
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
|
||||
$(OUTPUT)%.s: %.c
|
||||
$(OUTPUT)%.s: %.c libapi_dirs
|
||||
$(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
|
||||
$(OUTPUT)%.o: %.S
|
||||
$(OUTPUT)%.o: %.S libapi_dirs
|
||||
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
|
||||
|
||||
clean:
|
||||
$(RM) $(LIB_OBJS) $(LIBFILE)
|
||||
$(call QUIET_CLEAN, libapi) $(RM) $(LIB_OBJS) $(LIBFILE)
|
||||
|
||||
.PHONY: clean
|
@@ -1,5 +1,5 @@
|
||||
#ifndef __LK_DEBUGFS_H__
|
||||
#define __LK_DEBUGFS_H__
|
||||
#ifndef __API_DEBUGFS_H__
|
||||
#define __API_DEBUGFS_H__
|
||||
|
||||
#define _STR(x) #x
|
||||
#define STR(x) _STR(x)
|
||||
@@ -26,4 +26,4 @@ char *debugfs_mount(const char *mountpoint);
|
||||
|
||||
extern char debugfs_mountpoint[];
|
||||
|
||||
#endif /* __LK_DEBUGFS_H__ */
|
||||
#endif /* __API_DEBUGFS_H__ */
|
Reference in New Issue
Block a user