diff options
author | Sage Weil <sage@inktank.com> | 2013-08-15 14:11:45 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-08-15 14:11:45 -0400 |
commit | ee3e542fec6e69bc9fb668698889a37d93950ddf (patch) | |
tree | e74ee766a4764769ef1d3d45d266b4dea64101d3 /tools/lib | |
parent | fe2a801b50c0bb8039d627e5ae1fec249d10ff39 (diff) | |
parent | f1d6e17f540af37bb1891480143669ba7636c4cf (diff) |
Merge remote-tracking branch 'linus/master' into testing
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/lk/Makefile | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tools/lib/lk/Makefile b/tools/lib/lk/Makefile index 926cbf3efc7f..280dd8205430 100644 --- a/tools/lib/lk/Makefile +++ b/tools/lib/lk/Makefile | |||
@@ -1,5 +1,23 @@ | |||
1 | include ../../scripts/Makefile.include | 1 | include ../../scripts/Makefile.include |
2 | 2 | ||
3 | CC = $(CROSS_COMPILE)gcc | ||
4 | AR = $(CROSS_COMPILE)ar | ||
5 | |||
6 | # Makefiles suck: This macro sets a default value of $(2) for the | ||
7 | # variable named by $(1), unless the variable has been set by | ||
8 | # environment or command line. This is necessary for CC and AR | ||
9 | # because make sets default values, so the simpler ?= approach | ||
10 | # won't work as expected. | ||
11 | define allow-override | ||
12 | $(if $(or $(findstring environment,$(origin $(1))),\ | ||
13 | $(findstring command line,$(origin $(1)))),,\ | ||
14 | $(eval $(1) = $(2))) | ||
15 | endef | ||
16 | |||
17 | # Allow setting CC and AR, or setting CROSS_COMPILE as a prefix. | ||
18 | $(call allow-override,CC,$(CROSS_COMPILE)gcc) | ||
19 | $(call allow-override,AR,$(CROSS_COMPILE)ar) | ||
20 | |||
3 | # guard against environment variables | 21 | # guard against environment variables |
4 | LIB_H= | 22 | LIB_H= |
5 | LIB_OBJS= | 23 | LIB_OBJS= |
@@ -11,7 +29,7 @@ LIB_OBJS += $(OUTPUT)debugfs.o | |||
11 | LIBFILE = liblk.a | 29 | LIBFILE = liblk.a |
12 | 30 | ||
13 | CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC | 31 | CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC |
14 | EXTLIBS = -lpthread -lrt -lelf -lm | 32 | EXTLIBS = -lelf -lpthread -lrt -lm |
15 | ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 | 33 | ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 |
16 | ALL_LDFLAGS = $(LDFLAGS) | 34 | ALL_LDFLAGS = $(LDFLAGS) |
17 | 35 | ||