# $FreeWRT: src/share/misc/licence.template,v 1.7 2006/04/09 22:08:49 tg Rel $ #- # Copyright (c) 2006 # Thorsten Glaser # # Licensee is hereby permitted to deal in this work without restric- # tion, including unlimited rights to use, publicly perform, modify, # merge, distribute, sell, give away or sublicence, provided all co- # pyright notices above, these terms and the disclaimer are retained # in all redistributions or reproduced in accompanying documentation # or other materials provided with binary redistributions. # # All advertising materials mentioning features or use of this soft- # ware must display the following acknowledgement: # This product includes material provided by Thorsten Glaser. # This acknowledgement does not need to be reprinted if this work is # linked into a bigger work whose licence does not allow such clause # and the author of this work is given due credit in the bigger work # or its documentation. Specifically, re-using this code in any work # covered by the GNU General Public License version 1 or Library Ge- # neral Public License (any version) is permitted. # # Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind, # express, or implied, to the maximum extent permitted by applicable # law, without malicious intent or gross negligence; in no event may # licensor, an author or contributor be held liable for any indirect # or other damage, or direct damage except proven a consequence of a # direct error of said person and intended use of this work, loss or # other issues arising in any way out of its use, even if advised of # the possibility of such damage or existence of a nontrivial bug. GMAKE?= $(PWD)/lbin/gmake GMAKE_FMK= ${GMAKE} -f $(PWD)/build.mk GMAKE_INV= ${GMAKE_FMK} --no-print-directory all: .prereq_done @${GMAKE_INV} all v: .prereq_done (echo; echo "Build started on $$(LC_ALL=C TZ=UTC date)"; set -x; \ ${GMAKE_FMK} all V=99) 2>&1 | tee -a make.log verbose: .prereq_done @${GMAKE_FMK} all V=99 clean: .prereq_done @${GMAKE_INV} clean config: .prereq_done @${GMAKE_INV} config cleandir: .prereq_done @${GMAKE_INV} cleandir @-rm -rf lbin @-rm -f make.log .prereq_done distclean: .prereq_done @${GMAKE_INV} distclean @-rm -rf lbin @-rm -f make.log .prereq_done image_clean: .prereq_done @${GMAKE_INV} image_clean menuconfig: .prereq_done @${GMAKE_INV} menuconfig oldconfig: .prereq_done @${GMAKE_INV} oldconfig package_index: .prereq_done @${GMAKE_INV} package_index source: .prereq_done @${GMAKE_INV} source target_clean: .prereq_done @${GMAKE_INV} target_clean world: .prereq_done @${GMAKE_INV} world update-package: @find target/linux/package package/ -name Config.in -exec \ grep -r FWRT_PACKAGE {} \; | \ awk '/config/ { print $$2 }' | sort | grep -v config | \ sed -e 's#.*#&=m#' >>.config prereq: @rm -f .prereq_done @${MAKE} .prereq_done prereq-noerror: @rm -f .prereq_done @${MAKE} .prereq_done NO_ERROR=1 NO_ERROR=0 .prereq_done: @-rm -rf .prereq_done lbin @if ! bash --version 2>&1 | fgrep 'GNU bash' >/dev/null 2>&1; then \ echo "FreeWRT requires GNU bash to be installed, sorry."; \ exit 1; \ fi @mkdir lbin @if which nonexistent 2>&1 | grep -q '^no '; then \ cp scripts/which.mac lbin/which; \ chmod 555 lbin/which; \ else \ ln -s $$(which which) lbin/which; \ fi @if lbin/which gmake >/dev/null 2>&1; then \ ln -s $$(lbin/which gmake) lbin/gmake; \ else \ ln -s $$(lbin/which make) lbin/gmake; \ fi @if ! lbin/which md5sum >/dev/null 2>&1; then \ cp scripts/md5sum.bsd lbin/md5sum; \ chmod 555 lbin/md5sum; \ fi @if test x"$$(uname)" = x"MirBSD"; then \ sed -e 's!@@FromOS@@!MirBSD!g' -e 's!@@ToOS@@!OpenBSD!g' \ -e "s!@@PROG@@!$$(lbin/which uname)!g" \ lbin/uname; \ chmod 555 lbin/uname; \ fi @echo "BASH:=$$(lbin/which bash)" >>lbin/prereq.mk @echo 'GMAKE:=${GMAKE}' >>lbin/prereq.mk @echo "GNU_HOST_NAME:=$$(${CC} -dumpmachine | sed \ -e 's!mirbsd!openbsd!g' \ )" >>lbin/prereq.mk @echo "HOST_ARCH:=$$(${CC} -dumpmachine | sed -e s'/-.*//' \ -e 's/sparc.*/sparc/' \ -e 's/arm.*/arm/g' \ -e 's/m68k.*/m68k/' \ -e 's/ppc/powerpc/g' \ -e 's/v850.*/v850/g' \ -e 's/sh[234]/sh/' \ -e 's/mips-.*/mips/' \ -e 's/mipsel-.*/mipsel/' \ -e 's/cris.*/cris/' \ -e 's/i[3-9]86/i386/' \ )" >>lbin/prereq.mk @echo 'HOSTCC:=${CC}' >>lbin/prereq.mk @x="$$(echo 'f:\n\techo P:$${CFLAGS}\n.include ' | \ ${MAKE} -f - f EXPERIMENTAL=yes 2>/dev/null | grep '^P:' \ 2>/dev/null | sed 's/^P://')"; \ echo "HOSTCFLAGS:=$${x:--O2 ${CFLAGS}}" | sed 's/ *$$//' \ >>lbin/prereq.mk @echo 'LC_ALL:=C' >>lbin/prereq.mk @echo 'MAKE:=${GMAKE}' >>lbin/prereq.mk @echo "OStype:=$$(env NOFAKE=yes uname)" >>lbin/prereq.mk @echo "_PATH:=$$PATH" >>lbin/prereq.mk @echo "PATH:=$$(pwd)/lbin:$$PATH" >>lbin/prereq.mk @echo "SHELL:=$$(lbin/which bash)" >>lbin/prereq.mk @echo "TOPDIR:=$$(readlink -nf .)" >>lbin/prereq.mk @env NO_ERROR=${NO_ERROR} bash scripts/scan-tools.sh @ln -s $$(lbin/which ${CC}) lbin/gcc @${GMAKE_INV} tools/install-lbin @echo '===> Prerequisites checked successfully.' @touch $@ .PHONY: prereq prereq-noerror