next round of build system cleanup - convert package/ to new structure
[openwrt.git] / Makefile
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 TOPDIR:=${CURDIR}
10 LC_ALL:=C
11 LANG:=C
12 IS_TTY:=${shell tty -s && echo 1 || echo 0}
13 export TOPDIR LC_ALL LANG IS_TTY
14
15 world:
16
17 include $(TOPDIR)/include/debug.mk
18 include $(TOPDIR)/include/host.mk
19
20 ifneq ($(OPENWRT_BUILD),1)
21 override OPENWRT_BUILD=1
22 export OPENWRT_BUILD
23 include $(TOPDIR)/include/toplevel.mk
24 else
25 include rules.mk
26 include $(INCLUDE_DIR)/depends.mk
27 include $(INCLUDE_DIR)/subdir.mk
28 include package/Makefile
29 include tools/Makefile
30 include toolchain/Makefile
31
32 clean: FORCE
33 rm -rf build_* bin tmp
34
35 dirclean: clean
36 rm -rf staging_dir_* toolchain_build_* tool_build
37
38 distclean: dirclean config-clean symlinkclean docs/clean
39 rm -rf dl
40
41 target/%: FORCE
42 $(MAKE) -C $(patsubst %/$*,%,$@) $*
43
44 # check prerequisites before starting to build
45 prereq: tmp/.prereq-target $(package/stamp-prereq) ;
46
47 world: .config $(tools/stamp-install) $(toolchain/stamp-install) FORCE
48 $(MAKE) target/compile
49 $(MAKE) package/compile
50 $(MAKE) package/install
51 $(MAKE) target/install
52 $(MAKE) package/index
53
54 package/symlinks:
55 $(SCRIPT_DIR)/feeds.sh $(CONFIG_SOURCE_FEEDS) $(CONFIG_SOURCE_FEEDS_REV)
56
57 # FIXME: remove after converting target/ to new structure
58 tmp/.prereq-target: tmp/.targetinfo .config
59 tmp/.prereq-target: include/prereq.mk
60 mkdir -p tmp
61 rm -f tmp/.host.mk
62 @+$(NO_TRACE_MAKE) -s -C target prereq 2>/dev/null || { \
63 echo "Prerequisite check failed. Use FORCE=1 to override."; \
64 false; \
65 }
66 touch $@
67 .SILENT: tmp/.prereq-target
68
69 endif
This page took 0.052413 seconds and 5 git commands to generate.