123 lines
3.9 KiB
Makefile
123 lines
3.9 KiB
Makefile
|
#
|
||
|
# Copyright 2017 Broadcom
|
||
|
#
|
||
|
# This program is free software; you can redistribute it and/or modify
|
||
|
# it under the terms of the GNU General Public License, version 2, as
|
||
|
# published by the Free Software Foundation (the "GPL").
|
||
|
#
|
||
|
# This program is distributed in the hope that it will be useful, but
|
||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
# General Public License version 2 (GPLv2) for more details.
|
||
|
#
|
||
|
# You should have received a copy of the GNU General Public License
|
||
|
# version 2 (GPLv2) along with this source code.
|
||
|
#
|
||
|
# $Id: Makefile.linux-bmw-2_6,v 1.20 Broadcom SDK $
|
||
|
# $Copyright: (c) 2005 Broadcom Corp.
|
||
|
# All Rights Reserved.$
|
||
|
|
||
|
# Look for custom tools
|
||
|
ifneq (,$(PPC_TOOLS_DIR))
|
||
|
ifneq (,$(PPC_CROSS_COMPILE))
|
||
|
override PATH := $(PPC_TOOLS_DIR):$(PATH)
|
||
|
override CROSS_COMPILE := $(PPC_CROSS_COMPILE)
|
||
|
endif
|
||
|
endif
|
||
|
|
||
|
# Default tools
|
||
|
ifeq (,$(WRS_LINUX_VERSION))
|
||
|
WRS_LINUX_VERSION=2.0
|
||
|
endif
|
||
|
|
||
|
# Default Linux Kernel directory
|
||
|
ifeq (,$(KERNDIR))
|
||
|
|
||
|
ifeq (1.4,$(WRS_LINUX_VERSION))
|
||
|
|
||
|
KERNDIR := /projects/ntsw-tools/linux/wrslinux_1.4/bcm98245cpci/build/linux-2.6.14-cgl
|
||
|
|
||
|
ifeq (,$(CROSS_COMPILE))
|
||
|
CROSS_COMPILE = powerpc-wrs-linux-gnu-603e-glibc_std-
|
||
|
endif
|
||
|
|
||
|
WRLINUX_BASE=/tools/windriver/linux_ed/1.4/Linux
|
||
|
export WIND_LIC_PROXY = $(WRLINUX_BASE)/setup/x86-linux2/bin
|
||
|
override PATH := $(WRLINUX_BASE)/gnu/3.4.4-wrlinux-1.4/x86-linux2/bin:$(PATH)
|
||
|
|
||
|
WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/powerpc-wrs-linux-gnu/3.4.4/include
|
||
|
else
|
||
|
|
||
|
ifeq (2.0,$(WRS_LINUX_VERSION))
|
||
|
|
||
|
ifeq (,$(CROSS_COMPILE))
|
||
|
CROSS_COMPILE = powerpc-wrs-linux-gnu-ppc_603e-glibc_std-
|
||
|
endif
|
||
|
|
||
|
KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/bmw/glibc_std/build/linux-2.6.21-standard
|
||
|
|
||
|
WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux
|
||
|
|
||
|
TOOLCHAIN_EXEC_PREFIX=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2
|
||
|
TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_EXEC_PREFIX)
|
||
|
WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin
|
||
|
|
||
|
WRLINUX_GNU_PATH = $(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin
|
||
|
|
||
|
override PATH := $(TOOLCHAIN_EXEC_PREFIX):$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/powerpc-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH)
|
||
|
|
||
|
export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
|
||
|
|
||
|
WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/powerpc-wrs-linux-gnu/4.1.2/include
|
||
|
|
||
|
comma = ,
|
||
|
basetarget = $(basename $(notdir $@))
|
||
|
modname = $(basetarget)
|
||
|
|
||
|
# Extra variables.
|
||
|
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
|
||
|
|
||
|
name-fix = $(subst $(comma),_,$(subst -,_,$1))
|
||
|
basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
|
||
|
modname_flags = $(if $(filter 1,$(words $(modname))),\
|
||
|
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
|
||
|
endif
|
||
|
endif
|
||
|
endif
|
||
|
|
||
|
# Default Linux include directory
|
||
|
ifeq (,$(LINUX_INCLUDE))
|
||
|
LINUX_INCLUDE := $(KERNDIR)/include
|
||
|
endif
|
||
|
|
||
|
CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1
|
||
|
ENDIAN = BE_HOST=1
|
||
|
CFGFLAGS += -D$(ENDIAN)
|
||
|
CFGFLAGS += -DBCM_PLATFORM_STRING=\"BMW_MPC8245/PPC603e\"
|
||
|
|
||
|
ARCH = ppc
|
||
|
KBUILD_VERBOSE = 1
|
||
|
|
||
|
export ARCH KBUILD_VERBOSE
|
||
|
|
||
|
ifeq (1.4,$(WRS_LINUX_VERSION))
|
||
|
# From linux/arch/ppc/Makefile
|
||
|
|
||
|
ifeq (,$(KFLAGS))
|
||
|
KFLAGS := -D__KERNEL__ -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring
|
||
|
endif
|
||
|
|
||
|
else
|
||
|
ifeq (2.0,$(WRS_LINUX_VERSION))
|
||
|
|
||
|
ifeq (,$(KFLAGS))
|
||
|
KFLAGS := -D__KERNEL__ -m32 -nostdinc -isystem $(WRS_SYSROOT_PATH) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/ppc -I$(KERNDIR)/arch/ppc/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -msoft-float -pipe -ffixed-r2 -mmultiple -mno-altivec -mstring -fomit-frame-pointer -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign
|
||
|
endif
|
||
|
|
||
|
endif
|
||
|
endif
|
||
|
|
||
|
ifneq ($(targetplat),user)
|
||
|
include ${SDK}/make/Makefile.linux-kernel-2_6
|
||
|
endif
|