| 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 | |
| 29 | KBUILD_DEFCONFIG := |
| 30 | |
| 31 | # setup the machine name and machine dependent settings |
| 32 | machine-$(CONFIG_UBICOM32_V3) := ip5k |
| 33 | machine-$(CONFIG_UBICOM32_V4) := ip7k |
| 34 | MACHINE := $(machine-y) |
| 35 | export MACHINE |
| 36 | |
| 37 | model-$(CONFIG_RAMKERNEL) := ram |
| 38 | model-$(CONFIG_ROMKERNEL) := rom |
| 39 | MODEL := $(model-y) |
| 40 | export MODEL |
| 41 | |
| 42 | CPUCLASS := $(cpuclass-y) |
| 43 | |
| 44 | export 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 | # |
| 51 | CFLAGS_KERNEL += -mfastcall |
| 52 | CFLAGS_MODULE += -mno-fastcall |
| 53 | |
| 54 | # |
| 55 | # Some CFLAG additions based on specific CPU type. |
| 56 | # |
| 57 | cflags-$(CONFIG_UBICOM32_V3) := -march=ubicom32v3 -DIP5000 |
| 58 | cflags-$(CONFIG_UBICOM32_V4) := -march=ubicom32v4 -DIP7000 |
| 59 | |
| 60 | ldflags-$(CONFIG_LINKER_RELAXATION) := --relax |
| 61 | LDFLAGS_vmlinux := $(ldflags-y) |
| 62 | |
| 63 | GCCLIBDIR := $(dir $(shell $(CC) $(cflags-y) -print-libgcc-file-name)) |
| 64 | GCC_LIBS := $(GCCLIBDIR)/libgcc.a |
| 65 | |
| 66 | KBUILD_CFLAGS += $(cflags-y) -ffunction-sections |
| 67 | KBUILD_AFLAGS += $(cflags-y) |
| 68 | |
| 69 | KBUILD_CFLAGS += -D__linux__ -Dlinux |
| 70 | KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\" |
| 71 | |
| 72 | # include any machine specific directory |
| 73 | ifneq ($(machine-y),) |
| 74 | core-y += arch/$(ARCH)/mach-$(MACHINE)/ |
| 75 | endif |
| 76 | |
| 77 | head-y := arch/$(ARCH)/kernel/head.o |
| 78 | |
| 79 | core-y += arch/$(ARCH)/kernel/ \ |
| 80 | arch/$(ARCH)/mm/ \ |
| 81 | arch/$(ARCH)/crypto/ \ |
| 82 | arch/$(ARCH)/mach-common/ |
| 83 | |
| 84 | drivers-$(CONFIG_OPROFILE) += arch/ubicom32/oprofile/ |
| 85 | |
| 86 | libs-y += arch/$(ARCH)/lib/ |
| 87 | libs-y += $(GCC_LIBS) |
| 88 | |
| 89 | archclean: |
| 90 | |
| 91 | # make sure developer has selected a valid board |
| 92 | ifeq ($(CONFIG_NOBOARD),y) |
| 93 | # $(error have to select a valid board file $(CONFIG_NOBOARD), please run kernel config again) |
| 94 | _all: config_board_error |
| 95 | endif |
| 96 | |
| 97 | config_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 | |