source: freewrt/Makefile@ 9b1bade

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

resolve a bad interaction between shell quoting
and shell evaluation of inside commands in the
$(HOSTCFLAGS) determination algorithm

it's a pity we have to be compatible to a lowest
common denominator of make and sh for all systems...

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

  • Property mode set to 100644
File size: 3.0 KB
RevLine 
[6d5c7cc]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>
[475ad56]5#
[6d5c7cc]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.
[475ad56]12#
[6d5c7cc]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.
[475ad56]22#
[6d5c7cc]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= PATH=$(PWD)/lbin:$(PATH) ${GMAKE} -f $(PWD)/build.mk ${VARS_TO_PASS}
34
[a6198ce]35VARS_TO_PASS= HOSTCC='${CC}' MAKE='${GMAKE}' LC_ALL=C \
[9b1bade]36 HOSTCFLAGS="$$(set +x; x=$$(echo \
[a2011ad]37 'f:\n\techo P:$${CFLAGS}\n.include <bsd.prog.mk>' | \
38 ${MAKE} -f - f EXPERIMENTAL=yes 2>/dev/null | grep '^P:' \
[8ec9389]39 2>/dev/null | sed 's/^P://'); echo $${x:--O2 ${CFLAGS}})"
[6d5c7cc]40
41all: prereq
42 ${GMAKE_INV} all
43
[71b4d1c]44v: prereq
[9b1bade]45 (set -x; ${GMAKE_INV} all V=99) 2>&1 | tee -a make.log
[71b4d1c]46
[aaafd63]47verbose: prereq
48 ${GMAKE_INV} all V=99
49
[6d5c7cc]50clean: prereq
51 ${GMAKE_INV} clean
52
53config: prereq
54 ${GMAKE_INV} config
55
[4ea6595]56cleandir: prereq
57 ${GMAKE_INV} cleandir
[41be261]58 @-rm -rf lbin
[43b940a]59 @-rm -f make.log prereq
[6d5c7cc]60
61distclean: prereq
62 ${GMAKE_INV} distclean
[41be261]63 @-rm -rf lbin
[43b940a]64 @-rm -f make.log prereq
[6d5c7cc]65
66image_clean: prereq
67 ${GMAKE_INV} image_clean
68
69menuconfig: prereq
70 ${GMAKE_INV} menuconfig
71
72oldconfig: prereq
73 ${GMAKE_INV} oldconfig
74
75package_index: prereq
76 ${GMAKE_INV} package_index
77
78source: prereq
79 ${GMAKE_INV} source
80
81target_clean: prereq
82 ${GMAKE_INV} target_clean
83
84world: prereq
85 ${GMAKE_INV} world
86
87prereq:
[41be261]88 @-rm -rf prereq lbin
89 @mkdir lbin
90 @if which gmake >/dev/null 2>&1; then \
[6d5c7cc]91 ln -s $$(which gmake) lbin/gmake; \
92 else \
93 ln -s $$(which make) lbin/gmake; \
94 fi
[41be261]95 @if ! which md5sum >/dev/null 2>&1; then \
[6d5c7cc]96 cp scripts/md5sum.bsd lbin/md5sum; \
97 chmod 555 lbin/md5sum; \
98 fi
[41be261]99 @touch $@
Note: See TracBrowser for help on using the repository browser.