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
=export MAKEFLAGS
=$(space
);
25 override OPENWRT_BUILD
=1
29 include $(TOPDIR
)/include/debug.mk
30 include $(TOPDIR
)/include/depends.mk
31 include $(TOPDIR
)/include/toplevel.mk
34 include $(INCLUDE_DIR
)/depends.mk
35 include $(INCLUDE_DIR
)/subdir.mk
36 include target
/Makefile
37 include package
/Makefile
38 include tools
/Makefile
39 include toolchain
/Makefile
41 $(toolchain
/stamp-install
): $(tools
/stamp-install
)
42 $(target
/stamp-compile
): $(toolchain
/stamp-install
) $(tools
/stamp-install
) $(BUILD_DIR
)/.prepared
43 $(package
/stamp-cleanup
): $(target
/stamp-compile
)
44 $(package
/stamp-compile
): $(target
/stamp-compile
) $(package
/stamp-cleanup
)
45 $(package
/stamp-install
): $(package
/stamp-compile
)
46 $(package
/stamp-rootfs-prepare
): $(package
/stamp-install
)
47 $(target
/stamp-install
): $(package
/stamp-compile
) $(package
/stamp-install
) $(package
/stamp-rootfs-prepare
)
49 $(BUILD_DIR
)/.prepared
: Makefile
50 @mkdir
-p
$$(dirname
$@
)
53 prepare
: $(target
/stamp-compile
)
56 $(_SINGLE
)$(SUBMAKE
) target
/linux
/clean
57 rm -rf
$(BUILD_DIR
) $(BIN_DIR
) $(BUILD_LOG_DIR
)
60 rm -rf
$(STAGING_DIR
) $(STAGING_DIR_HOST
) $(STAGING_DIR_TOOLCHAIN
) $(TOOLCHAIN_DIR
) $(BUILD_DIR_HOST
) $(BUILD_DIR_TOOLCHAIN
)
63 tmp
/.prereq_packages
: .config
65 for package in
$(sort $(prereq-y
) $(prereq-m
)); do \
66 $(_SINGLE
)$(NO_TRACE_MAKE
) -s
-r
-C package
/$$package prereq || ERROR
=1; \
68 if
[ -n
"$$ERROR" ]; then \
69 echo
"Package prerequisite check failed."; \
74 # check prerequisites before starting to build
75 prereq
: $(target
/stamp-prereq
) tmp
/.prereq_packages
77 prepare
: .config
$(tools
/stamp-install
) $(toolchain
/stamp-install
)
78 world
: prepare
$(target
/stamp-compile
) $(package
/stamp-cleanup
) $(package
/stamp-compile
) $(package
/stamp-install
) $(package
/stamp-rootfs-prepare
) $(target
/stamp-install
) FORCE
79 $(_SINGLE
)$(SUBMAKE
) -r package
/index
81 # update all feeds, re-create index files, install symlinks
83 $(SCRIPT_DIR
)/feeds update
-a
84 $(SCRIPT_DIR
)/feeds
install -a
86 # re-create index files, install symlinks
87 package
/symlinks-install
:
88 $(SCRIPT_DIR
)/feeds update
-i
89 $(SCRIPT_DIR
)/feeds
install -a
91 # remove all symlinks, don't touch ./feeds
92 package
/symlinks-clean
:
93 $(SCRIPT_DIR
)/feeds
uninstall -a
95 .PHONY
: clean dirclean prereq prepare world package
/symlinks package
/symlinks-install package
/symlinks-clean