macvtap: read vnet_hdr_size once
[linux/fpc-iii.git] / tools / lib / api / Makefile
blob0a6fda9837f7dd3a60a89fbe3083bf8a3835b6f3
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
13 LD = $(CROSS_COMPILE)ld
15 MAKEFLAGS += --no-print-directory
17 LIBFILE = $(OUTPUT)libapi.a
19 CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
20 CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC
22 # Treat warnings as errors unless directed not to
23 ifneq ($(WERROR),0)
24 CFLAGS += -Werror
25 endif
27 CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
28 CFLAGS += -I$(srctree)/tools/lib/api
29 CFLAGS += -I$(srctree)/tools/include
31 RM = rm -f
33 API_IN := $(OUTPUT)libapi-in.o
35 all:
37 export srctree OUTPUT CC LD CFLAGS V
38 include $(srctree)/tools/build/Makefile.include
40 all: fixdep $(LIBFILE)
42 $(API_IN): FORCE
43 @$(MAKE) $(build)=libapi
45 $(LIBFILE): $(API_IN)
46 $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(API_IN)
48 clean:
49 $(call QUIET_CLEAN, libapi) $(RM) $(LIBFILE); \
50 find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM)
52 FORCE:
54 .PHONY: clean FORCE