2013-02-20 23:32:30 +08:00
|
|
|
include ../../scripts/Makefile.include
|
2013-12-10 00:14:23 +08:00
|
|
|
include ../../perf/config/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
|
|
|
|
|
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
|
2013-02-20 23:32:30 +08:00
|
|
|
|
|
|
|
RM = rm -f
|
|
|
|
|
2015-01-09 23:38:25 +08:00
|
|
|
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
|
2015-01-11 03:53:13 +08:00
|
|
|
API_IN := $(OUTPUT)libapi-in.o
|
2013-02-20 23:32:30 +08:00
|
|
|
|
2015-01-09 23:38:25 +08:00
|
|
|
export srctree OUTPUT CC LD CFLAGS V
|
2013-02-20 23:32:30 +08:00
|
|
|
|
2015-01-09 23:38:25 +08:00
|
|
|
all: $(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
|