Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
fork
Configure Feed
Select the types of activity you want to include in your feed.
1include ../../scripts/Makefile.include
2
3CC = $(CROSS_COMPILE)gcc
4AR = $(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.
11define allow-override
12 $(if $(or $(findstring environment,$(origin $(1))),\
13 $(findstring command line,$(origin $(1)))),,\
14 $(eval $(1) = $(2)))
15endef
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
21# guard against environment variables
22LIB_H=
23LIB_OBJS=
24
25LIB_H += debugfs.h
26
27LIB_OBJS += $(OUTPUT)debugfs.o
28
29LIBFILE = liblk.a
30
31CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
32EXTLIBS = -lelf -lpthread -lrt -lm
33ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
34ALL_LDFLAGS = $(LDFLAGS)
35
36RM = rm -f
37
38$(LIBFILE): $(LIB_OBJS)
39 $(QUIET_AR)$(RM) $@ && $(AR) rcs $(OUTPUT)$@ $(LIB_OBJS)
40
41$(LIB_OBJS): $(LIB_H)
42
43$(OUTPUT)%.o: %.c
44 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
45$(OUTPUT)%.s: %.c
46 $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
47$(OUTPUT)%.o: %.S
48 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
49
50clean:
51 $(RM) $(LIB_OBJS) $(LIBFILE)
52
53.PHONY: clean