2013-02-20 08:32:30 -07:00
|
|
|
include ../../scripts/Makefile.include
|
2013-12-09 09:14:23 -07:00
|
|
|
include ../../perf/config/utilities.mak # QUIET_CLEAN
|
2013-02-20 08:32:30 -07:00
|
|
|
|
2015-01-09 08:38:25 -07: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-17 14:27:44 -06:00
|
|
|
CC = $(CROSS_COMPILE)gcc
|
|
|
|
AR = $(CROSS_COMPILE)ar
|
|
|
|
|
2015-01-09 08:38:25 -07:00
|
|
|
MAKEFLAGS += --no-print-directory
|
2013-02-20 08:32:30 -07:00
|
|
|
|
2015-01-10 12:53:13 -07:00
|
|
|
LIBFILE = $(OUTPUT)libapi.a
|
2013-02-20 08:32:30 -07:00
|
|
|
|
2015-01-09 08:38:25 -07:00
|
|
|
CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
|
2015-04-21 17:19:41 -06:00
|
|
|
CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC
|
2015-01-09 08:38:25 -07:00
|
|
|
CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
2013-02-20 08:32:30 -07:00
|
|
|
|
|
|
|
RM = rm -f
|
|
|
|
|
2015-01-09 08:38:25 -07:00
|
|
|
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
|
2015-01-10 12:53:13 -07:00
|
|
|
API_IN := $(OUTPUT)libapi-in.o
|
2013-02-20 08:32:30 -07:00
|
|
|
|
2015-01-09 08:38:25 -07:00
|
|
|
export srctree OUTPUT CC LD CFLAGS V
|
2013-02-20 08:32:30 -07:00
|
|
|
|
2015-01-09 08:38:25 -07:00
|
|
|
all: $(LIBFILE)
|
2013-12-09 09:14:23 -07:00
|
|
|
|
2015-01-09 08:38:25 -07:00
|
|
|
$(API_IN): FORCE
|
2015-01-10 12:53:13 -07:00
|
|
|
@$(MAKE) $(build)=libapi
|
2015-01-09 08:38:25 -07:00
|
|
|
|
|
|
|
$(LIBFILE): $(API_IN)
|
|
|
|
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(API_IN)
|
2013-02-20 08:32:30 -07:00
|
|
|
|
|
|
|
clean:
|
2015-01-10 12:53:13 -07:00
|
|
|
$(call QUIET_CLEAN, libapi) $(RM) $(LIBFILE); \
|
2015-06-18 06:52:18 -06:00
|
|
|
find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM)
|
2015-01-09 08:38:25 -07:00
|
|
|
|
|
|
|
FORCE:
|
2013-02-20 08:32:30 -07:00
|
|
|
|
2015-01-09 08:38:25 -07:00
|
|
|
.PHONY: clean FORCE
|