source: branches/ffigen-linuxarm/Makefile@ 74

Last change on this file since 74 was 71, checked in by gb, 14 years ago

New.

File size: 2.0 KB
Line 
1OS = $(shell uname -s)
2NOW = $(shell date -u "+%F-%H-%M-%S")
3TAR = tar
4EXE =
5
6GCC_VERSION = 4.1.0
7ARCHIVES = gcc-core-$(GCC_VERSION).tar.bz2 gcc-objc-$(GCC_VERSION).tar.bz2
8
9ifeq ($(OS),Linux)
10ARCH = $(shell uname -m)
11ifeq ($(ARCH), armv7l)
12PLATFORM = linuxarm
13CONFIGTARGET = armv7l-unknown-linux-gnueabi
14COPY_OBJC_HEADERS = YES
15endif
16endif
17
18
19all: package
20 m4 -DPLATFORM=$(PLATFORM) -DGCC_VERSION=$(GCC_VERSION)-$(NOW) source/INSTALL-$(PLATFORM).m4 > INSTALL-FFIGEN-$(PLATFORM)-gcc-$(GCC_VERSION)-$(NOW).txt
21
22
23compile: patch
24 mkdir build
25 (cd build ; ../gcc-$(GCC_VERSION)/configure --host=$(CONFIGTARGET) --target=$(CONFIGTARGET) --enable-languages=objc $(CONFIGARGS) --disable-bootstrap )
26 (cd build ; $(MAKE))
27
28patch: extract
29 ln -sf `pwd`/source/ffi.c gcc-$(GCC_VERSION)/gcc
30 printf "char *ffi_version = \42%s\42;\n" "$(NOW)" > gcc-$(GCC_VERSION)/gcc/ffi-version.h
31 for f in source/gcc-$(GCC_VERSION)*.diff ; do \
32 (cd gcc-$(GCC_VERSION)/gcc; patch -p0 <../../$$f); \
33 done
34
35package: compile
36 mkdir bin
37 cat source/$(PLATFORM)-gcc-$(GCC_VERSION)-h-to-ffi.sh source/h-to-ffi-common > bin/h-to-ffi.sh
38 chmod +x bin/h-to-ffi.sh
39 mkdir ffigen
40 cp -r -p gcc-$(GCC_VERSION)/gcc/ginclude ffigen
41 mv ffigen/ginclude ffigen/include
42 cp -p build/gcc/xlimits.h ffigen/include/limits.h
43 cp -p gcc-$(GCC_VERSION)/gcc/gsyslimits.h ffigen/include/syslimits.h
44ifeq ($(COPY_OBJC_HEADERS), YES)
45 cp -r -p gcc-$(GCC_VERSION)/libobjc/objc ffigen/include
46endif
47 mkdir ffigen/bin
48 cp -p build/gcc/cc1obj$(EXE) ffigen/bin/ffigen$(EXE)
49 strip ffigen/bin/ffigen$(EXE)
50 $(TAR) cfz ffigen-bin-$(PLATFORM)-gcc-$(GCC_VERSION)-$(NOW).tar.gz bin ffigen
51
52clean:
53 rm -rf gcc-$(GCC_VERSION) ffigen build bin ffigen*tar.gz INSTALL-FFIGEN-$(PLATFORM)-gcc-$(GCC_VERSION)*.txt
54
55%.bz2:
56 @echo
57 @echo Obtain the file $@ from a GNU repository \(or gcc.gnu.org mirror\) and copy it to this directory.
58 @echo
59 @exit 2
60
61extract: $(ARCHIVES) clean
62 $(TAR) fxj gcc-core-$(GCC_VERSION).tar.bz2
63 $(TAR) fxj gcc-objc-$(GCC_VERSION).tar.bz2
Note: See TracBrowser for help on using the repository browser.