mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
tools lib api: Use tools build framework
Move the libapikfs library building under tools build framework. Signed-off-by: Jiri Olsa <[email protected]> Tested-by: Sukadev Bhattiprolu <[email protected]> Tested-by: Will Deacon <[email protected]> Cc: Alexis Berlemont <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Corey Ashford <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
f819f703a4
commit
b4f9166847
5 changed files with 35 additions and 46 deletions
2
tools/lib/api/Build
Normal file
2
tools/lib/api/Build
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
libapikfs-y += fd/
|
||||
libapikfs-y += fs/
|
||||
|
|
@ -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=
|
||||
MAKEFLAGS += --no-print-directory
|
||||
|
||||
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
|
||||
LIBFILE = $(OUTPUT)libapikfs.a
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
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)
|
||||
|
||||
.PHONY: clean
|
||||
FORCE:
|
||||
|
||||
.PHONY: clean FORCE
|
||||
|
|
|
|||
1
tools/lib/api/fd/Build
Normal file
1
tools/lib/api/fd/Build
Normal file
|
|
@ -0,0 +1 @@
|
|||
libapikfs-y += array.o
|
||||
4
tools/lib/api/fs/Build
Normal file
4
tools/lib/api/fs/Build
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
libapikfs-y += fs.o
|
||||
libapikfs-y += findfs.o
|
||||
libapikfs-y += debugfs.o
|
||||
libapikfs-y += tracefs.o
|
||||
Loading…
Reference in a new issue