3 # Copyright (C) 2007 OpenWrt.org
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
12 export TOPDIR LC_ALL LANG
16 include $(TOPDIR
)/include/host.mk
18 ifneq ($(OPENWRT_BUILD
),1)
19 # XXX: these three lines are normally defined by rules.mk
20 # but we can't include that file in this context
22 space
:= $(empty
) $(empty
)
23 _SINGLE
=MAKEFLAGS
=$(space
)
25 override OPENWRT_BUILD
=1
27 include $(TOPDIR
)/include/debug.mk
28 include $(TOPDIR
)/include/depends.mk
29 include $(TOPDIR
)/include/toplevel.mk
32 include $(INCLUDE_DIR
)/depends.mk
33 include $(INCLUDE_DIR
)/subdir.mk
34 include target
/Makefile
35 include package
/Makefile
36 include tools
/Makefile
37 include toolchain
/Makefile
39 $(toolchain
/stamp-install
): $(tools
/stamp-install
)
40 $(target
/stamp-compile
): $(toolchain
/stamp-install
) $(tools
/stamp-install
) $(BUILD_DIR
)/.prepared
41 $(package
/stamp-cleanup
): $(target
/stamp-compile
)
42 $(package
/stamp-compile
): $(target
/stamp-compile
) $(package
/stamp-cleanup
)
43 $(package
/stamp-install
): $(package
/stamp-compile
)
44 $(package
/stamp-rootfs-prepare
): $(package
/stamp-install
)
45 $(target
/stamp-install
): $(package
/stamp-compile
) $(package
/stamp-install
) $(package
/stamp-rootfs-prepare
)
47 $(BUILD_DIR
)/.prepared
: Makefile
48 @mkdir
-p
$$(dirname
$@
)
52 rm -rf
$(BUILD_DIR
) $(BIN_DIR
)
53 $(SUBMAKE
) target
/linux
/clean
56 rm -rf
$(STAGING_DIR
) $(STAGING_DIR_HOST
) $(STAGING_DIR_TOOLCHAIN
) $(TOOLCHAIN_DIR
) $(BUILD_DIR_HOST
)
59 # check prerequisites before starting to build
60 prereq
: $(package
/stamp-prereq
) $(target
/stamp-prereq
) ;
62 prepare
: .config
$(tools
/stamp-install
) $(toolchain
/stamp-install
)
63 world
: prepare
$(target
/stamp-compile
) $(package
/stamp-cleanup
) $(package
/stamp-compile
) $(package
/stamp-install
) $(package
/stamp-rootfs-prepare
) $(target
/stamp-install
) FORCE
64 $(SUBMAKE
) package
/index
66 # update all feeds, re-create index files, install symlinks
68 $(SCRIPT_DIR
)/feeds update
-a
69 $(SCRIPT_DIR
)/feeds
install -a
71 # re-create index files, install symlinks
72 package
/symlinks-install
:
73 $(SCRIPT_DIR
)/feeds update
-i
74 $(SCRIPT_DIR
)/feeds
install -a
76 # remove all symlinks, don't touch ./feeds
77 package
/symlinks-clean
:
78 $(SCRIPT_DIR
)/feeds
uninstall -a
80 .PHONY
: clean dirclean prereq prepare world package
/symlinks package
/symlinks-install package
/symlinks-clean