Masahiro Yamada | ce28d7a | 2013-10-17 17:34:47 +0900 | [diff] [blame^] | 1 | # our default target |
| 2 | .PHONY: all |
| 3 | all: |
| 4 | |
| 5 | include $(TOPDIR)/config.mk |
| 6 | |
| 7 | LIB := $(obj)built-in.o |
| 8 | LIBGCC = $(obj)libgcc.o |
| 9 | SRCS := |
| 10 | |
| 11 | include Makefile |
| 12 | |
| 13 | # Backward compatible: obj-y is preferable |
| 14 | COBJS := $(sort $(COBJS) $(COBJS-y)) |
| 15 | SOBJS := $(sort $(SOBJS) $(SOBJS-y)) |
| 16 | |
| 17 | # Going forward use the following |
| 18 | obj-y := $(sort $(obj-y)) |
| 19 | extra-y := $(sort $(extra-y)) |
| 20 | lib-y := $(sort $(lib-y)) |
| 21 | |
| 22 | SRCS += $(COBJS:.o=.c) $(SOBJS:.o=.S) \ |
| 23 | $(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)) |
| 24 | OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS) $(obj-y)) |
| 25 | |
| 26 | LGOBJS := $(addprefix $(obj),$(sort $(GLSOBJS) $(GLCOBJS)) $(lib-y)) |
| 27 | |
| 28 | all: $(LIB) $(addprefix $(obj),$(extra-y)) |
| 29 | |
| 30 | $(LIB): $(obj).depend $(OBJS) |
| 31 | $(call cmd_link_o_target, $(OBJS)) |
| 32 | |
| 33 | ifneq ($(strip $(lib-y)),) |
| 34 | all: $(LIBGCC) |
| 35 | |
| 36 | $(LIBGCC): $(obj).depend $(LGOBJS) |
| 37 | $(call cmd_link_o_target, $(LGOBJS)) |
| 38 | endif |
| 39 | |
| 40 | ######################################################################### |
| 41 | |
| 42 | # defines $(obj).depend target |
| 43 | |
| 44 | include $(TOPDIR)/rules.mk |
| 45 | |
| 46 | sinclude $(obj).depend |
| 47 | |
| 48 | ######################################################################### |