d451f6ff010a9b2855280f10d7021a16f47bc0db
[karo-tx-uboot.git] / board / freescale / common / Makefile
1 #
2 # (C) Copyright 2006
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 #
5 # SPDX-License-Identifier:      GPL-2.0+
6 #
7
8 include $(TOPDIR)/config.mk
9
10 ifneq ($(OBJTREE),$(SRCTREE))
11 $(shell mkdir -p $(obj)board/freescale/common)
12 endif
13
14 LIB     = $(obj)libfreescale.o
15
16 MINIMAL=
17
18 ifdef CONFIG_SPL_BUILD
19 ifdef CONFIG_SPL_INIT_MINIMAL
20 MINIMAL=y
21 endif
22 endif
23
24 ifndef MINIMAL
25 COBJS-$(CONFIG_FSL_CADMUS)      += cadmus.o
26 COBJS-$(CONFIG_FSL_VIA)         += cds_via.o
27 COBJS-$(CONFIG_FMAN_ENET)       += fman.o
28 COBJS-$(CONFIG_FSL_PIXIS)       += pixis.o
29 ifndef CONFIG_SPL_BUILD
30 COBJS-$(CONFIG_FSL_NGPIXIS)     += ngpixis.o
31 endif
32 COBJS-$(CONFIG_FSL_QIXIS)       += qixis.o
33 COBJS-$(CONFIG_PQ_MDS_PIB)      += pq-mds-pib.o
34 ifndef CONFIG_SPL_BUILD
35 COBJS-$(CONFIG_ID_EEPROM)       += sys_eeprom.o
36 endif
37 COBJS-$(CONFIG_FSL_SGMII_RISER) += sgmii_riser.o
38 ifndef CONFIG_RAMBOOT_PBL
39 COBJS-$(CONFIG_FSL_FIXED_MMC_LOCATION)  += sdhc_boot.o
40 endif
41
42 COBJS-$(CONFIG_MPC8541CDS)      += cds_pci_ft.o
43 COBJS-$(CONFIG_MPC8548CDS)      += cds_pci_ft.o
44 COBJS-$(CONFIG_MPC8555CDS)      += cds_pci_ft.o
45
46 COBJS-$(CONFIG_MPC8536DS)       += ics307_clk.o
47 COBJS-$(CONFIG_MPC8572DS)       += ics307_clk.o
48 ifndef CONFIG_SPL_BUILD
49 COBJS-$(CONFIG_P1022DS)         += ics307_clk.o
50 endif
51 COBJS-$(CONFIG_P2020DS)         += ics307_clk.o
52 COBJS-$(CONFIG_P3041DS)         += ics307_clk.o
53 COBJS-$(CONFIG_P4080DS)         += ics307_clk.o
54 COBJS-$(CONFIG_P5020DS)         += ics307_clk.o
55 COBJS-$(CONFIG_P5040DS)         += ics307_clk.o
56 COBJS-$(CONFIG_VSC_CROSSBAR)    += vsc3316_3308.o
57
58 # deal with common files for P-series corenet based devices
59 SUBLIB-$(CONFIG_P2041RDB)       += p_corenet/libp_corenet.o
60 SUBLIB-$(CONFIG_P3041DS)        += p_corenet/libp_corenet.o
61 SUBLIB-$(CONFIG_P4080DS)        += p_corenet/libp_corenet.o
62 SUBLIB-$(CONFIG_P5020DS)        += p_corenet/libp_corenet.o
63 SUBLIB-$(CONFIG_P5040DS)        += p_corenet/libp_corenet.o
64 endif
65
66 SRCS    := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
67 OBJS    := $(addprefix $(obj),$(COBJS-y))
68 SOBJS   := $(addprefix $(obj),$(SOBJS))
69 SUBLIB  := $(addprefix $(obj),$(SUBLIB-y))
70
71 $(LIB): $(obj).depend $(OBJS) $(SUBLIB)
72         $(call cmd_link_o_target, $(OBJS) $(SUBLIB))
73
74 $(SUBLIB): $(obj).depend
75         $(MAKE) -C $(dir $(subst $(obj),,$@))
76
77 #########################################################################
78
79 # defines $(obj).depend target
80 include $(SRCTREE)/rules.mk
81
82 sinclude $(obj).depend
83
84 #########################################################################