pwc
[Top] [All Lists]

Re: [pwc] cross compiling pwc for arm

To:
Subject: Re: [pwc] cross compiling pwc for arm
From: "Andreas Kneiseler" <>
Date: Fri, 7 Oct 2005 15:15:08 +0200 (MEST)
Hi, you may take a look at my TOP-Level-Makefile for my ASUS-WLHDD, which
runs with a MIPS-Processsor, you may get an Idea:

If your Kernel compiles fine, and you included the PWC Sources into your
kerneltree, then your PWC-Module should do too. It's better to do it this
way instead of compiling it by it self !!

sincerly

A. Kneiseler

******************************** SNIP *************************

VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 20
EXTRAVERSION =

KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)

ARCH = mips
KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g")

CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
          else if [ -x /bin/bash ]; then echo /bin/bash; \
          else echo sh; fi ; fi)
TOPDIR  := $(shell /bin/pwd)

HPATH           = $(TOPDIR)/include
FINDHPATH       = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net
$(HPATH)/math-emu

HOSTCC          = gcc
HOSTCFLAGS      = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer

CROSS_COMPILE   =

#
# Include the make variables (CC, etc...)
#

AS              = $(CROSS_COMPILE)as
LD              = $(CROSS_COMPILE)ld
CC              = $(CROSS_COMPILE)gcc
CPP             = $(CC) -E
AR              = $(CROSS_COMPILE)ar
NM              = $(CROSS_COMPILE)nm
STRIP           = $(CROSS_COMPILE)strip
OBJCOPY         = $(CROSS_COMPILE)objcopy
OBJDUMP         = $(CROSS_COMPILE)objdump
MAKEFILES       = $(TOPDIR)/.config
GENKSYMS        = /sbin/genksyms
DEPMOD          = /sbin/depmod
MODFLAGS        = -DMODULE
CFLAGS_KERNEL   =
PERL            = perl

export  VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
        CONFIG_SHELL TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
        CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS MODFLAGS PERL

all:    do-it-all

#
# Make "config" the default target if there is no configuration file or
# "depend" the target if there is no top-level dependency information.
#

ifeq (.config,$(wildcard .config))
include .config
ifeq (.depend,$(wildcard .depend))
include .depend
do-it-all:      Version vmlinux
else
CONFIGURATION = depend
do-it-all:      depend
endif
else
CONFIGURATION = config
do-it-all:      config
endif

#
# INSTALL_PATH specifies where to place the updated kernel and system map
#

#export INSTALL_PATH=/boot

#
# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
# relocations required by build roots.  This is not defined in the
# makefile but the arguement can be passed to make if needed.
#

MODLIB  := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
export MODLIB

#
# standard CFLAGS
#

CPPFLAGS := -D__KERNEL__ -I$(HPATH)

CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
          -fno-strict-aliasing -fno-common

# Turn on -pg to instrument the kernel with calls to mcount().
# Unfortunately, gcc won't allow -pg without frame pointers.
ifdef CONFIG_MCOUNT
  CFLAGS += -pg
  CFLAGS_KERNEL += -pg
  CONFIG_FRAME_POINTER = 1
endif
ifndef CONFIG_FRAME_POINTER
CFLAGS += -fomit-frame-pointer
endif
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)

# Broadcom HWNBU source tree
export SRCBASE := $(TOPDIR)/../..
CFLAGS += -I$(SRCBASE)/include
AFLAGS += -I$(SRCBASE)/include
ASFLAGS += -I$(SRCBASE)/include

CFLAGS += -DBCMDRIVER

#
# ROOT_DEV specifies the default root-device when making the image.
# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
# the default of FLOPPY is used by 'build'.
# This is i386 specific.
#

export ROOT_DEV = CURRENT

#
# If you want to preset the SVGA mode, uncomment the next line and
# set SVGA_MODE to whatever number you want.
# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
# The number is the same as you would ordinarily press at bootup.
# This is i386 specific.
#

export SVGA_MODE = -DSVGA_MODE=NORMAL_VGA

#
# If you want the RAM disk device, define this to be the size in blocks.
# This is i386 specific.
#

#export RAMDISK = -DRAMDISK=512

CORE_FILES      =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o
 **************************** SNIP ************************************

> On Thu, Oct 06, 2005 at 01:12:00AM -0400, Nathan M wrote:
>> Does anyone know the process to cross compile pwc for an arm cpu?  I
>> have an arm-linux-gcc toolchain and am basically looking for a cross
>> compile example.  Also anyone know how to make this into a deb?
>
> Hum, if you have build correctly your kernel for the arm, the Makefile of
> the
> kernel is aware to which compiler to use. Else you can try to build the
> source with make CC=arm-linux-gcc, or edit the Makefile in the linux
> source
> tree, and search for CROSS_COMPILE or something similar.
>
> If this is working for you, can you add a page to the wiki ?
>
> Luc
> _______________________________________________
> pwc mailing list
> 
> http://lists.saillard.org/mailman/listinfo/pwc
>


_______________________________________________
pwc mailing list

http://lists.saillard.org/mailman/listinfo/pwc

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU