Root/target/linux/ubicom32/files/arch/ubicom32/Makefile

1#
2# arch/ubicom32/Makefile
3# <TODO: Replace with short file description>
4#
5# (C) Copyright 2009, Ubicom, Inc.
6#
7# This file is part of the Ubicom32 Linux Kernel Port.
8#
9# The Ubicom32 Linux Kernel Port is free software: you can redistribute
10# it and/or modify it under the terms of the GNU General Public License
11# as published by the Free Software Foundation, either version 2 of the
12# License, or (at your option) any later version.
13#
14# The Ubicom32 Linux Kernel Port is distributed in the hope that it
15# will be useful, but WITHOUT ANY WARRANTY; without even the implied
16# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17# the GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with the Ubicom32 Linux Kernel Port. If not,
21# see <http://www.gnu.org/licenses/>.
22#
23# Ubicom32 implementation derived from (with many thanks):
24# arch/m68knommu
25# arch/blackfin
26# arch/parisc
27#
28
29KBUILD_DEFCONFIG :=
30
31# setup the machine name and machine dependent settings
32machine-$(CONFIG_UBICOM32_V3) := ip5k
33machine-$(CONFIG_UBICOM32_V4) := ip7k
34MACHINE := $(machine-y)
35export MACHINE
36
37model-$(CONFIG_RAMKERNEL) := ram
38model-$(CONFIG_ROMKERNEL) := rom
39MODEL := $(model-y)
40export MODEL
41
42CPUCLASS := $(cpuclass-y)
43
44export CPUCLASS
45
46#
47# We want the core kernel built using the fastcall ABI but modules need
48# to be built using the slower calling convention because they could be
49# loaded out of range for fast calls.
50#
51CFLAGS_KERNEL += -mfastcall
52CFLAGS_MODULE += -mno-fastcall
53
54#
55# Some CFLAG additions based on specific CPU type.
56#
57cflags-$(CONFIG_UBICOM32_V3) := -march=ubicom32v3 -DIP5000
58cflags-$(CONFIG_UBICOM32_V4) := -march=ubicom32v4 -DIP7000
59
60ldflags-$(CONFIG_LINKER_RELAXATION) := --relax
61LDFLAGS_vmlinux := $(ldflags-y)
62
63GCCLIBDIR := $(dir $(shell $(CC) $(cflags-y) -print-libgcc-file-name))
64GCC_LIBS := $(GCCLIBDIR)/libgcc.a
65
66KBUILD_CFLAGS += $(cflags-y) -ffunction-sections
67KBUILD_AFLAGS += $(cflags-y)
68
69KBUILD_CFLAGS += -D__linux__ -Dlinux
70KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
71
72# include any machine specific directory
73ifneq ($(machine-y),)
74core-y += arch/$(ARCH)/mach-$(MACHINE)/
75endif
76
77head-y := arch/$(ARCH)/kernel/head.o
78
79core-y += arch/$(ARCH)/kernel/ \
80       arch/$(ARCH)/mm/ \
81       arch/$(ARCH)/crypto/ \
82       arch/$(ARCH)/mach-common/
83
84drivers-$(CONFIG_OPROFILE) += arch/ubicom32/oprofile/
85
86libs-y += arch/$(ARCH)/lib/
87libs-y += $(GCC_LIBS)
88
89archclean:
90
91# make sure developer has selected a valid board
92ifeq ($(CONFIG_NOBOARD),y)
93# $(error have to select a valid board file $(CONFIG_NOBOARD), please run kernel config again)
94_all: config_board_error
95endif
96
97config_board_error:
98    @echo "*************************************************"
99    @echo "You have not selected a proper board."
100    @echo "Please run menuconfig (or config) against your"
101    @echo "kernel and choose your board under Processor"
102    @echo "options"
103    @echo "*************************************************"
104    @exit 1
105

Archive Download this file



interactive