Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2007 |
| 3 | # Nobuhiro Iwamatsu <iwamatsu@nigauri.org> |
| 4 | # |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | # SPDX-License-Identifier: GPL-2.0+ |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 6 | # |
| 7 | |
| 8 | include $(TOPDIR)/config.mk |
| 9 | |
Sebastien Carlier | 6d8962e | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 10 | LIB = $(obj)lib$(ARCH).o |
Phil Edworthy | eeb84df | 2011-06-02 22:15:27 +0000 | [diff] [blame] | 11 | LIBGCC = $(obj)libgcc.o |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 12 | |
Marian Balakowicz | 823afe7 | 2008-02-27 11:00:47 +0100 | [diff] [blame] | 13 | SOBJS-y += |
Phil Edworthy | eeb84df | 2011-06-02 22:15:27 +0000 | [diff] [blame] | 14 | GLSOBJS += ashiftrt.o |
| 15 | GLSOBJS += ashiftlt.o |
| 16 | GLSOBJS += lshiftrt.o |
| 17 | GLSOBJS += ashldi3.o |
Phil Edworthy | cb4046c | 2011-10-24 10:24:12 +0100 | [diff] [blame] | 18 | GLSOBJS += ashrsi3.o |
Phil Edworthy | eeb84df | 2011-06-02 22:15:27 +0000 | [diff] [blame] | 19 | GLSOBJS += lshrdi3.o |
| 20 | GLSOBJS += movmem.o |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 21 | |
Marian Balakowicz | 823afe7 | 2008-02-27 11:00:47 +0100 | [diff] [blame] | 22 | COBJS-y += board.o |
Dirk Eibach | b8eee43 | 2013-06-26 15:55:16 +0200 | [diff] [blame] | 23 | COBJS-$(CONFIG_CMD_BOOTM) += bootm.o |
Nobuhiro Iwamatsu | e9d5f35 | 2008-11-20 16:44:42 +0900 | [diff] [blame] | 24 | ifeq ($(CONFIG_SH2),y) |
| 25 | COBJS-y += time_sh2.o |
| 26 | else |
| 27 | COBJS-y += time.o |
| 28 | endif |
Nobuhiro Iwamatsu | 45ce6f9 | 2010-12-08 13:49:12 +0900 | [diff] [blame] | 29 | ifeq ($(CONFIG_CMD_SH_ZIMAGEBOOT),y) |
| 30 | COBJS-y += zimageboot.o |
| 31 | endif |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 32 | |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 33 | SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) |
Marian Balakowicz | 823afe7 | 2008-02-27 11:00:47 +0100 | [diff] [blame] | 34 | OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) |
Phil Edworthy | eeb84df | 2011-06-02 22:15:27 +0000 | [diff] [blame] | 35 | LGOBJS := $(addprefix $(obj),$(GLSOBJS)) \ |
| 36 | $(addprefix $(obj),$(GLCOBJS)) |
| 37 | |
| 38 | # Always build libsh.o |
| 39 | TARGETS := $(LIB) |
| 40 | |
| 41 | # Build private libgcc only when asked for |
| 42 | ifdef USE_PRIVATE_LIBGCC |
| 43 | TARGETS += $(LIBGCC) |
| 44 | endif |
| 45 | |
| 46 | all: $(TARGETS) |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 47 | |
| 48 | $(LIB): $(obj).depend $(OBJS) |
Sebastien Carlier | 6d8962e | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 49 | $(call cmd_link_o_target, $(OBJS)) |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 50 | |
Phil Edworthy | eeb84df | 2011-06-02 22:15:27 +0000 | [diff] [blame] | 51 | $(LIBGCC): $(obj).depend $(LGOBJS) |
| 52 | $(call cmd_link_o_target, $(LGOBJS)) |
| 53 | |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 54 | ######################################################################### |
| 55 | |
| 56 | # defines $(obj).depend target |
| 57 | include $(SRCTREE)/rules.mk |
| 58 | |
| 59 | sinclude $(obj).depend |
| 60 | |
| 61 | ######################################################################### |