source: freewrt/Makefile@ d98165f

Last change on this file since d98165f was 925b0c7, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago

add autobuild, still busybox need to be excluded in any good way. no idea for that at the moment. remove unused stuff.

git-svn-id: svn://www.freewrt.org/trunk/freewrt@492 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 4.9 KB
Line 
1# $FreeWRT: src/share/misc/licence.template,v 1.7 2006/04/09 22:08:49 tg Rel $
2#-
3# Copyright (c) 2006
4# Thorsten Glaser <tg@mirbsd.de>
5#
6# Licensee is hereby permitted to deal in this work without restric-
7# tion, including unlimited rights to use, publicly perform, modify,
8# merge, distribute, sell, give away or sublicence, provided all co-
9# pyright notices above, these terms and the disclaimer are retained
10# in all redistributions or reproduced in accompanying documentation
11# or other materials provided with binary redistributions.
12#
13# All advertising materials mentioning features or use of this soft-
14# ware must display the following acknowledgement:
15# This product includes material provided by Thorsten Glaser.
16# This acknowledgement does not need to be reprinted if this work is
17# linked into a bigger work whose licence does not allow such clause
18# and the author of this work is given due credit in the bigger work
19# or its documentation. Specifically, re-using this code in any work
20# covered by the GNU General Public License version 1 or Library Ge-
21# neral Public License (any version) is permitted.
22#
23# Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
24# express, or implied, to the maximum extent permitted by applicable
25# law, without malicious intent or gross negligence; in no event may
26# licensor, an author or contributor be held liable for any indirect
27# or other damage, or direct damage except proven a consequence of a
28# direct error of said person and intended use of this work, loss or
29# other issues arising in any way out of its use, even if advised of
30# the possibility of such damage or existence of a nontrivial bug.
31
32GMAKE?= $(PWD)/lbin/gmake
33GMAKE_FMK= ${GMAKE} -f $(PWD)/build.mk
34GMAKE_INV= ${GMAKE_FMK} --no-print-directory
35
36all: .prereq_done
37 @${GMAKE_INV} all
38
39v: .prereq_done
40 (echo; echo "Build started on $$(LC_ALL=C TZ=UTC date)"; set -x; \
41 ${GMAKE_FMK} all V=99) 2>&1 | tee -a make.log
42
43verbose: .prereq_done
44 @${GMAKE_FMK} all V=99
45
46clean: .prereq_done
47 @${GMAKE_INV} clean
48
49config: .prereq_done
50 @${GMAKE_INV} config
51
52cleandir: .prereq_done
53 @${GMAKE_INV} cleandir
54 @-rm -rf lbin
55 @-rm -f make.log .prereq_done
56
57distclean: .prereq_done
58 @${GMAKE_INV} distclean
59 @-rm -rf lbin
60 @-rm -f make.log .prereq_done
61
62image_clean: .prereq_done
63 @${GMAKE_INV} image_clean
64
65menuconfig: .prereq_done
66 @${GMAKE_INV} menuconfig
67
68oldconfig: .prereq_done
69 @${GMAKE_INV} oldconfig
70
71autobuild: .prereq_done
72 @${GMAKE_INV} autobuild
73
74package_index: .prereq_done
75 @${GMAKE_INV} package_index
76
77target_clean: .prereq_done
78 @${GMAKE_INV} target_clean
79
80world: .prereq_done
81 @${GMAKE_INV} world
82
83prereq:
84 @rm -f .prereq_done
85 @${MAKE} .prereq_done
86
87prereq-noerror:
88 @rm -f .prereq_done
89 @${MAKE} .prereq_done NO_ERROR=1
90
91NO_ERROR=0
92.prereq_done:
93 @-rm -rf .prereq_done lbin
94 @if ! bash --version 2>&1 | fgrep 'GNU bash' >/dev/null 2>&1; then \
95 echo "FreeWRT requires GNU bash to be installed, sorry."; \
96 exit 1; \
97 fi
98 @mkdir lbin
99 @if which nonexistent 2>&1 | grep -q '^no '; then \
100 cp scripts/which.mac lbin/which; \
101 chmod 555 lbin/which; \
102 else \
103 ln -s $$(which which) lbin/which; \
104 fi
105 @if lbin/which gmake >/dev/null 2>&1; then \
106 ln -s $$(lbin/which gmake) lbin/gmake; \
107 else \
108 ln -s $$(lbin/which make) lbin/gmake; \
109 fi
110 @if ! lbin/which md5sum >/dev/null 2>&1; then \
111 cp scripts/md5sum.bsd lbin/md5sum; \
112 chmod 555 lbin/md5sum; \
113 fi
114 @if test x"$$(uname)" = x"MirBSD"; then \
115 sed -e 's!@@FromOS@@!MirBSD!g' -e 's!@@ToOS@@!OpenBSD!g' \
116 -e "s!@@PROG@@!$$(lbin/which uname)!g" \
117 <scripts/uname.fake >lbin/uname; \
118 chmod 555 lbin/uname; \
119 fi
120 @echo "BASH:=$$(lbin/which bash)" >>lbin/prereq.mk
121 @echo 'GMAKE:=${GMAKE}' >>lbin/prereq.mk
122 @echo "GNU_HOST_NAME:=$$(${CC} -dumpmachine | sed \
123 -e 's!mirbsd!openbsd!g' \
124 )" >>lbin/prereq.mk
125 @echo "HOST_ARCH:=$$(${CC} -dumpmachine | sed -e s'/-.*//' \
126 -e 's/sparc.*/sparc/' \
127 -e 's/arm.*/arm/g' \
128 -e 's/m68k.*/m68k/' \
129 -e 's/ppc/powerpc/g' \
130 -e 's/v850.*/v850/g' \
131 -e 's/sh[234]/sh/' \
132 -e 's/mips-.*/mips/' \
133 -e 's/mipsel-.*/mipsel/' \
134 -e 's/cris.*/cris/' \
135 -e 's/i[3-9]86/i386/' \
136 )" >>lbin/prereq.mk
137 @echo 'HOSTCC:=${CC}' >>lbin/prereq.mk
138 @x="$$(echo 'f:\n\techo P:$${CFLAGS}\n.include <bsd.prog.mk>' | \
139 ${MAKE} -f - f EXPERIMENTAL=yes 2>/dev/null | grep '^P:' \
140 2>/dev/null | sed 's/^P://')"; \
141 echo "HOSTCFLAGS:=$${x:--O2 ${CFLAGS}}" | sed 's/ *$$//' \
142 >>lbin/prereq.mk
143 @echo 'LC_ALL:=C' >>lbin/prereq.mk
144 @echo 'MAKE:=${GMAKE}' >>lbin/prereq.mk
145 @echo "OStype:=$$(env NOFAKE=yes uname)" >>lbin/prereq.mk
146 @echo "_PATH:=$$PATH" >>lbin/prereq.mk
147 @echo "PATH:=$$(pwd)/lbin:$$PATH" >>lbin/prereq.mk
148 @echo "SHELL:=$$(lbin/which bash)" >>lbin/prereq.mk
149 @echo "TOPDIR:=$$(readlink -nf .)" >>lbin/prereq.mk
150 @env NO_ERROR=${NO_ERROR} bash scripts/scan-tools.sh
151 @ln -s $$(lbin/which ${CC}) lbin/gcc
152 @${GMAKE_INV} tools/install-lbin
153 @echo '===> Prerequisites checked successfully.'
154 @touch $@
155
156.PHONY: prereq prereq-noerror
Note: See TracBrowser for help on using the repository browser.