Makefile 1.0 KB
Newer Older
1
include ../../scripts/Makefile.include
2
include ../../perf/config/utilities.mak		# QUIET_CLEAN
3

4 5 6 7 8 9 10
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree))
endif

11 12 13
CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar

14
MAKEFLAGS += --no-print-directory
15

16
LIBFILE = $(OUTPUT)libapi.a
17

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 22 23

RM = rm -f

24
API_IN := $(OUTPUT)libapi-in.o
25

26
export srctree OUTPUT CC LD CFLAGS V
J
Jiri Olsa 已提交
27
include $(srctree)/tools/build/Makefile.include
28

29
all: $(LIBFILE)
30

31
$(API_IN): FORCE
32
	@$(MAKE) $(build)=libapi
33 34 35

$(LIBFILE): $(API_IN)
	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(API_IN)
36 37

clean:
38
	$(call QUIET_CLEAN, libapi) $(RM) $(LIBFILE); \
R
Riku Voipio 已提交
39
	find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM)
40 41

FORCE:
42

43
.PHONY: clean FORCE