source: freewrt/Makefile@ 8139583

freewrt_1_0 freewrt_2_0
Last change on this file since 8139583 was ce136e7, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago

some more stuff, snapshot build via ib.sh -s works again

git-svn-id: svn://www.freewrt.org/branches/freewrt_1_0@1278 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 3.8 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
7GMAKE?= $(PWD)/lbin/gmake
8GMAKE_FMK= ${GMAKE} -f $(PWD)/mk/build.mk
9GMAKE_INV= ${GMAKE_FMK} --no-print-directory
10
11all: .prereq_done
12 @${GMAKE_INV} all
13
14v: .prereq_done
15 (echo; echo "Build started on $$(LC_ALL=C TZ=UTC date)"; set -x; \
16 ${GMAKE_FMK} all V=99) 2>&1 | tee -a make.log
17
18verbose: .prereq_done
19 @${GMAKE_FMK} all V=99
20
21clean: .prereq_done
22 @${GMAKE_INV} clean
23
24cleanbuild: .prereq_done
25 @${GMAKE_INV} cleanbuild
26
27
28config: .prereq_done
29 @${GMAKE_INV} config
30
31cleandir: .prereq_done
32 @${GMAKE_INV} cleandir
33 @-rm -rf lbin
34 @-rm -f make.log .prereq_done
35
36distclean: .prereq_done
37 @${GMAKE_INV} distclean
38 @-rm -rf lbin
39 @-rm -f make.log .prereq_done
40
41image_clean: .prereq_done
42 @${GMAKE_INV} image_clean
43
44menuconfig: .prereq_done
45 @${GMAKE_INV} menuconfig
46
47allnoconfig: .prereq_done
48 @${GMAKE_INV} allnoconfig
49
50allmodconfig: .prereq_done
51 @${GMAKE_INV} allmodconfig
52
53snapshotconfig: .prereq_done
54 @${GMAKE_INV} snapshotconfig
55
56package_index: .prereq_done
57 @${GMAKE_INV} package_index
58
59target_clean: .prereq_done
60 @${GMAKE_INV} target_clean
61
62world: .prereq_done
63 @${GMAKE_INV} world
64
65allpackages: .prereq_done
66 @${GMAKE_INV} allpackages
67
68prereq:
69 @rm -f .prereq_done
70 @${MAKE} .prereq_done
71
72prereq-noerror:
73 @rm -f .prereq_done
74 @${MAKE} .prereq_done NO_ERROR=1
75
76NO_ERROR=0
77.prereq_done:
78 @-rm -rf .prereq_done lbin
79 @if ! bash --version 2>&1 | fgrep 'GNU bash' >/dev/null 2>&1; then \
80 echo "FreeWRT requires GNU bash to be installed, sorry."; \
81 exit 1; \
82 fi
83 @mkdir lbin
84 @if which nonexistent 2>&1 | grep -q '^no '; then \
85 cp scripts/which.mac lbin/which; \
86 chmod 555 lbin/which; \
87 else \
88 ln -s $$(which which) lbin/which; \
89 fi
90 @if lbin/which gmake >/dev/null 2>&1; then \
91 ln -s $$(lbin/which gmake) lbin/gmake; \
92 else \
93 ln -s $$(lbin/which make) lbin/gmake; \
94 fi
95 @if ! lbin/which md5sum >/dev/null 2>&1; then \
96 cp scripts/md5sum.bsd lbin/md5sum; \
97 chmod 555 lbin/md5sum; \
98 fi
99 @if test x"$$(uname)" = x"MirBSD"; then \
100 sed -e 's!@@FromOS@@!MirBSD!g' -e 's!@@ToOS@@!OpenBSD!g' \
101 -e "s!@@PROG@@!$$(lbin/which uname)!g" \
102 <scripts/uname.fake >lbin/uname; \
103 chmod 555 lbin/uname; \
104 fi
105 @echo "TOPDIR:=$$(readlink -nf .)" >lbin/prereq.mk
106 @echo "BASH:=$$(lbin/which bash)" >>lbin/prereq.mk
107 @echo 'GMAKE:=$${TOPDIR}/lbin/gmake' >>lbin/prereq.mk
108 @echo "GNU_HOST_NAME:=$$(${CC} -dumpmachine | sed \
109 -e 's!mirbsd!openbsd!g' \
110 )" >>lbin/prereq.mk
111 @echo "HOST_ARCH:=$$(${CC} -dumpmachine | sed -e s'/-.*//' \
112 -e 's/sparc.*/sparc/' \
113 -e 's/arm.*/arm/g' \
114 -e 's/m68k.*/m68k/' \
115 -e 's/ppc/powerpc/g' \
116 -e 's/v850.*/v850/g' \
117 -e 's/sh[234]/sh/' \
118 -e 's/mips-.*/mips/' \
119 -e 's/mipsel-.*/mipsel/' \
120 -e 's/cris.*/cris/' \
121 -e 's/i[3-9]86/i386/' \
122 )" >>lbin/prereq.mk
123 @echo 'HOSTCC:=${CC}' >>lbin/prereq.mk
124 @x="$$(echo 'f:\n\techo P:$${CFLAGS}\n.include <bsd.prog.mk>' | \
125 ${MAKE} -f - f EXPERIMENTAL=yes 2>/dev/null | grep '^P:' \
126 2>/dev/null | sed 's/^P://')"; \
127 echo "HOSTCFLAGS:=$${x:--O2 ${CFLAGS}}" | sed 's/ *$$//' \
128 >>lbin/prereq.mk
129 @echo 'LC_ALL:=C' >>lbin/prereq.mk
130 @echo 'MAKE:=$${GMAKE}' >>lbin/prereq.mk
131 @echo "OStype:=$$(env NOFAKE=yes uname)" >>lbin/prereq.mk
132 @echo "_PATH:=$$PATH" >>lbin/prereq.mk
133 @echo "PATH:=\$${TOPDIR}/lbin:$$PATH" >>lbin/prereq.mk
134 @echo "SHELL:=$$(lbin/which bash)" >>lbin/prereq.mk
135 @TOPDIR=$$(readlink -nf .); \
136 printf '%s\n%s\nwq\n' "%g#$$TOPDIR#s##\$${TOPDIR}#g" \
137 "1s#^.*\$$#TOPDIR:=$$TOPDIR#" | ed -s lbin/prereq.mk
138 @env NO_ERROR=${NO_ERROR} bash scripts/scan-tools.sh
139 @ln -s $$(lbin/which ${CC}) lbin/gcc
140 @${GMAKE_INV} tools/install-lbin
141 @echo '===> Prerequisites checked successfully.'
142 @touch $@
143
144.PHONY: prereq prereq-noerror
Note: See TracBrowser for help on using the repository browser.