source: freewrt/rules.mk@ ff5402d

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

move off everything which can be done by both BSD and GNU make into vars.mk
and shuffle rules.mk appropriately

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

  • Property mode set to 100644
File size: 1.6 KB
Line 
1# $FreeWRT$
2
3include $(TOPDIR)/lbin/prereq.mk
4include $(TOPDIR)/.config
5
6ifeq ($(V),)
7V= 5
8endif
9
10ifneq ($(V),0)
11TRACE:= echo "---> "
12START_TRACE:= echo -n "---> "
13END_TRACE:= echo
14else
15START_TRACE:= :
16END_TRACE:= :
17TRACE:= :
18endif
19
20ifeq (${shell [ "$(V)" -ge 5 ] && echo 1},)
21CMD_TRACE:= :
22PKG_TRACE:= :
23else
24CMD_TRACE:= echo -n
25PKG_TRACE:= echo "------> "
26endif
27
28ifeq (${shell [ "$(V)" -ge 10 ] && echo 1},)
29EXTRA_MAKEFLAGS:= -s
30MAKE_TRACE:= >/dev/null 2>&1 || { echo "Build failed. Please re-run make with V=99 to see what's going on"; false; }
31else
32MAKE_TRACE:=
33EXTRA_MAKEFLAGS:=
34TRACE:= :
35PKG_TRACE:= :
36CMD_TRACE:= :
37START_TRACE:= :
38END_TRACE:= :
39endif
40
41ifeq (${shell [ "$(V)" -ge 90 ] && echo 1},)
42SET_DASHX:= :
43else
44SET_DASHX:= set -x
45endif
46
47# Strip off the annoying quoting
48ARCH:= $(strip $(subst ",, $(BR2_ARCH)))
49WGET:= $(strip $(subst ",, $(BR2_WGET)))
50TARGET_OPTIMIZATION:= $(strip $(subst ",, $(BR2_TARGET_OPTIMIZATION)))
51#"))"))"))"))")) # for vim's broken syntax highlighting :)
52
53HOST_ARCH:= $(shell $(HOSTCC) -dumpmachine | sed -e s'/-.*//' \
54 -e 's/sparc.*/sparc/' \
55 -e 's/arm.*/arm/g' \
56 -e 's/m68k.*/m68k/' \
57 -e 's/ppc/powerpc/g' \
58 -e 's/v850.*/v850/g' \
59 -e 's/sh[234]/sh/' \
60 -e 's/mips-.*/mips/' \
61 -e 's/mipsel-.*/mipsel/' \
62 -e 's/cris.*/cris/' \
63 -e 's/i[3-9]86/i386/' \
64 )
65
66include $(TOPDIR)/vars.mk
67
68ifeq (${OStype},Linux)
69MKPASSWD:= $(STAGING_DIR)/bin/mkpasswd -H md5
70else
71MKPASSWD:= encrypt -m
72endif
73
74export BASH HOSTCC HOSTCFLAGS LC_ALL MAKE OStype PATH
75export UNAME_S UNAME_R UNAME_M
76
77_show:
78 @echo '$($(show))'
Note: See TracBrowser for help on using the repository browser.