source: freewrt/Makefile@ e702f43

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

we use the httpd redirect here, my bad, this is by design
and actually makes sense

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

  • Property mode set to 100644
File size: 4.2 KB
RevLine 
[00ed4e2]1# $FreeWRT$
[6d5c7cc]2#-
[00ed4e2]3# This file is part of the FreeWRT project. FreeWRT is copyrighted
4# material, please see the LICENCE file in the top-level directory
[93f20e7]5# or at http://www.freewrt.org/licence for details.
[6d5c7cc]6
7GMAKE?= $(PWD)/lbin/gmake
[db5651c]8GMAKE_FMK= ${GMAKE} -f $(PWD)/mk/build.mk
[4d98ec5]9GMAKE_INV= ${GMAKE_FMK} --no-print-directory
[6d5c7cc]10
[4d98ec5]11all: .prereq_done
[8eab46d]12 @${GMAKE_INV} all
[6d5c7cc]13
[4d98ec5]14v: .prereq_done
[acf89eb]15 (echo; echo "Build started on $$(LC_ALL=C TZ=UTC date)"; set -x; \
[4d98ec5]16 ${GMAKE_FMK} all V=99) 2>&1 | tee -a make.log
[71b4d1c]17
[4d98ec5]18verbose: .prereq_done
19 @${GMAKE_FMK} all V=99
[aaafd63]20
[4d98ec5]21clean: .prereq_done
[8eab46d]22 @${GMAKE_INV} clean
[6d5c7cc]23
[4d98ec5]24config: .prereq_done
[8eab46d]25 @${GMAKE_INV} config
[6d5c7cc]26
[4d98ec5]27cleandir: .prereq_done
[8eab46d]28 @${GMAKE_INV} cleandir
[41be261]29 @-rm -rf lbin
[4d98ec5]30 @-rm -f make.log .prereq_done
[6d5c7cc]31
[4d98ec5]32distclean: .prereq_done
[8eab46d]33 @${GMAKE_INV} distclean
[41be261]34 @-rm -rf lbin
[4d98ec5]35 @-rm -f make.log .prereq_done
[6d5c7cc]36
[4d98ec5]37image_clean: .prereq_done
[8eab46d]38 @${GMAKE_INV} image_clean
[6d5c7cc]39
[4d98ec5]40menuconfig: .prereq_done
[8eab46d]41 @${GMAKE_INV} menuconfig
[6d5c7cc]42
[4d98ec5]43oldconfig: .prereq_done
[8eab46d]44 @${GMAKE_INV} oldconfig
[6d5c7cc]45
[925b0c7]46autobuild: .prereq_done
47 @${GMAKE_INV} autobuild
48
[542263d]49snapshot: snapshots/.snapshot_done
50
51snapshots/.snapshot_done: .prereq_done .defconfig
52 -rm -rf snapshots
53 mkdir snapshots
54 ${GMAKE_INV} clean
55 for target in $$(awk '/^config FWRT_LINUX/ { print $$2 }' \
[2f84631]56 target/Config.in); do \
[14dcbb8]57 for filesystem in JFFS2 SQUASHFS_LZMA; do \
58 sed -e "s!FWRT_LINUX_MODEL!$$target!g" \
[c86c774]59 -e "s!FWRT_TARGET_ROOTFS!&_$$filesystem!g" \
[14dcbb8]60 <.defconfig >.config; \
61 ${GMAKE_INV} all; \
62 cp bin/freewrt-* snapshots/; \
63 ${GMAKE_INV} clean; \
64 done; \
[542263d]65 done
[1085fd7]66
[4d98ec5]67package_index: .prereq_done
[8eab46d]68 @${GMAKE_INV} package_index
[6d5c7cc]69
[4d98ec5]70target_clean: .prereq_done
[8eab46d]71 @${GMAKE_INV} target_clean
[6d5c7cc]72
[4d98ec5]73world: .prereq_done
[8eab46d]74 @${GMAKE_INV} world
[6d5c7cc]75
[d813884]76prereq:
[4d98ec5]77 @rm -f .prereq_done
78 @${MAKE} .prereq_done
79
[d813884]80prereq-noerror:
[4d98ec5]81 @rm -f .prereq_done
82 @${MAKE} .prereq_done NO_ERROR=1
[4ed535c]83
84NO_ERROR=0
[4d98ec5]85.prereq_done:
86 @-rm -rf .prereq_done lbin
[86dab31]87 @if ! bash --version 2>&1 | fgrep 'GNU bash' >/dev/null 2>&1; then \
88 echo "FreeWRT requires GNU bash to be installed, sorry."; \
89 exit 1; \
90 fi
[41be261]91 @mkdir lbin
[003e3c1]92 @if which nonexistent 2>&1 | grep -q '^no '; then \
[2856f83]93 cp scripts/which.mac lbin/which; \
94 chmod 555 lbin/which; \
[6d5c7cc]95 else \
[2856f83]96 ln -s $$(which which) lbin/which; \
[6d5c7cc]97 fi
[2856f83]98 @if lbin/which gmake >/dev/null 2>&1; then \
99 ln -s $$(lbin/which gmake) lbin/gmake; \
100 else \
101 ln -s $$(lbin/which make) lbin/gmake; \
102 fi
103 @if ! lbin/which md5sum >/dev/null 2>&1; then \
[6d5c7cc]104 cp scripts/md5sum.bsd lbin/md5sum; \
105 chmod 555 lbin/md5sum; \
106 fi
[b84b14f]107 @if test x"$$(uname)" = x"MirBSD"; then \
108 sed -e 's!@@FromOS@@!MirBSD!g' -e 's!@@ToOS@@!OpenBSD!g' \
[2856f83]109 -e "s!@@PROG@@!$$(lbin/which uname)!g" \
[b84b14f]110 <scripts/uname.fake >lbin/uname; \
111 chmod 555 lbin/uname; \
112 fi
[453e855]113 @echo "TOPDIR:=$$(readlink -nf .)" >lbin/prereq.mk
[7d9827e]114 @echo "BASH:=$$(lbin/which bash)" >>lbin/prereq.mk
[230f0f6]115 @echo 'GMAKE:=$${TOPDIR}/lbin/gmake' >>lbin/prereq.mk
[7d9827e]116 @echo "GNU_HOST_NAME:=$$(${CC} -dumpmachine | sed \
[2242649]117 -e 's!mirbsd!openbsd!g' \
118 )" >>lbin/prereq.mk
[7d9827e]119 @echo "HOST_ARCH:=$$(${CC} -dumpmachine | sed -e s'/-.*//' \
[2242649]120 -e 's/sparc.*/sparc/' \
121 -e 's/arm.*/arm/g' \
122 -e 's/m68k.*/m68k/' \
123 -e 's/ppc/powerpc/g' \
124 -e 's/v850.*/v850/g' \
125 -e 's/sh[234]/sh/' \
126 -e 's/mips-.*/mips/' \
127 -e 's/mipsel-.*/mipsel/' \
128 -e 's/cris.*/cris/' \
129 -e 's/i[3-9]86/i386/' \
130 )" >>lbin/prereq.mk
[7d9827e]131 @echo 'HOSTCC:=${CC}' >>lbin/prereq.mk
[b84b14f]132 @x="$$(echo 'f:\n\techo P:$${CFLAGS}\n.include <bsd.prog.mk>' | \
133 ${MAKE} -f - f EXPERIMENTAL=yes 2>/dev/null | grep '^P:' \
134 2>/dev/null | sed 's/^P://')"; \
[7d9827e]135 echo "HOSTCFLAGS:=$${x:--O2 ${CFLAGS}}" | sed 's/ *$$//' \
[b84b14f]136 >>lbin/prereq.mk
[7d9827e]137 @echo 'LC_ALL:=C' >>lbin/prereq.mk
[230f0f6]138 @echo 'MAKE:=$${GMAKE}' >>lbin/prereq.mk
[7d9827e]139 @echo "OStype:=$$(env NOFAKE=yes uname)" >>lbin/prereq.mk
140 @echo "_PATH:=$$PATH" >>lbin/prereq.mk
[230f0f6]141 @echo "PATH:=\$${TOPDIR}/lbin:$$PATH" >>lbin/prereq.mk
[7d9827e]142 @echo "SHELL:=$$(lbin/which bash)" >>lbin/prereq.mk
[453e855]143 @TOPDIR=$$(readlink -nf .); \
144 printf '%s\n%s\nwq\n' "%g#$$TOPDIR#s##\$${TOPDIR}#g" \
145 "1s#^.*\$$#TOPDIR:=$$TOPDIR#" | ed -s lbin/prereq.mk
[4ed535c]146 @env NO_ERROR=${NO_ERROR} bash scripts/scan-tools.sh
[2856f83]147 @ln -s $$(lbin/which ${CC}) lbin/gcc
[a7b530b]148 @${GMAKE_INV} tools/install-lbin
[bc1387d]149 @echo '===> Prerequisites checked successfully.'
[41be261]150 @touch $@
[d813884]151
152.PHONY: prereq prereq-noerror
Note: See TracBrowser for help on using the repository browser.