2 # Copyright (C) 2008-2009 Industrie Dial Face S.p.A.
3 # Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com>
4 # Copyright (C) 2006-2008 OpenWrt.org
6 # This is free software, licensed under the GNU General Public License v2.
7 # See /LICENSE for more information.
10 include $(TOPDIR
)/rules.mk
11 include $(INCLUDE_DIR
)/kernel.mk
12 include $(INCLUDE_DIR
)/host.mk
16 PKG_OS
:=$(shell uname
-s
)
17 PKG_CPU
:=$(shell uname
-m
)
19 TOOLCHAIN_NAME
:=OpenWrt-Toolchain-
$(BOARD
)-for-
$(ARCH
)-gcc-
$(GCCV
)_
$(LIBC
)-$(LIBCV
)
20 TOOLCHAIN_BUILD_DIR
:=$(BUILD_DIR
)/$(TOOLCHAIN_NAME
)
21 EXCLUDE_DIRS
:=*/ccache \
29 TOOLCHAIN_PREFIX
:=$(TOOLCHAIN_BUILD_DIR
)/toolchain-
$(ARCH
)_gcc-
$(GCCV
)_
$(LIBC
)-$(LIBCV
)
31 $(BIN_DIR
)/$(TOOLCHAIN_NAME
).
tar.bz2
: clean
32 mkdir
-p
$(TOOLCHAIN_BUILD_DIR
)
33 $(TAR
) -cf
- -C
$(TOPDIR
)/staging_dir
/ \
34 $(foreach exclude
,$(EXCLUDE_DIRS
),--exclude
="$(exclude)") \
35 toolchain-
$(ARCH
)_gcc-
$(GCCV
)_
$(LIBC
)-$(LIBCV
) | \
36 $(TAR
) -xf
- -C
$(TOOLCHAIN_BUILD_DIR
)
38 $(CP
) $(TOPDIR
)/LICENSE .
/files
/README.TOOLCHAIN \
39 $(TOOLCHAIN_BUILD_DIR
)/
41 $(CP
) .
/files
/wrapper.sh
$(TOOLCHAIN_PREFIX
)/usr
/bin
/$(REAL_GNU_TARGET_NAME
)-wrapper.sh
42 chmod
+x
$(TOOLCHAIN_PREFIX
)/usr
/bin
/$(REAL_GNU_TARGET_NAME
)-wrapper.sh
43 (cd
$(TOOLCHAIN_PREFIX
)/usr
/bin
; \
44 for app in
cc gcc g
++ c
++ cpp ld as ; do \
45 [ -f
$(REAL_GNU_TARGET_NAME
)-$${app} ] && mv
$(REAL_GNU_TARGET_NAME
)-$${app} $(REAL_GNU_TARGET_NAME
)-$${app}.bin
; \
46 ln
-sf
$(REAL_GNU_TARGET_NAME
)-wrapper.sh
$(REAL_GNU_TARGET_NAME
)-$${app} ; \
49 echo REVISION
:="$(REVISION)" > $(TOOLCHAIN_BUILD_DIR
)/version.mk
50 find
$(TOOLCHAIN_BUILD_DIR
) -name .git |
$(XARGS
) rm -rf
51 find
$(TOOLCHAIN_BUILD_DIR
) -name .svn |
$(XARGS
) rm -rf
52 find
$(TOOLCHAIN_BUILD_DIR
) -name CVS |
$(XARGS
) rm -rf
54 tar cfj
$@
$(TOOLCHAIN_NAME
); \
59 compile
: $(BIN_DIR
)/$(TOOLCHAIN_NAME
).
tar.bz2
63 rm -rf
$(TOOLCHAIN_BUILD_DIR
) $(BIN_DIR
)/$(TOOLCHAIN_NAME
).
tar.bz2
This page took 0.059114 seconds and 5 git commands to generate.