wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 1 | # |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 2 | # (C) Copyright 2003-2006 |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | # |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | # SPDX-License-Identifier: GPL-2.0+ |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 6 | # |
| 7 | |
| 8 | include $(TOPDIR)/config.mk |
| 9 | |
Sebastien Carlier | a8d426f | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 10 | LIB = $(obj)lib$(ARCH).o |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 11 | |
Marek Vasut | 1954ce7 | 2012-08-12 16:53:35 +0200 | [diff] [blame] | 12 | ## Build a couple of necessary functions into a private libgcc |
| 13 | LIBGCC = $(obj)libgcc.o |
| 14 | GLSOBJS += ashldi3.o |
| 15 | GLSOBJS += ashrdi3.o |
| 16 | GLSOBJS += lshrdi3.o |
| 17 | LGOBJS := $(addprefix $(obj),$(GLSOBJS)) |
| 18 | |
Marian Balakowicz | 699ffe5 | 2008-02-27 11:00:47 +0100 | [diff] [blame] | 19 | SOBJS-y += |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 20 | |
Marian Balakowicz | 699ffe5 | 2008-02-27 11:00:47 +0100 | [diff] [blame] | 21 | COBJS-y += board.o |
Dirk Eibach | d2df811 | 2013-06-26 15:55:16 +0200 | [diff] [blame] | 22 | COBJS-$(CONFIG_CMD_BOOTM) += bootm.o |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 23 | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 24 | SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) |
Marian Balakowicz | 699ffe5 | 2008-02-27 11:00:47 +0100 | [diff] [blame] | 25 | OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 26 | |
Marek Vasut | 1954ce7 | 2012-08-12 16:53:35 +0200 | [diff] [blame] | 27 | # Always build libmips.o |
| 28 | TARGETS := $(LIB) |
| 29 | |
| 30 | # Build private libgcc only when asked for |
| 31 | ifdef USE_PRIVATE_LIBGCC |
| 32 | TARGETS += $(LIBGCC) |
| 33 | endif |
| 34 | |
| 35 | all: $(TARGETS) |
| 36 | |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 37 | $(LIB): $(obj).depend $(OBJS) |
Sebastien Carlier | a8d426f | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 38 | $(call cmd_link_o_target, $(OBJS)) |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 39 | |
Marek Vasut | 1954ce7 | 2012-08-12 16:53:35 +0200 | [diff] [blame] | 40 | $(LIBGCC): $(obj).depend $(LGOBJS) |
| 41 | $(call cmd_link_o_target, $(LGOBJS)) |
| 42 | |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 43 | ######################################################################### |
| 44 | |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 45 | # defines $(obj).depend target |
| 46 | include $(SRCTREE)/rules.mk |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 47 | |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 48 | sinclude $(obj).depend |
wdenk | bb1b826 | 2003-03-27 12:09:35 +0000 | [diff] [blame] | 49 | |
| 50 | ######################################################################### |