1include ../../scripts/Makefile.include 2include ../../scripts/utilities.mak # QUIET_CLEAN 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 11CC = $(CROSS_COMPILE)gcc 12AR = $(CROSS_COMPILE)ar 13LD = $(CROSS_COMPILE)ld 14 15MAKEFLAGS += --no-print-directory 16 17LIBFILE = $(OUTPUT)libapi.a 18 19CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) 20CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC 21CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 22CFLAGS += -I$(srctree)/tools/lib/api 23 24RM = rm -f 25 26API_IN := $(OUTPUT)libapi-in.o 27 28all: 29 30export srctree OUTPUT CC LD CFLAGS V 31include $(srctree)/tools/build/Makefile.include 32 33all: fixdep $(LIBFILE) 34 35$(API_IN): FORCE 36 @$(MAKE) $(build)=libapi 37 38$(LIBFILE): $(API_IN) 39 $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(API_IN) 40 41clean: 42 $(call QUIET_CLEAN, libapi) $(RM) $(LIBFILE); \ 43 find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) 44 45FORCE: 46 47.PHONY: clean FORCE 48