xref: /rk3399_rockchip-uboot/arch/powerpc/lib/Makefile (revision 660c60c4e70c1f8369e7fc4e23b3bc10e01f1199)
1a47a12beSStefan Roese#
2a47a12beSStefan Roese# (C) Copyright 2000-2006
3a47a12beSStefan Roese# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4a47a12beSStefan Roese#
5a47a12beSStefan Roese# See file CREDITS for list of people who contributed to this
6a47a12beSStefan Roese# project.
7a47a12beSStefan Roese#
8a47a12beSStefan Roese# This program is free software; you can redistribute it and/or
9a47a12beSStefan Roese# modify it under the terms of the GNU General Public License as
10a47a12beSStefan Roese# published by the Free Software Foundation; either version 2 of
11a47a12beSStefan Roese# the License, or (at your option) any later version.
12a47a12beSStefan Roese#
13a47a12beSStefan Roese# This program is distributed in the hope that it will be useful,
14a47a12beSStefan Roese# but WITHOUT ANY WARRANTY; without even the implied warranty of
15a47a12beSStefan Roese# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16a47a12beSStefan Roese# GNU General Public License for more details.
17a47a12beSStefan Roese#
18a47a12beSStefan Roese# You should have received a copy of the GNU General Public License
19a47a12beSStefan Roese# along with this program; if not, write to the Free Software
20a47a12beSStefan Roese# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21a47a12beSStefan Roese# MA 02111-1307 USA
22a47a12beSStefan Roese#
23a47a12beSStefan Roese
24a47a12beSStefan Roeseinclude $(TOPDIR)/config.mk
25a47a12beSStefan Roese
2601baa056SKyle Moffett## Build a couple of necessary functions into a private libgcc
2701baa056SKyle MoffettLIBGCC	= $(obj)libgcc.o
2801baa056SKyle MoffettGLSOBJS	+= _ashldi3.o
2901baa056SKyle MoffettGLSOBJS	+= _ashrdi3.o
3001baa056SKyle MoffettGLSOBJS	+= _lshrdi3.o
3101baa056SKyle MoffettLGOBJS	:= $(addprefix $(obj),$(GLSOBJS)) \
3201baa056SKyle Moffett	   $(addprefix $(obj),$(GLCOBJS))
3301baa056SKyle Moffett
3401baa056SKyle Moffett## But only build it if the user asked for it
3501baa056SKyle Moffettifdef USE_PRIVATE_LIBGCC
3601baa056SKyle MoffettTARGETS	+= $(LIBGCC)
3701baa056SKyle Moffettendif
3801baa056SKyle Moffett
396d8962e8SSebastien CarlierLIB	= $(obj)lib$(ARCH).o
40a47a12beSStefan Roese
414b919725SScott WoodMINIMAL=
424b919725SScott Wood
434b919725SScott Woodifdef CONFIG_SPL_BUILD
444b919725SScott Woodifdef CONFIG_SPL_INIT_MINIMAL
454b919725SScott WoodMINIMAL=y
464b919725SScott Woodendif
474b919725SScott Woodendif
484b919725SScott Wood
494b919725SScott Woodifdef MINIMAL
5006f60ae3SScott WoodCOBJS-y += cache.o time.o
5106f60ae3SScott WoodSOBJS-y += ticks.o
524b919725SScott Woodelse
534b919725SScott Wood
54a47a12beSStefan RoeseSOBJS-y	+= ppcstring.o
554b919725SScott Wood
564b919725SScott WoodSOBJS-y	+= ppccache.o
57a47a12beSStefan RoeseSOBJS-y	+= ticks.o
58a47a12beSStefan RoeseSOBJS-y	+= reloc.o
59a47a12beSStefan Roese
604bbfd3e2SPeter TyserCOBJS-$(CONFIG_BAT_RW) += bat_rw.o
61083f2e08SStefan Roeseifndef CONFIG_SPL_BUILD
62*660c60c4SSimon Glassifndef CONFIG_SYS_GENERIC_BOARD
63a47a12beSStefan RoeseCOBJS-y	+= board.o
64083f2e08SStefan Roeseendif
65*660c60c4SSimon Glassendif
66a47a12beSStefan RoeseCOBJS-y	+= bootm.o
67a47a12beSStefan RoeseCOBJS-y	+= cache.o
68a47a12beSStefan RoeseCOBJS-y	+= extable.o
69a47a12beSStefan RoeseCOBJS-y	+= interrupts.o
70a47a12beSStefan RoeseCOBJS-$(CONFIG_CMD_KGDB) += kgdb.o
718d1165e1SPavel HerrmannCOBJS-${CONFIG_CMD_IDE} += ide.o
72a47a12beSStefan RoeseCOBJS-y	+= time.o
73a47a12beSStefan Roese
74083f2e08SStefan Roese# Don't include the MPC5xxx special memcpy into the
75083f2e08SStefan Roese# SPL U-Boot image. memcpy is used in the SPL NOR
76083f2e08SStefan Roese# flash driver. And we need the real, fast memcpy
77083f2e08SStefan Roese# here. We have no problems with unaligned access.
78083f2e08SStefan Roeseifndef CONFIG_SPL_BUILD
794ccd5510SWolfgang Denk# Workaround for local bus unaligned access problems
804ccd5510SWolfgang Denk# on MPC512x and MPC5200
814ccd5510SWolfgang Denkifdef CONFIG_MPC512X
824ccd5510SWolfgang Denk$(obj)ppcstring.o: AFLAGS += -Dmemcpy=__memcpy
834ccd5510SWolfgang DenkCOBJS-y += memcpy_mpc5200.o
844ccd5510SWolfgang Denkendif
85460c2ce3SWolfgang Denkifdef CONFIG_MPC5200
86460c2ce3SWolfgang Denk$(obj)ppcstring.o: AFLAGS += -Dmemcpy=__memcpy
874ccd5510SWolfgang DenkCOBJS-y += memcpy_mpc5200.o
88460c2ce3SWolfgang Denkendif
89083f2e08SStefan Roeseendif
90460c2ce3SWolfgang Denk
914b919725SScott Woodendif # not minimal
924b919725SScott Wood
93ea8256f0SStefan Roeseifdef CONFIG_SPL_BUILD
94ea8256f0SStefan RoeseCOBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o
95ea8256f0SStefan Roeseendif
96ea8256f0SStefan Roese
974ccd5510SWolfgang DenkCOBJS	+= $(sort $(COBJS-y))
984ccd5510SWolfgang Denk
9901baa056SKyle MoffettSRCS	:= $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
10001baa056SKyle Moffett	   $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
1014ccd5510SWolfgang DenkOBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
1024ccd5510SWolfgang Denk
10301baa056SKyle MoffettTARGETS += $(LIB)
10401baa056SKyle Moffett
10501baa056SKyle Moffettall: $(TARGETS)
10601baa056SKyle Moffett
107a47a12beSStefan Roese$(LIB):	$(obj).depend $(OBJS)
1086d8962e8SSebastien Carlier	$(call cmd_link_o_target, $(OBJS))
109a47a12beSStefan Roese
11001baa056SKyle Moffett$(LIBGCC): $(obj).depend $(LGOBJS)
11101baa056SKyle Moffett	$(call cmd_link_o_target, $(LGOBJS))
11201baa056SKyle Moffett
113a47a12beSStefan Roese#########################################################################
114a47a12beSStefan Roese
115a47a12beSStefan Roese# defines $(obj).depend target
116a47a12beSStefan Roeseinclude $(SRCTREE)/rules.mk
117a47a12beSStefan Roese
118a47a12beSStefan Roesesinclude $(obj).depend
119a47a12beSStefan Roese
120a47a12beSStefan Roese#########################################################################
121