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