1# 2# (C) Copyright 2003-2006 3# Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4# 5# SPDX-License-Identifier: GPL-2.0+ 6# 7 8include $(TOPDIR)/config.mk 9 10LIB = $(obj)lib$(ARCH).o 11 12## Build a couple of necessary functions into a private libgcc 13LIBGCC = $(obj)libgcc.o 14GLSOBJS += ashldi3.o 15GLSOBJS += ashrdi3.o 16GLSOBJS += lshrdi3.o 17LGOBJS := $(addprefix $(obj),$(GLSOBJS)) 18 19SOBJS-y += 20 21COBJS-y += board.o 22ifeq ($(CONFIG_QEMU_MIPS),y) 23COBJS-$(CONFIG_CMD_BOOTM) += bootm_qemu_mips.o 24else 25COBJS-$(CONFIG_CMD_BOOTM) += bootm.o 26endif 27 28SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) 29OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) 30 31# Always build libmips.o 32TARGETS := $(LIB) 33 34# Build private libgcc only when asked for 35ifdef USE_PRIVATE_LIBGCC 36TARGETS += $(LIBGCC) 37endif 38 39all: $(TARGETS) 40 41$(LIB): $(obj).depend $(OBJS) 42 $(call cmd_link_o_target, $(OBJS)) 43 44$(LIBGCC): $(obj).depend $(LGOBJS) 45 $(call cmd_link_o_target, $(LGOBJS)) 46 47######################################################################### 48 49# defines $(obj).depend target 50include $(SRCTREE)/rules.mk 51 52sinclude $(obj).depend 53 54######################################################################### 55