source: freewrt/Makefile@ bc1387d

freewrt_1_0 freewrt_2_0
Last change on this file since bc1387d was bc1387d, checked in by Thorsten Glaser <tg@…>, 19 years ago

after creating prereq, tell the user it's done

ok wbx@

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

  • Property mode set to 100644
File size: 3.8 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_INV= ${GMAKE} --no-print-directory -f $(PWD)/build.mk
34
35all: prereq
36 @${GMAKE_INV} all
37
38v: prereq
39 (echo; echo "Build started on $$(LC_ALL=C TZ=UTC date)"; set -x; \
40 ${GMAKE_INV} all V=99) 2>&1 | tee -a make.log
41
42verbose: prereq
43 @${GMAKE_INV} all V=99
44
45clean: prereq
46 @${GMAKE_INV} clean
47
48config: prereq
49 @${GMAKE_INV} config
50
51cleandir: prereq
52 @${GMAKE_INV} cleandir
53 @-rm -rf lbin
54 @-rm -f make.log prereq
55
56distclean: prereq
57 @${GMAKE_INV} distclean
58 @-rm -rf lbin
59 @-rm -f make.log prereq
60
61image_clean: prereq
62 @${GMAKE_INV} image_clean
63
64menuconfig: prereq
65 @${GMAKE_INV} menuconfig
66
67oldconfig: prereq
68 @${GMAKE_INV} oldconfig
69
70package_index: prereq
71 @${GMAKE_INV} package_index
72
73source: prereq
74 @${GMAKE_INV} source
75
76target_clean: prereq
77 @${GMAKE_INV} target_clean
78
79world: prereq
80 @${GMAKE_INV} world
81
82prereq-noerror:
83 @${MAKE} prereq NO_ERROR=1
84
85NO_ERROR=0
86prereq:
87 @-rm -rf prereq lbin
88 @if ! bash --version 2>&1 | fgrep 'GNU bash' >/dev/null 2>&1; then \
89 echo "FreeWRT requires GNU bash to be installed, sorry."; \
90 exit 1; \
91 fi
92 @mkdir lbin
93 @if which gmake >/dev/null 2>&1; then \
94 ln -s $$(which gmake) lbin/gmake; \
95 else \
96 ln -s $$(which make) lbin/gmake; \
97 fi
98 @if ! which md5sum >/dev/null 2>&1; then \
99 cp scripts/md5sum.bsd lbin/md5sum; \
100 chmod 555 lbin/md5sum; \
101 fi
102 @if test x"$$(uname)" = x"MirBSD"; then \
103 sed -e 's!@@FromOS@@!MirBSD!g' -e 's!@@ToOS@@!OpenBSD!g' \
104 -e "s!@@PROG@@!$$(which uname)!g" \
105 <scripts/uname.fake >lbin/uname; \
106 chmod 555 lbin/uname; \
107 fi
108 @echo 'HOSTCC=${CC}' >>lbin/prereq.mk
109 @x="$$(echo 'f:\n\techo P:$${CFLAGS}\n.include <bsd.prog.mk>' | \
110 ${MAKE} -f - f EXPERIMENTAL=yes 2>/dev/null | grep '^P:' \
111 2>/dev/null | sed 's/^P://')"; \
112 echo "HOSTCFLAGS=$${x:--O2 ${CFLAGS}}" | sed 's/ *$$//' \
113 >>lbin/prereq.mk
114 @echo 'LC_ALL=C' >>lbin/prereq.mk
115 @echo 'MAKE=${GMAKE}' >>lbin/prereq.mk
116 @echo "OStype=$$(env NOFAKE=yes uname)" >>lbin/prereq.mk
117 @echo "PATH=$$(pwd)/lbin:$$PATH" >>lbin/prereq.mk
118 @echo "export HOSTCC HOSTCFLAGS LC_ALL MAKE OStype PATH" \
119 >>lbin/prereq.mk
120 @env NO_ERROR=${NO_ERROR} bash scripts/scan-tools.sh
121 @echo '===> Prerequisites checked successfully.'
122 @touch $@
Note: See TracBrowser for help on using the repository browser.