source: freewrt/rules.mk@ 1a0809b

Last change on this file since 1a0809b was 9f62bc1, checked in by Thorsten Glaser <tg@…>, 18 years ago

there is no ${FWRT_WGET} or ${WGET}

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

  • Property mode set to 100644
File size: 2.9 KB
Line 
1# $FreeWRT$
2#-
3# This file is part of the FreeWRT project. FreeWRT is copyrighted
4# material, please see the LICENCE file in the top-level directory
5# or at http://www.freewrt.org/licence for details.
6
7include $(TOPDIR)/lbin/prereq.mk
8-include $(TOPDIR)/.config
9-include ${TOPDIR}/prefs.mk
10
11ifeq ($(V),)
12V= 5
13endif
14
15ifneq ($(V),0)
16TRACE:= echo "---> "
17START_TRACE:= echo -n "---> "
18END_TRACE:= echo
19else
20START_TRACE:= :
21END_TRACE:= :
22TRACE:= :
23endif
24
25ifeq (${shell [ "$(V)" -ge 5 ] && echo 1},)
26CMD_TRACE:= :
27PKG_TRACE:= :
28else
29CMD_TRACE:= echo -n
30PKG_TRACE:= echo "------> "
31endif
32
33ifeq (${shell [ "$(V)" -ge 10 ] && echo 1},)
34EXTRA_MAKEFLAGS:= -s
35MAKE_TRACE:= >/dev/null 2>&1 || { echo "Build failed. Please re-run make with V=99 to see what's going on"; false; }
36else
37MAKE_TRACE:=
38EXTRA_MAKEFLAGS:=
39TRACE:= :
40PKG_TRACE:= :
41CMD_TRACE:= :
42START_TRACE:= :
43END_TRACE:= :
44endif
45
46ifeq (${shell [ "$(V)" -ge 90 ] && echo 1},)
47SET_DASHX:= :
48else
49SET_DASHX:= set -x
50endif
51
52# Strip off the annoying quoting
53ARCH:= $(strip $(subst ",, $(FWRT_ARCH)))
54TARGET_OPTIMIZATION:= $(strip $(subst ",, $(FWRT_TARGET_OPTIMIZATION)))
55FWRT_PREFIX:= $(strip $(subst ",, $(FWRT_PREFIX)))
56#"))"))"))"))")) # for vim's broken syntax highlighting :)
57
58ifneq ($(strip ${FWRT_USE_CCACHE}),)
59TARGET_COMPILER_PREFIX= ccache-
60endif
61
62include $(TOPDIR)/mk/vars.mk
63
64TARGET_CC:= $(strip ${TARGET_CC})
65TARGET_CXX:= $(strip ${TARGET_CXX})
66
67ifeq (${OStype},Linux)
68MKPASSWD:= $(STAGING_TOOLS)/bin/mkpasswd -H md5
69else
70MKPASSWD:= encrypt -m
71endif
72
73ifeq ($(strip ${FWRT_JLEVEL}),-1)
74MAKEFLAGS+= -j
75elifneq ($(strip ${FWRT_JLEVEL}),)
76ifneq ($(strip ${FWRT_JLEVEL}),0)
77ifneq ($(strip ${FWRT_JLEVEL}),1)
78MAKEFLAGS+= -j$(strip ${FWRT_JLEVEL})
79endif
80endif
81endif
82
83ifeq ($(strip ${FWRT_HAVE_DOT_CONFIG}),y)
84# XXX derive these from FWRT_* vars
85UNAME_S:= Linux
86
87ifeq ($(strip ${FWRT_LINUX_2_6_AR7}),y)
88UNAME_R:= 2.6.21.1
89else ifeq ($(strip ${FWRT_LINUX_2_4}),y)
90UNAME_R:= 2.4.34
91else ifeq ($(strip ${FWRT_LINUX_2_6}),y)
92UNAME_R:= 2.6.19.1
93else
94$(error Cannot determine target "uname -r" output)
95endif
96
97ifeq ($(strip ${FWRT_mipsel}),y)
98UNAME_M:= mips
99else ifeq ($(strip ${FWRT_i386}),y)
100UNAME_M:= i386
101else ifeq ($(strip ${FWRT_armeb}),y)
102UNAME_M:= arm
103else
104$(error Cannot determine target "uname -m" output)
105endif
106
107export UNAME_S UNAME_R UNAME_M
108else # ! ifeq ($(strip ${FWRT_HAVE_DOT_CONFIG}),y)
109UNAME_S= $(error This variable cannot be used without .config)
110UNAME_R= $(error This variable cannot be used without .config)
111UNAME_M= $(error This variable cannot be used without .config)
112endif # ! ifeq ($(strip ${FWRT_HAVE_DOT_CONFIG}),y)
113
114export BASH HOSTCC HOSTCFLAGS MAKE LANGUAGE LC_ALL OStype PATH
115
116HOSTCPPFLAGS?=
117HOSTLDFLAGS?=
118
119HOST_CFLAGS:= ${HOSTCFLAGS}
120TARGET_CFLAGS:= $(strip -Os -fno-ident ${TARGET_CFLAGS} -fwrapv -fhonour-copts)
121TARGET_CC:= $(strip ${TARGET_CC})
122TARGET_CXX:= $(strip ${TARGET_CXX})
123
124ifneq (${show},)
125_show:
126 @echo '$($(show))'
127endif
Note: See TracBrowser for help on using the repository browser.