Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux...
[linux/fpc-iii.git] / tools / lib / api / Makefile
blob316f308a63ea691c4dfb258066a7f6e90bb8b199
1 include ../../scripts/Makefile.include
2 include ../../scripts/utilities.mak # QUIET_CLEAN
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
11 CC = $(CROSS_COMPILE)gcc
12 AR = $(CROSS_COMPILE)ar
14 MAKEFLAGS += --no-print-directory
16 LIBFILE = $(OUTPUT)libapi.a
18 CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
19 CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC
20 CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
21 CFLAGS += -I$(srctree)/tools/lib/api
23 RM = rm -f
25 API_IN := $(OUTPUT)libapi-in.o
27 all:
29 export srctree OUTPUT CC LD CFLAGS V
30 include $(srctree)/tools/build/Makefile.include
32 all: fixdep $(LIBFILE)
34 $(API_IN): FORCE
35 @$(MAKE) $(build)=libapi
37 $(LIBFILE): $(API_IN)
38 $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(API_IN)
40 clean:
41 $(call QUIET_CLEAN, libapi) $(RM) $(LIBFILE); \
42 find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM)
44 FORCE:
46 .PHONY: clean FORCE