root/trunk/freewrt/rules.mk

Revision 3710, 3.3 kB (checked in by n0-1, 9 months ago)

hook in fon2100 support into the ADK

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
7 include $(TOPDIR)/lbin/prereq.mk
8 -include $(TOPDIR)/.config
9 -include ${TOPDIR}/prefs.mk
10
11 ifeq ($(V),)
12 V=                      5
13 endif
14
15 ifneq ($(V),0)
16 TRACE:=                 echo "---> "
17 START_TRACE:=           echo -n "---> "
18 END_TRACE:=             echo
19 else
20 START_TRACE:=           :
21 END_TRACE:=             :
22 TRACE:=                 :
23 endif
24
25 ifeq (${shell [ "$(V)" -ge 5 ] && echo 1},)
26 CMD_TRACE:=             :
27 PKG_TRACE:=             :
28 else
29 CMD_TRACE:=             echo -n
30 PKG_TRACE:=             echo "------> "
31 endif
32
33 ifeq (${shell [ "$(V)" -ge 10 ] && echo 1},)
34 EXTRA_MAKEFLAGS:=       -s
35 MAKE_TRACE:=            >/dev/null 2>&1 || { echo "Build failed. Please re-run make with V=99 to see what's going on"; false; }
36 else
37 MAKE_TRACE:=
38 EXTRA_MAKEFLAGS:=
39 TRACE:=                 :
40 PKG_TRACE:=             :
41 CMD_TRACE:=             :
42 START_TRACE:=           :
43 END_TRACE:=             :
44 endif
45
46 ifeq (${shell [ "$(V)" -ge 90 ] && echo 1},)
47 SET_DASHX:=             :
48 else
49 SET_DASHX:=             set -x
50 endif
51
52 # Strip off the annoying quoting
53 ARCH:=                  $(strip $(subst ",, $(FWRT_ARCH)))
54 TARGET_OPTIMIZATION:=   $(strip $(subst ",, $(FWRT_TARGET_OPTIMIZATION)))
55 FWRT_PREFIX:=           $(strip $(subst ",, $(FWRT_PREFIX)))
56 #"))"))"))"))")) # for vim's broken syntax highlighting :)
57
58 ifneq ($(strip ${FWRT_USE_CCACHE}),)
59 TARGET_COMPILER_PREFIX= ccache-
60 endif
61
62 include $(TOPDIR)/mk/vars.mk
63
64 ifneq (${FWRT_MANPAGES},y)
65 BSDMAKE_FLAGS+=         NOMAN=Yes
66 endif
67
68 TARGET_CC:=             $(strip ${TARGET_CC})
69 TARGET_CXX:=            $(strip ${TARGET_CXX})
70
71 ifeq ($(strip ${FWRT_JLEVEL}),-1)
72 MAKEFLAGS+=             -j
73 elifneq ($(strip ${FWRT_JLEVEL}),)
74 ifneq ($(strip ${FWRT_JLEVEL}),0)
75 ifneq ($(strip ${FWRT_JLEVEL}),1)
76 MAKEFLAGS+=             -j$(strip ${FWRT_JLEVEL})
77 endif
78 endif
79 endif
80
81 ifeq ($(strip ${FWRT_HAVE_DOT_CONFIG}),y)
82 # XXX derive these from FWRT_* vars
83 UNAME_S:=               Linux
84
85 ifeq ($(strip ${FWRT_LINUX_2_6_AR7}),y)
86 UNAME_R:=               2.6.21.1
87 else ifeq ($(strip ${FWRT_LINUX_2_6_ATHEROS}),y)
88 UNAME_R:=               2.6.23.12
89 else ifeq ($(strip ${FWRT_LINUX_2_6_BRCM_ASUS_WL500G_PREMIUM}),y)
90 UNAME_R:=               2.6.22.1
91 else ifeq ($(strip ${FWRT_LINUX_2_4}),y)
92 UNAME_R:=               2.4.34
93 else ifeq ($(strip ${FWRT_LINUX_2_6}),y)
94 UNAME_R:=               2.6.19.1
95 else
96 UNAME_R=                $(error Cannot determine target "uname -r" output)
97 endif
98
99 ifeq ($(strip ${FWRT_mipsel}),y)
100 UNAME_M:=               mips
101 else ifeq ($(strip ${FWRT_mips}),y)
102 UNAME_M:=               mips
103 else ifeq ($(strip ${FWRT_i386}),y)
104 UNAME_M:=               i386
105 else ifeq ($(strip ${FWRT_armeb}),y)
106 UNAME_M:=               arm
107 else ifeq ($(strip ${FWRT_arm}),y)
108 UNAME_M:=               arm
109 else ifeq ($(strip ${FWRT_avr32}),y)
110 UNAME_M:=               avr32
111 else ifeq ($(strip ${FWRT_cris}),y)
112 UNAME_M:=               cris
113 else ifeq ($(strip ${FWRT_powerpc}),y)
114 UNAME_M:=               powerpc
115 else
116 UNAME_M=                $(error Cannot determine target "uname -m" output)
117 endif
118
119 export UNAME_S UNAME_R UNAME_M
120 else    # ! ifeq ($(strip ${FWRT_HAVE_DOT_CONFIG}),y)
121 UNAME_S=                $(error This variable cannot be used without .config)
122 UNAME_R=                $(error This variable cannot be used without .config)
123 UNAME_M=                $(error This variable cannot be used without .config)
124 endif   # ! ifeq ($(strip ${FWRT_HAVE_DOT_CONFIG}),y)
125
126 export BASH HOSTCC HOSTCFLAGS MAKE LANGUAGE LC_ALL NROFF OStype PATH
127
128 HOSTCPPFLAGS?=
129 HOSTLDFLAGS?=
130
131 HOST_CFLAGS:=           ${HOSTCFLAGS}
132 TARGET_CFLAGS:=         $(strip -Os -fno-ident ${TARGET_CFLAGS} -fwrapv -fhonour-copts)
133 TARGET_CC:=             $(strip ${TARGET_CC})
134 TARGET_CXX:=            $(strip ${TARGET_CXX})
135
136 ifneq (${show},)
137 _show:
138         @echo '$($(show))'
139 endif
Note: See TracBrowser for help on using the browser.