summaryrefslogtreecommitdiffstats
path: root/arch/ppc/Makefile
blob: 05ec2438acd82190c80ccd9cb8c6d03a5e8f2b51 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

CPPFLAGS += -ffixed-r14 -m32 	\
	-meabi -D __PPC__ -D CONFIG_PPC \
	-fno-strict-aliasing -mno-spe -mspe=no

ifdef CONFIG_RELOCATABLE
CPPFLAGS += -fPIC -mrelocatable
endif

ifdef CONFIG_MPC85xx
CPPFLAGS += -Wa,-me500x2 -msoft-float -mno-string
endif

board-$(CONFIG_MACH_PHYCORE_MPC5200B_TINY)	:= pcm030
board-$(CONFIG_P1010RDB)			:= freescale-p1010rdb
board-$(CONFIG_P2020RDB)			:= freescale-p2020rdb
board-$(CONFIG_P1022DS)				:= freescale-p1022ds
board-$(CONFIG_DA923RC)				:= geip-da923rc

machine-$(CONFIG_ARCH_MPC5200)			:= mpc5xxx
machine-$(CONFIG_ARCH_MPC85XX)			:= mpc85xx

cpu-$(CONFIG_ARCH_MPC85XX)			:= 85xx

TEXT_BASE = $(CONFIG_TEXT_BASE)

CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)

# Add cleanup flags
ifndef CONFIG_MODULES
CPPFLAGS += -fdata-sections -ffunction-sections
LDFLAGS_barebox += --gc-sections
endif

machdirs := $(patsubst %,arch/ppc/mach-%/,$(machine-y))

ifeq ($(KBUILD_SRC),)
CPPFLAGS += $(patsubst %,-I%include,$(machdirs))
else
CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
endif

archprepare: maketools

PHONY += maketools


ifneq ($(board-y),)
BOARD  := arch/ppc/boards/$(board-y)/
else
BOARD  :=
endif

ifneq ($(machine-y),)
MACH  := arch/ppc/mach-$(machine-y)/
else
MACH  :=
endif

ifneq ($(cpu-y),)
CPU  := arch/ppc/cpu-$(cpu-y)/
else
CPU  :=
endif

common-y += $(BOARD) $(CPU) $(MACH)
common-y += arch/ppc/lib/

ifdef CONFIG_MPC85xx
lds-y += $(MACH)/barebox.lds
else
lds-y += $(BOARD)/barebox.lds
endif