Remove ext/Thread
[p5sagit/p5-mst-13.2.git] / Cross / Makefile
1 ## Toplevel Makefile for cross-compilation of perl
2 #
3 ## $Id: Makefile,v 1.5 2003/12/12 00:48:19 red Exp red $
4
5 export TOPDIR=${shell pwd}
6 include $(TOPDIR)/config
7 export CFLAGS
8 export SYS=$(ARCH)-$(OS)
9 export CROSS=$(ARCH)-$(OS)-
10 export FULL_OPTIMIZATION = -fexpensive-optimizations -fomit-frame-pointer -O2
11 export OPTIMIZATION = -O2
12
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
19
20
21 ## Optimisation work
22 ifeq ($(ARCH),arm)
23  ifdef CONFIG_TARGET_ARM_SA11X0
24    ifndef Architecture
25      Architecture = armv4l-strongarm
26    endif
27    FULL_OPTIMIZATION += -march=armv4 -mtune=strongarm1100 -mapcs-32
28    OPTIMIZATION += -march=armv4 -mtune=strongarm1100 -mapcs-32
29  endif
30 endif
31
32 CFLAGS+=$(FULL_OPTIMIZATION)
33
34 all:
35         @echo Please read the README file before doing anything else.
36
37 gen_patch:
38         diff -Bbur ../Makefile.SH Makefile.SH > Makefile.SH.patch
39         diff -Bbur ../installperl installperl > installperl.patch
40
41 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
47
48 perl:
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)
53
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
63
64