[ar71xx] tl-wr941nd: register ethernet device, and fix machine id
[openwrt.git] / include / toplevel.mk
1 # Makefile for OpenWrt
2 #
3 # Copyright (C) 2007 OpenWrt.org
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 RELEASE:=Kamikaze
10 SHELL:=/usr/bin/env bash
11 PREP_MK= OPENWRT_BUILD= QUIET=0
12
13 include $(TOPDIR)/include/verbose.mk
14
15 ifeq ($(SDK),1)
16 include $(TOPDIR)/include/version.mk
17 else
18 REVISION:=$(shell $(TOPDIR)/scripts/getver.sh)
19 endif
20
21 OPENWRTVERSION:=$(RELEASE)$(if $(REVISION), ($(REVISION)))
22 export RELEASE
23 export REVISION
24 export OPENWRTVERSION
25 export IS_TTY=$(shell tty -s && echo 1 || echo 0)
26
27 # make sure that a predefined CFLAGS variable does not disturb packages
28 export CFLAGS=
29
30 ifeq ($(FORCE),)
31 .config scripts/config/conf scripts/config/mconf: tmp/.prereq-build
32 endif
33
34 SCAN_COOKIE?=$(shell echo $$$$)
35 export SCAN_COOKIE
36
37 prepare-mk: FORCE ;
38
39 prepare-tmpinfo: FORCE
40 mkdir -p tmp/info
41 $(_SINGLE)$(NO_TRACE_MAKE) -j1 -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS="$(TOPDIR)/include/package*.mk" SCAN_DEPTH=5 SCAN_EXTRA=""
42 $(_SINGLE)$(NO_TRACE_MAKE) -j1 -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPS="profiles/*.mk $(TOPDIR)/include/kernel*.mk $(TOPDIR)/include/target.mk" SCAN_DEPTH=2 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
43 for type in package target; do \
44 f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \
45 [ "$$t" -nt "$$f" ] || ./scripts/metadata.pl $${type}_config "$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false; break; }; \
46 done
47 ./scripts/metadata.pl package_mk tmp/.packageinfo > tmp/.packagedeps || { rm -f tmp/.packagedeps; false; }
48 touch $(TOPDIR)/tmp/.build
49
50 .config: ./scripts/config/conf prepare-tmpinfo $(if $(CONFIG_HAVE_DOT_CONFIG),,FORCE)
51 @+if [ \! -e .config ] || ! grep CONFIG_HAVE_DOT_CONFIG .config >/dev/null; then \
52 [ -e $(HOME)/.openwrt/defconfig ] && cp $(HOME)/.openwrt/defconfig .config; \
53 $(_SINGLE)$(NO_TRACE_MAKE) menuconfig $(PREP_MK); \
54 fi
55
56 scripts/config/mconf:
57 @$(_SINGLE)$(SUBMAKE) -s -C scripts/config all
58
59 $(eval $(call rdep,scripts/config,scripts/config/mconf))
60
61 scripts/config/conf:
62 @$(_SINGLE)$(SUBMAKE) -s -C scripts/config conf
63
64 config: scripts/config/conf prepare-tmpinfo FORCE
65 $< Config.in
66
67 config-clean: FORCE
68 $(_SINGLE)$(NO_TRACE_MAKE) -C scripts/config clean
69
70 defconfig: scripts/config/conf prepare-tmpinfo FORCE
71 touch .config
72 $< -D .config Config.in
73
74 oldconfig: scripts/config/conf prepare-tmpinfo FORCE
75 $< -$(if $(CONFDEFAULT),$(CONFDEFAULT),o) Config.in
76
77 menuconfig: scripts/config/mconf prepare-tmpinfo FORCE
78 if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \
79 cp $(HOME)/.openwrt/defconfig .config; \
80 fi
81 $< Config.in
82
83 kernel_oldconfig: .config FORCE
84 $(_SINGLE)$(NO_TRACE_MAKE) -C target/linux oldconfig
85
86 kernel_menuconfig: .config FORCE
87 $(_SINGLE)$(NO_TRACE_MAKE) -C target/linux menuconfig
88
89 tmp/.prereq-build: include/prereq-build.mk
90 mkdir -p tmp
91 rm -f tmp/.host.mk
92 @$(_SINGLE)$(NO_TRACE_MAKE) -j1 -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
93 echo "Prerequisite check failed. Use FORCE=1 to override."; \
94 false; \
95 }
96 touch $@
97
98 download: .config FORCE
99 @+$(SUBMAKE) tools/download
100 @+$(SUBMAKE) toolchain/download
101 @+$(SUBMAKE) package/download
102 @+$(SUBMAKE) target/download
103
104 clean dirclean: .config
105 @+$(SUBMAKE) $@
106
107 prereq:: .config
108 @+$(MAKE) -s tmp/.prereq-build $(PREP_MK)
109 @+$(NO_TRACE_MAKE) -s $@
110
111 %::
112 @+$(PREP_MK) $(NO_TRACE_MAKE) -s prereq
113 @+$(SUBMAKE) -r $@
114
115 help:
116 cat README
117
118 docs docs/compile: FORCE
119 @$(_SINGLE)$(SUBMAKE) -C docs compile
120
121 docs/clean: FORCE
122 @$(_SINGLE)$(SUBMAKE) -C docs clean
123
124 distclean:
125 rm -rf tmp build_dir staging_dir dl .config* feeds package/feeds package/openwrt-packages bin
126 @$(_SINGLE)$(SUBMAKE) -C scripts/config clean
127
128 ifeq ($(findstring v,$(DEBUG)),)
129 .SILENT: symlinkclean clean dirclean distclean config-clean download help tmpinfo-clean .config scripts/config/mconf scripts/config/conf menuconfig tmp/.prereq-build tmp/.prereq-package prepare-tmpinfo
130 endif
131 .PHONY: help FORCE
132 .NOTPARALLEL:
133
This page took 0.047609 seconds and 5 git commands to generate.