]>
Commit | Line | Data |
---|---|---|
85c66be1 | 1 | include ../../scripts/Makefile.include |
553873e1 | 2 | include ../../perf/config/utilities.mak # QUIET_CLEAN |
85c66be1 | 3 | |
b4f91668 JO |
4 | ifeq ($(srctree),) |
5 | srctree := $(patsubst %/,%,$(dir $(shell pwd))) | |
6 | srctree := $(patsubst %/,%,$(dir $(srctree))) | |
7 | srctree := $(patsubst %/,%,$(dir $(srctree))) | |
8 | #$(info Determined 'srctree' to be $(srctree)) | |
9 | endif | |
10 | ||
3c4797d4 RV |
11 | CC = $(CROSS_COMPILE)gcc |
12 | AR = $(CROSS_COMPILE)ar | |
13 | ||
b4f91668 | 14 | MAKEFLAGS += --no-print-directory |
85c66be1 | 15 | |
285a8f24 | 16 | LIBFILE = $(OUTPUT)libapi.a |
85c66be1 | 17 | |
b4f91668 | 18 | CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) |
de28c15d | 19 | CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC |
b4f91668 | 20 | CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 |
85c66be1 BP |
21 | |
22 | RM = rm -f | |
23 | ||
b4f91668 | 24 | build := -f $(srctree)/tools/build/Makefile.build dir=. obj |
285a8f24 | 25 | API_IN := $(OUTPUT)libapi-in.o |
85c66be1 | 26 | |
b4f91668 | 27 | export srctree OUTPUT CC LD CFLAGS V |
85c66be1 | 28 | |
b4f91668 | 29 | all: $(LIBFILE) |
553873e1 | 30 | |
b4f91668 | 31 | $(API_IN): FORCE |
285a8f24 | 32 | @$(MAKE) $(build)=libapi |
b4f91668 JO |
33 | |
34 | $(LIBFILE): $(API_IN) | |
35 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(API_IN) | |
85c66be1 BP |
36 | |
37 | clean: | |
285a8f24 | 38 | $(call QUIET_CLEAN, libapi) $(RM) $(LIBFILE); \ |
b4f91668 JO |
39 | find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o | xargs $(RM) |
40 | ||
41 | FORCE: | |
85c66be1 | 42 | |
b4f91668 | 43 | .PHONY: clean FORCE |