Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Commit

Permalink
VLX: Apply VLX patch for linux-3.0
Browse files Browse the repository at this point in the history
Change-Id: I6f8c8ffeb218be3fd51248956908c1e25e3d42d1
  • Loading branch information
Geng Ren committed Apr 23, 2012
1 parent a472c8d commit 6b455af
Show file tree
Hide file tree
Showing 309 changed files with 117,352 additions and 58 deletions.
215 changes: 215 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
#
#***************************************************************
#
# Component: VLX Linux Kernel Source Component.
#
# Copyright (C) 2011, Red Bend Ltd.
#
# 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.
#
# 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.
#
# You should have received a copy of the GNU General Public License Version 2
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contributor(s):
# Sebastien Laborie (sebastien.laborie@redbend.com)
# Chi Dat Truong (chidat.truong@redbend.com)
# Guennadi Maslov (guennadi.maslov@redbend.com)
#
#***************************************************************
#

# Include components definitions
include GNUmakefile.defs

# Include the profile file
ifneq ($(LINUXKERNEL_MERGE_PROFILE),)
include $(LINUXKERNEL_MERGE_PROFILE)
endif

#
# The following variables are setup in the board profile file:
#
# - ARCH Linux architecture (name of the directory under arch/)
# - BSP Board name of Linux config file (in arch/<arch>/configs/)
# - MMU MMU support (yes/no)
# - OSWARE OSware support (yes/no)
# - CROSS_COMPILE Compiler prefix (e.g. arm-linux-, powerpc-chorusos-)
#
# Note: A default value is determined and assigned to each variable
# that it is not explicitly defined in the board profile file.
#

#
# Default Linux architecture.
#

ARCH ?= i386

#
# Default board configuration file.
#

ifneq ($(BSP),)
BSP_CONFIG ?= "arch/$(ARCH)/configs/$(BSP)_defconfig"
endif

#
# Helper function.
#

IS_CONFIGURED=$(if $(shell . ./.config; echo $${CONFIG_$(1)}),yes,no)

#
# Default MMU support.
#

MMU ?= $(call IS_CONFIGURED,MMU)

#
# Default OSware support.
#

OSWARE ?= $(call IS_CONFIGURED,NKERNEL)

#
# Determine the cross compiler prefix name.
#

CROSS_COMPILE_i386 = i386-linux-
CROSS_COMPILE_ppc = powerpc-linux-
CROSS_COMPILE_arm = arm-linux-
CROSS_COMPILE_armeb = armeb-linux-
CROSS_COMPILE_mips = mips-linux-
CROSS_COMPILE_mipsel = mipsel-linux-
CROSS_COMPILE ?= $(PREFIX)$(CROSS_COMPILE_$(ARCH))

#
# Determine the cross compiler path.
#

PREFIX=
ifneq ($(CDS_DIR),)
PREFIX=$(CDS_DIR)/bin/
endif

#
# Force the use of the ncurses provided by the GNU component if any.
#

ifneq ($(GNU_DIR),)
NCURSES_CFLAGS = -DLOCALE
NCURSES_CFLAGS += -I$(GNU_DIR)/include -DCURSES_LOC="<ncurses.h>"
NCURSES_LIBS = -L$(GNU_DIR)/lib -lncurses
NCURSES_VARS = HOST_EXTRACFLAGS='$(NCURSES_CFLAGS)' \
HOST_LOADLIBES='$(NCURSES_LIBS)'
export TERMINFO ?= $(GNU_DIR)/share/terminfo
endif

#
# Update the PATH.
#

ifneq ($(GNU_DIR),)
PATH_HOST = $(subst $(GNU_DIR)/bin:,,$(PATH))
PATH = $(GNU_DIR)/bin:$(shell echo $$PATH)
else
PATH_HOST = $(shell echo $$PATH)
endif

#
# VARS contains the Linux Makefile variables to be setup.
#

# bash is really assumed by the kernel Makefiles
VARS = SHELL=/bin/bash

# The architecture
ifneq ($(ARCH),)
VARS += ARCH=$(ARCH)
endif

# The cross-compiler prefix
ifneq ($(CROSS_COMPILE),)
VARS += CROSS_COMPILE=$(CROSS_COMPILE)
endif

