2013-02-20 23:32:30 +08:00
|
|
|
include ../../scripts/Makefile.include
|
2016-03-19 00:57:20 +08:00
|
|
|
include ../../scripts/utilities.mak # QUIET_CLEAN
|
2013-02-20 23:32:30 +08:00
|
|
|
|
2015-01-09 23:38:25 +08:00
|
|
|
ifeq ($(srctree),)
|
|
|
|
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
|
|
|
|
srctree := $(patsubst %/,%,$(dir $(srctree)))
|
|
|
|
srctree := $(patsubst %/,%,$(dir $(srctree)))
|
|
|
|
#$(info Determined 'srctree' to be $(srctree))
|
|
|
|
endif
|
|
|
|
|
2013-05-18 04:27:44 +08:00
|
|
|
CC = $(CROSS_COMPILE)gcc
|
|
|
|
AR = $(CROSS_COMPILE)ar
|
2016-03-18 01:27:50 +08:00
|
|
|
LD = $(CROSS_COMPILE)ld
|
2013-05-18 04:27:44 +08:00
|
|
|
|
2015-01-09 23:38:25 +08:00
|
|
|
MAKEFLAGS += --no-print-directory
|
2013-02-20 23:32:30 +08:00
|
|
|
|
2015-01-11 03:53:13 +08:00
|
|
|
LIBFILE = $(OUTPUT)libapi.a
|
2013-02-20 23:32:30 +08:00
|
|
|
|
2015-01-09 23:38:25 +08:00
|
|
|
CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
|
2015-04-22 07:19:41 +08:00
|
|
|
CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC
|
2015-01-09 23:38:25 +08:00
|
|
|
CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
2016-02-15 00:03:42 +08:00
|
|
|
CFLAGS += -I$(srctree)/tools/lib/api
|
2013-02-20 23:32:30 +08:00
|
|
|
|
|
|
|
RM = rm -f
|
|
|
|
|
2015-01-11 03:53:13 +08:00
|
|
|
API_IN := $(OUTPUT)libapi-in.o
|
2013-02-20 23:32:30 +08:00
|
|
|
|
2015-09-23 18:34:02 +08:00
|
|
|
all:
|
|
|
|
|
2015-01-09 23:38:25 +08:00
|
|
|
export srctree OUTPUT CC LD CFLAGS V
|
2015-09-23 18:33:56 +08:00
|
|
|
include $(srctree)/tools/build/Makefile.include
|
2013-02-20 23:32:30 +08:00
|
|
|
|
2015-09-23 18:34:02 +08:00
|
|
|
all: fixdep $(LIBFILE)
|
2013-12-10 00:14:23 +08:00
|
|
|
|
2015-01-09 23:38:25 +08:00
|
|
|
$(API_IN): FORCE
|
2015-01-11 03:53:13 +08:00
|
|
|
@$(MAKE) $(build)=libapi
|
2015-01-09 23:38:25 +08:00
|
|
|
|
|
|
|
$(LIBFILE): $(API_IN)
|
|
|
|
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(API_IN)
|
2013-02-20 23:32:30 +08:00
|
|
|
|
|
|
|
clean:
|
2015-01-11 03:53:13 +08:00
|
|
|
$(call QUIET_CLEAN, libapi) $(RM) $(LIBFILE); \
|
2015-06-18 20:52:18 +08:00
|
|
|
find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM)
|
2015-01-09 23:38:25 +08:00
|
|
|
|
|
|
|
FORCE:
|
2013-02-20 23:32:30 +08:00
|
|
|
|
2015-01-09 23:38:25 +08:00
|
|
|
.PHONY: clean FORCE
|