add ifup -a to boot(), closes #4543 #2781
[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 export LD_LIBRARY_PATH:=$(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):)$(STAGING_DIR_HOST)/lib
27 export DYLD_LIBRARY_PATH:=$(if $(DYLD_LIBRARY_PATH),$(DYLD_LIBRARY_PATH):)$(STAGING_DIR_HOST)/lib
28
29 # prevent perforce from messing with the patch utility
30 unexport P4PORT P4USER P4CONFIG P4CLIENT
31
32 # make sure that a predefined CFLAGS variable does not disturb packages
33 export CFLAGS=
34
35 ifeq ($(FORCE),)
36 .config scripts/config/conf scripts/config/mconf: tmp/.prereq-build
37 endif
38
39 SCAN_COOKIE?=$(shell echo $$$$)
40 export SCAN_COOKIE
41
42 prepare-mk: FORCE ;
43
44 prepare-tmpinfo: FORCE
45 mkdir -p tmp/info
46 $(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS="$(TOPDIR)/include/package*.mk $(TOPDIR)/overlay/*/*.mk" SCAN_DEPTH=5 SCAN_EXTRA=""
47 $(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -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"
48 for type in package target; do \
49 f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \
50 [ "$$t" -nt "$$f" ] || ./scripts/metadata.pl $${type}_config "$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false; break; }; \
51 done
52 ./scripts/metadata.pl package_mk tmp/.packageinfo > tmp/.packagedeps || { rm -f tmp/.packagedeps; false; }
53 touch $(TOPDIR)/tmp/.build
54
55 .config: ./scripts/config/conf $(if $(CONFIG_HAVE_DOT_CONFIG),,prepare-tmpinfo)
56 @+if [ \! -e .config ] || ! grep CONFIG_HAVE_DOT_CONFIG .config >/dev/null; then \
57 [ -e $(HOME)/.openwrt/defconfig ] && cp $(HOME)/.openwrt/defconfig .config; \
58 $(_SINGLE)$(NO_TRACE_MAKE) menuconfig $(PREP_MK); \
59 fi
60
61 scripts/config/mconf:
62 @$(_SINGLE)$(SUBMAKE) -s -C scripts/config all
63
64 $(eval $(call rdep,scripts/config,scripts/config/mconf))
65
66 scripts/config/conf:
67 @$(_SINGLE)$(SUBMAKE) -s -C scripts/config conf
68
69 config: scripts/config/conf prepare-tmpinfo FORCE
70 $< Config.in
71
72 config-clean: FORCE
73 $(_SINGLE)$(NO_TRACE_MAKE) -C scripts/config clean
74
75 defconfig: scripts/config/conf prepare-tmpinfo FORCE
76 touch .config
77 $< -D .config Config.in
78
79 oldconfig: scripts/config/conf prepare-tmpinfo FORCE
80 $< -$(if $(CONFDEFAULT),$(CONFDEFAULT),o) Config.in
81
82 menuconfig: scripts/config/mconf prepare-tmpinfo FORCE
83 if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \
84 cp $(HOME)/.openwrt/defconfig .config; \
85 fi
86 $< Config.in
87
88 prepare_kernel_conf: .config FORCE
89
90 ifeq ($(wildcard staging_dir/host/bin/sed),)
91 prepare_kernel_conf:
92 @+$(SUBMAKE) -r tools/sed/install
93 else
94 prepare_kernel_conf: ;
95 endif
96
97 kernel_oldconfig: prepare_kernel_conf
98 $(_SINGLE)$(NO_TRACE_MAKE) -C target/linux oldconfig
99
100 kernel_menuconfig: prepare_kernel_conf
101 $(_SINGLE)$(NO_TRACE_MAKE) -C target/linux menuconfig
102
103 tmp/.prereq-build: include/prereq-build.mk
104 mkdir -p tmp
105 rm -f tmp/.host.mk
106 @$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
107 echo "Prerequisite check failed. Use FORCE=1 to override."; \
108 false; \
109 }
110 touch $@
111
112 download: .config FORCE
113 @+$(SUBMAKE) tools/download
114 @+$(SUBMAKE) toolchain/download
115 @+$(SUBMAKE) package/download
116 @+$(SUBMAKE) target/download
117
118 clean dirclean: .config
119 @+$(SUBMAKE) -r $@
120
121 prereq:: prepare-tmpinfo .config
122 @+$(MAKE) -r -s tmp/.prereq-build $(PREP_MK)
123 @+$(NO_TRACE_MAKE) -r -s $@
124
125 %::
126 @+$(PREP_MK) $(NO_TRACE_MAKE) -r -s prereq
127 @+$(SUBMAKE) -r $@
128
129 help:
130 cat README
131
132 docs docs/compile: FORCE
133 @$(_SINGLE)$(SUBMAKE) -C docs compile
134
135 docs/clean: FORCE
136 @$(_SINGLE)$(SUBMAKE) -C docs clean
137
138 distclean:
139 rm -rf tmp build_dir staging_dir dl .config* feeds package/feeds package/openwrt-packages bin
140 @$(_SINGLE)$(SUBMAKE) -C scripts/config clean
141
142 ifeq ($(findstring v,$(DEBUG)),)
143 .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
144 endif
145 .PHONY: help FORCE
146 .NOTPARALLEL:
147
This page took 0.045873 seconds and 5 git commands to generate.