5 include $(TOPDIR)/config.mk
7 LIB := $(obj)built-in.o
8 LIBGCC = $(obj)libgcc.o
13 # Backward compatible: obj-y is preferable
14 COBJS := $(sort $(COBJS) $(COBJS-y))
15 SOBJS := $(sort $(SOBJS) $(SOBJS-y))
17 # Going forward use the following
18 obj-y := $(sort $(obj-y))
19 extra-y := $(sort $(extra-y))
20 lib-y := $(sort $(lib-y))
22 subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
23 obj-y := $(patsubst %/, %/built-in.o, $(obj-y))
24 subdir-obj-y := $(filter %/built-in.o, $(obj-y))
25 subdir-obj-y := $(addprefix $(obj),$(subdir-obj-y))
27 SRCS += $(COBJS:.o=.c) $(SOBJS:.o=.S) \
28 $(wildcard $(obj-y:.o=.c) $(obj-y:.o=.S) $(lib-y:.o=.c) $(lib-y:.o=.S) $(extra-y:.o=.c) $(extra-y:.o=.S))
29 OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS) $(obj-y))
31 LGOBJS := $(addprefix $(obj),$(sort $(GLSOBJS) $(GLCOBJS)) $(lib-y))
33 all: $(LIB) $(addprefix $(obj),$(extra-y))
35 $(LIB): $(obj).depend $(OBJS)
36 $(call cmd_link_o_target, $(OBJS))
38 ifneq ($(strip $(lib-y)),)
41 $(LIBGCC): $(obj).depend $(LGOBJS)
42 $(call cmd_link_o_target, $(LGOBJS))
45 ifneq ($(subdir-obj-y),)
47 $(subdir-obj-y): $(subdir-y)
50 $(MAKE) -C $@ -f $(TOPDIR)/scripts/Makefile.build
53 #########################################################################
55 # defines $(obj).depend target
57 include $(TOPDIR)/rules.mk
59 sinclude $(obj).depend
61 #########################################################################