1 ## Toplevel Makefile for cross-compilation of perl
3 ## $Id: Makefile,v 1.5 2003/12/12 00:48:19 red Exp red $
5 export TOPDIR=${shell pwd}
6 include $(TOPDIR)/config
8 export SYS=$(ARCH)-$(OS)
9 export CROSS=$(ARCH)-$(OS)-
10 export FULL_OPTIMIZATION = -fexpensive-optimizations -fomit-frame-pointer -O2
11 export OPTIMIZATION = -O2
13 export CC = $(CROSS)gcc
14 export CXX = $(CROSS)g++
15 export LD = $(CROSS)ld
16 export STRIP = $(CROSS)strip
17 export AR = $(CROSS)ar
18 export RANLIB = $(CROSS)ranlib
23 ifdef CONFIG_TARGET_ARM_SA11X0
25 Architecture = armv4l-strongarm
27 FULL_OPTIMIZATION += -march=armv4 -mtune=strongarm1100 -mapcs-32
28 OPTIMIZATION += -march=armv4 -mtune=strongarm1100 -mapcs-32
32 CFLAGS+=$(FULL_OPTIMIZATION)
35 @echo Please read the README file before doing anything else.
38 diff -Bbur ../Makefile.SH Makefile.SH > Makefile.SH.patch
39 diff -Bbur ../installperl installperl > installperl.patch
42 cd .. ; if [ ! -e ./CROSS_PATCHED ] ; then \
43 patch -p1 < Cross/Makefile.SH.patch; \
44 patch -p1 < Cross/installperl.patch ; mv installperl installperl-patched; \
45 sed -e 's/XXSTRIPXX/$(SYS)/' installperl-patched > installperl; \
46 touch CROSS_PATCHED ; fi
49 @echo Perl cross-build directory is $(TOPDIR)
50 @echo Target arch is $(SYS)
51 @echo toolchain: $(CC), $(CXX), $(LD), $(STRIP), $(AR), $(RANLIB)
52 @echo Optimizations: $(FULL_OPTIMIZATION)
54 $(TOPDIR)/generate_config_sh config.sh-$(SYS) > $(TOPDIR)/../config.sh
55 cd $(TOPDIR)/.. ; ./Configure -S ; make depend ; make ; make more
56 cd $(TOPDIR)/.. ; mkdir -p fake_config_library ; cp lib/Config.pm lib/Config_heavy.pl fake_config_library
57 cd $(TOPDIR)/.. ; $(MAKE) more2 "PERLRUN=/usr/bin/perl -I$(TOPDIR)/../fake_config_library -MConfig"
58 cd $(TOPDIR)/.. ; $(MAKE) more3 "PERLRUN=/usr/bin/perl -I$(TOPDIR)/../fake_config_library -MConfig"
59 cd $(TOPDIR)/.. ; $(MAKE) more4 "PERLRUN=/usr/bin/perl -I$(TOPDIR)/../fake_config_library -MConfig"
60 cd $(TOPDIR)/.. ; rm -rf install_me_here
61 cd $(TOPDIR)/.. ; make install-strip
62 cd $(TOPDIR)/.. ; sh -x Cross/warp