source: tags/start/Makefile@ 71

Last change on this file since 71 was 2, checked in by gb, 20 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1OS = $(shell uname -s)
2GCC_VERSION = 4.0-20050326
3ARCHIVES = gcc-core-$(GCC_VERSION).tar.bz2 gcc-objc-$(GCC_VERSION).tar.bz2
4
5# On LinuxPPC, we want to generate a 32/64-bit compiler (that defaults
6# to 32-bit.) We need to copy some compiler-specific headers to a
7# directory that ffigen can find at runtime.
8ifeq ($(OS),Linux)
9PLATFORM = linuxppc
10CONFIGARGS = --target=ppc64-unknown-linux --host=ppc64-unknown-linux --with-cpu=default32 --enable-biarch
11COPY_OBJC_HEADERS = NO
12endif
13
14ifeq ($(OS),Darwin)
15PLATFORM=darwinppc
16CONFIGTARGET = powerpc-apple-darwin8
17CONFIGARGS = --target=$(CONFIGTARGET) --with-cpu=default32 --enable-biarch
18MAKE_FUNKY_LINK = YES
19COPY_OBJC_HEADERS = NO
20endif
21
22
23
24all: package
25 m4 -DPLATFORM=$(PLATFORM) -DGCC_VERSION=$(GCC_VERSION) source/INSTALL-$(PLATFORM).m4 > INSTALL-FFIGEN-$(PLATFORM)-gcc-$(GCC_VERSION).txt
26
27
28compile: patch
29 mkdir build
30 (cd build ; ../gcc-$(GCC_VERSION)/configure --enable-languages=objc $(CONFIGARGS) )
31ifeq ($(MAKE_FUNKY_LINK),YES)
32 (cd build ; ln -s . build-`../gcc-$(GCC_VERSION)/config.guess`)
33endif
34 (cd build ; make maybe-configure-libiberty maybe-configure-gcc maybe-configure-libcpp)
35 (cd build/libiberty ; make)
36 (cd build/intl ; make)
37 (cd build/libcpp ; make)
38 (cd build/gcc ; make cc1obj xlimits.h)
39
40patch: extract
41 ln -sf `pwd`/source/ffi.c gcc-$(GCC_VERSION)/gcc
42 for f in source/gcc-$(GCC_VERSION)*.diff ; do \
43 (cd gcc-$(GCC_VERSION)/gcc; patch -p0 <../../$$f); \
44 done
45
46package: compile
47 mkdir bin
48 cat source/$(PLATFORM)-gcc-$(GCC_VERSION)-h-to-ffi.sh source/h-to-ffi-common > bin/h-to-ffi.sh
49 chmod +x bin/h-to-ffi.sh
50 mkdir ffigen
51 cp -r -p gcc-$(GCC_VERSION)/gcc/ginclude ffigen
52 mv ffigen/ginclude ffigen/include
53 cp -p build/gcc/xlimits.h ffigen/include/limits.h
54ifeq ($(COPY_OBJC_HEADERS), YES)
55 cp -r -p gcc-$(GCC_VERSION)/libobjc/objc ffigen/include
56endif
57 mkdir ffigen/bin
58 cp -p build/gcc/cc1obj ffigen/bin/ffigen
59 strip ffigen/bin/ffigen
60 tar cfz ffigen-bin-$(PLATFORM)-gcc-$(GCC_VERSION).tar.gz bin ffigen
61
62clean:
63 rm -rf gcc-$(GCC_VERSION) ffigen build bin ffigen*tar.gz INSTALL-FFIGEN-$(PLATFORM)-gcc-$(GCC_VERSION).txt
64
65%.bz2:
66 @echo
67 @echo Obtain the file $@ from a GNU mirror site and copy it to this directory.
68 @echo
69 @exit 2
70
71extract: $(ARCHIVES) clean
72 tar foxj gcc-core-$(GCC_VERSION).tar.bz2
73 tar foxj gcc-objc-$(GCC_VERSION).tar.bz2
Note: See TracBrowser for help on using the repository browser.