source: freewrt/rules.mk@ 727dae0d

Last change on this file since 727dae0d was b27da3ee, checked in by Waldemar Brodkorb <wbx@…>, 18 years ago

add some more no_kernel architectures, some are verified, some not, i get some new hardware soon, to verify the toolchain and some packages :}

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

  • Property mode set to 100644
File size: 3.1 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 ifeq ($(strip ${FWRT_arm}),y)
104UNAME_M:= arm
105else ifeq ($(strip ${FWRT_avr32}),y)
106UNAME_M:= avr32
107else ifeq ($(strip ${FWRT_cris}),y)
108UNAME_M:= cris
109else ifeq ($(strip ${FWRT_powerpc}),y)
110UNAME_M:= powerpc
111else
112$(error Cannot determine target "uname -m" output)
113endif
114
115export UNAME_S UNAME_R UNAME_M
116else # ! ifeq ($(strip ${FWRT_HAVE_DOT_CONFIG}),y)
117UNAME_S= $(error This variable cannot be used without .config)
118UNAME_R= $(error This variable cannot be used without .config)
119UNAME_M= $(error This variable cannot be used without .config)
120endif # ! ifeq ($(strip ${FWRT_HAVE_DOT_CONFIG}),y)
121
122export BASH HOSTCC HOSTCFLAGS MAKE LANGUAGE LC_ALL OStype PATH
123
124HOSTCPPFLAGS?=
125HOSTLDFLAGS?=
126
127HOST_CFLAGS:= ${HOSTCFLAGS}
128TARGET_CFLAGS:= $(strip -Os -fno-ident ${TARGET_CFLAGS} -fwrapv -fhonour-copts)
129TARGET_CC:= $(strip ${TARGET_CC})
130TARGET_CXX:= $(strip ${TARGET_CXX})
131
132ifneq (${show},)
133_show:
134 @echo '$($(show))'
135endif
Note: See TracBrowser for help on using the repository browser.