Commit | Line | Data |
---|---|---|
4b6ab94e JP |
1 | include ../../scripts/Makefile.include |
2 | include ../../perf/config/utilities.mak # QUIET_CLEAN | |
3 | ||
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 | ||
11 | CC = $(CROSS_COMPILE)gcc | |
12 | AR = $(CROSS_COMPILE)ar | |
13 | RM = rm -f | |
14 | ||
15 | MAKEFLAGS += --no-print-directory | |
16 | ||
17 | LIBFILE = $(OUTPUT)libsubcmd.a | |
18 | ||
19 | CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) | |
20 | CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC | |
21 | CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE | |
22 | ||
23 | CFLAGS += -I$(srctree)/tools/include/ | |
24 | CFLAGS += -I$(srctree)/include/uapi | |
25 | CFLAGS += -I$(srctree)/include | |
26 | ||
27 | SUBCMD_IN := $(OUTPUT)libsubcmd-in.o | |
28 | ||
29 | all: | |
30 | ||
31 | export srctree OUTPUT CC LD CFLAGS V | |
32 | include $(srctree)/tools/build/Makefile.include | |
33 | ||
34 | all: fixdep $(LIBFILE) | |
35 | ||
36 | $(SUBCMD_IN): FORCE | |
37 | @$(MAKE) $(build)=libsubcmd | |
38 | ||
39 | $(LIBFILE): $(SUBCMD_IN) | |
40 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(SUBCMD_IN) | |
41 | ||
42 | clean: | |
43 | $(call QUIET_CLEAN, libsubcmd) $(RM) $(LIBFILE); \ | |
44 | find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) | |
45 | ||
46 | FORCE: | |
47 | ||
48 | .PHONY: clean FORCE |