# The verbose level
V := 0
VARS += V=$(V)

# The extra version
EXTRAVERSION = -virtuallogix
VARS += EXTRAVERSION=$(EXTRAVERSION)

# Two different versions of gcc are likely to be used for compiling host
# programs: the one provided by the GNU component and, for the xconfig and
# the gconfig rules, the one provided by the host.
# In order to recompile tools when the compiler is changed, the HOSTCC
# variable is set explicitly (see Linux depends rules).

# Allow to overload HOSTCC

ifneq ($(HOSTCC),)
VARS += HOSTCC=$(HOSTCC)
else
ifneq ($(GNU_DIR),)
VARS += HOSTCC=$(GNU_DIR)/bin/gcc
else
VARS += HOSTCC=gcc
endif
endif

# The uboot mkimage tool
ifneq ($(BOOT_UTILS_DIR),)
_BDIR=$(BOOT_UTILS_DIR)/bin
VARS += MKIMAGE_UBOOT=$(_BDIR)/mkimage_uboot.sh
VARS += MKIMAGE_RRLOAD=$(_BDIR)/mkimage_rrload
endif

all:

FORCE:;

VMLINUX.conf: FORCE
rm -f $@
echo "ARCH=$(ARCH)" > $@.tmp
echo "BSP=$(BSP)" >> $@.tmp
echo "MMU=$(MMU)" >> $@.tmp
echo "OSWARE=$(OSWARE)" >> $@.tmp
LINUX_VER=`( cat Makefile ; \
echo "" ; echo 'echover:; @echo $$(KERNELVERSION)' \
) | \
$(MAKE) -sf - echover dot-config=0 $(VARS) | \
grep '^[0-9]'` ; \
if test -z "$$LINUX_VER"; \
then \
echo "Cannot compute Linux version"; exit 1 ; \
fi ; \
echo "LINUX_VER=$$LINUX_VER" >> $@.tmp
mv -f $@.tmp $@

.config:
if test ! -f $(BSP_CONFIG); \
then \
echo "Missing board configuration file"; exit 1 ; \
fi
cp -f $(BSP_CONFIG) $@

menuconfig:
$(MAKE) $(MAKE_PARALLEL) -f Makefile $@ $(VARS) $(NCURSES_VARS)

xconfig gconfig: PATH=$(PATH_HOST)
xconfig gconfig:
$(MAKE) $(MAKE_PARALLEL) -f Makefile $@ $(VARS) HOSTCC=gcc

all:
$(MAKE) $(MAKE_PARALLEL) -f Makefile $@ $(VARS)

%:
$(MAKE) $(MAKE_PARALLEL) -f Makefile $@ $(VARS)
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
#
# Copyright (C) 2011, Red Bend Ltd.
#
# 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.
#
# 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.
#
# You should have received a copy of the GNU General Public License Version 2
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

VERSION = 3
PATCHLEVEL = 0
SUBLEVEL = 8
Expand Down Expand Up @@ -514,6 +529,8 @@ drivers-y := drivers/ sound/ firmware/
net-y := net/
libs-y := lib/
core-y := usr/
core-y += nkernel/

endif # KBUILD_EXTMOD

ifeq ($(dot-config),1)
Expand Down
109 changes: 109 additions & 0 deletions Makefile.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#
#***************************************************************
#
# Component: VLX Linux Kernel Source Component.
#
# Copyright (C) 2011, Red Bend Ltd.
#
# 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.
#
# 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.
#
# You should have received a copy of the GNU General Public License Version 2
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contributor(s):
# Sebastien Laborie (sebastien.laborie@redbend.com)
# Guennadi Maslov (guennadi.maslov@redbend.com)
#
#***************************************************************
#

LINUXKERNEL_MERGE += -s $(LINUXKERNEL)
LINUXKERNEL_MERGE_PROFILE += $(LINUXKERNEL_PROFILE)

all:: LINUXKERNEL.all

LINUXKERNEL.all:: DEVTOOLS.all
LINUXKERNEL.all:: $(LINUXKERNEL_DIR)/DONE

$(LINUXKERNEL_DIR)/profile: $(DEVTOOLS_DIR)/host/bin/mkmerge
rm -rf $(LINUXKERNEL_DIR)
$(DEVTOOLS_DIR)/host/bin/mkmerge $(LINUXKERNEL_MERGE) -t $(LINUXKERNEL_DIR)

$(LINUXKERNEL_DIR)/GNUmakefile.defs: $(LINUXKERNEL_DIR)/profile
cp -f $(BUILD_DIR)/Paths $@
echo "LINUXKERNEL_MERGE_PROFILE=$(LINUXKERNEL_MERGE_PROFILE)" >> $@

$(LINUXKERNEL_DIR)/.config: $(LINUXKERNEL_DIR)/GNUmakefile.defs
cd $(LINUXKERNEL_DIR); $(make) .config; yes '' | $(make) oldconfig

$(LINUXKERNEL_DIR)/include/config/auto.conf: $(LINUXKERNEL_DIR)/.config
cd $(LINUXKERNEL_DIR); $(make) silentoldconfig

$(LINUXKERNEL_DIR)/VMLINUX.conf: $(LINUXKERNEL_DIR)/include/config/auto.conf
cd $(LINUXKERNEL_DIR); $(make) VMLINUX.conf

$(LINUXKERNEL_DIR)/vmlinux: $(LINUXKERNEL_DIR)/VMLINUX.conf
cd $(LINUXKERNEL_DIR); $(make) all
touch $@

$(LINUXKERNEL_DIR)/.modules: $(LINUXKERNEL_DIR)/VMLINUX.conf
cd $(LINUXKERNEL_DIR); . ./.config; if [ ! -z "$$CONFIG_MODULES" ]; then $(make) modules; fi
touch $@

$(LINUXKERNEL_DIR)/DONE: $(LINUXKERNEL_DIR)/vmlinux $(LINUXKERNEL_DIR)/.modules
touch $@

$(LINUXKERNEL_DIR)/.extern_deps: $(LINUXKERNEL_DIR)/VMLINUX.conf
touch $@

linux.%: $(LINUXKERNEL_DIR)/.extern_deps
cd $(LINUXKERNEL_DIR); $(make) $*

ROOTDIR = $(BUILD_DIR)/linux-root
linux.modules_install: LINUXKERNEL.all
mkdir -p $(ROOTDIR); cd $(ROOTDIR); INST_PATH=`pwd`; \
. $(LINUXKERNEL_DIR)/VMLINUX.conf; \
for DIR in $(LINUXMODULES_EXTRA); do \
cd $$DIR; \
find . -follow -type f -name "*.ko" | \
cpio -pdvmuL $(ROOTDIR)/lib/modules/$$LINUX_VER; \
done; \
cd $(LINUXKERNEL_DIR); \
$(make) modules_install INSTALL_MOD_PATH=$$INST_PATH \
depmod_opts='-c $$(CROSS_COMPILE) \
-b $$(INSTALL_MOD_PATH)' \
DEPMOD=$(DEVTOOLS_DIR)/cross-linux/depmod.pl; \
rm -f $$INST_PATH/lib/modules/*/build

LINUXKERNEL_DIST = $(BUILD_DIR)/dist-LINUXKERNEL
LINUXKERNEL.dist: LINUXKERNEL.all
rm -rf $(LINUXKERNEL_DIST)
mkdir -p $(LINUXKERNEL_DIST)
cd $(LINUXKERNEL_DIR) ; \
ASM_DIRS="" ; \
while true; do \
_ASM_DIRS=`find include/asm $$ASM_DIRS -follow -exec \
grep '#.*include.*asm-.*/*.h' {} \; | \
grep -v "asm-generic/" | \
sed -e 's,.*\(asm-[^/]*\)/.*,include/\1,g' | \
sort -u` ; \
[ "$$ASM_DIRS" = "$$_ASM_DIRS" ] && break ; \
ASM_DIRS="$$_ASM_DIRS" ; \
done ; \
find Documentation \
Makefile.bin \
VMLINUX.conf \
.config \
vmlinux \
System.map \
`ls -1d include/* | grep -v "/asm-"` \
include/asm-generic \
$$ASM_DIRS \
-follow -name SCCS -prune -o -print | \
cpio -pdvmL $(LINUXKERNEL_DIST)
Loading

0 comments on commit 6b455af

Please sign in to comment.