include rules.mk
include $(INCLUDE_DIR)/depends.mk
include $(INCLUDE_DIR)/subdir.mk
+ include $(INCLUDE_DIR)/target.mk
+ include target/Makefile
include package/Makefile
include tools/Makefile
include toolchain/Makefile
+$(toolchain/stamp-compile): $(tools/stamp-compile)
+$(target/stamp-compile): $(toolchain/stamp-install) $(tools/stamp-install)
+$(package/stamp-compile): $(target/stamp-compile)
+$(target/stamp-install): $(package/stamp-compile) $(package/stamp-install)
+
clean: FORCE
rm -rf build_* bin tmp
distclean: dirclean config-clean symlinkclean docs/clean
rm -rf dl
-target/%: FORCE
- $(MAKE) -C $(patsubst %/$*,%,$@) $*
-
# check prerequisites before starting to build
-prereq: tmp/.prereq-target $(package/stamp-prereq) ;
+prereq: $(package/stamp-prereq) $(target/stamp-prereq) ;
-world: .config $(tools/stamp-install) $(toolchain/stamp-install) FORCE
- $(MAKE) target/compile
- $(MAKE) package/compile
- $(MAKE) package/install
- $(MAKE) target/install
+world: .config $(tools/stamp-install) $(toolchain/stamp-install) $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE
$(MAKE) package/index
package/symlinks:
$(SCRIPT_DIR)/feeds.sh $(CONFIG_SOURCE_FEEDS) $(CONFIG_SOURCE_FEEDS_REV)
-# FIXME: remove after converting target/ to new structure
-tmp/.prereq-target: tmp/.targetinfo .config
-tmp/.prereq-target: include/prereq.mk
- mkdir -p tmp
- rm -f tmp/.host.mk
- @+$(NO_TRACE_MAKE) -s -C target prereq 2>/dev/null || { \
- echo "Prerequisite check failed. Use FORCE=1 to override."; \
- false; \
- }
- touch $@
-.SILENT: tmp/.prereq-target
-
endif
#
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2006-2007 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
STAMP_PREPARED:=$(PKG_BUILD_DIR)/.prepared_$(shell find ${CURDIR} $(PKG_FILE_DEPEND) $(DEP_FINDPARAMS) | md5s)
STAMP_CONFIGURED:=$(PKG_BUILD_DIR)/.configured
STAMP_BUILT:=$(PKG_BUILD_DIR)/.built
+override MAKEFLAGS=
include $(INCLUDE_DIR)/quilt.mk
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/prereq.mk
+override MAKEFLAGS=
+
GENERIC_LINUX_CONFIG:=$(GENERIC_PLATFORM_DIR)/config-$(shell [ -f "$(GENERIC_PLATFORM_DIR)/config-$(KERNEL_PATCHVER)" ] && echo "$(KERNEL_PATCHVER)" || echo template )
LINUX_CONFIG_DIR ?= ./config$(shell [ -d "./config-$(KERNEL_PATCHVER)" ] && printf -- "-$(KERNEL_PATCHVER)" || true )
LINUX_CONFIG ?= $(LINUX_CONFIG_DIR)/default
$(SCRIPT_DIR)/config.pl '>' $(GENERIC_LINUX_CONFIG) $(LINUX_DIR)/.config > $(LINUX_CONFIG)
install: $(LINUX_DIR)/.image
+ $(MAKE) -C image install
clean: FORCE
rm -f $(STAMP_DIR)/.linux-compile
fi
@$(MAKE) compile
+image-prereq:
+ $(MAKE) -C image prereq
+prereq: image-prereq
#
-# Copyright (C) 2006,2007 OpenWrt.org
+# Copyright (C) 2006-2007 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(INCLUDE_DIR)/package-dumpinfo.mk
include $(INCLUDE_DIR)/package-ipkg.mk
+override MAKEFLAGS=
export CONFIG_SITE:=$(INCLUDE_DIR)/site/$(REAL_GNU_TARGET_NAME)
ifeq ($(DUMP)$(filter prereq clean refresh update,$(MAKECMDGOALS)),)
#
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2006-2007 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
$$(eval $$(call Require,$(1),$(2)))
endef
+.NOTPARALLEL:
$(call warn,$(1),d,BD $(1)/$(bd))
$(foreach target,$(SUBTARGETS),
$(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(target): $($(1)/$(bd)/$(target)) $(call $(1)//$(target),$(1)/$(bd)))
- @+$$(MAKE) -j1 -C $(1)/$(bd) $(target)
+ +$$(MAKE) -j1 -C $(1)/$(bd) $(target)
+ $$(if $(call debug,$(1)/$(bd),v),,.SILENT: $(1)/$(bd)/$(target))
# legacy targets
$(call warn_eval,$(1)/$(bd),l,T,$(1)/$(bd)-$(target): $(1)/$(bd)/$(target))
# Parameters: <subdir> <name> <target>
define stampfile
$(1)/stamp-$(3):=$(STAGING_DIR)/stampfiles/.$(2)_$(3)
- $(call rdep,$(1),$$($(1)/stamp-$(3)),)
+ $(if __rdep_$(1),,
+ $(call rdep,$(1),$$($(1)/stamp-$(3)),)
+ __rdep_$(1):=1
+ )
$$($(1)/stamp-$(3)):
- @+$(MAKE) $(1)/$(3)
+ @+$(MAKE) $$($(1)/flags-$(3)) $(1)/$(3)
@mkdir -p $$$$(dirname $$($(1)/stamp-$(3)))
@touch $$($(1)/stamp-$(3))
+
+ $$(if $(call debug,$(1),v),,.SILENT: $$($(1)/stamp-$(3)))
+
.PRECIOUS: $$($(1)/stamp-$(3)) # work around a make bug
$(1)//clean:=$(1)/stamp-$(3)/clean
#
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2007 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
-
define AddProfile
ifeq ($(CONFIG_LINUX_$(1)),y)
$(call Profile/$(1))
endif
endef
-include $(TMP_DIR)/.target.mk
+-include $(TMP_DIR)/.target.mk
ifeq ($(IB),1)
$(TMP_DIR)/.target.mk: $(TOPDIR)/.target.mk
$(CP) $< $@
-else
-$(TMP_DIR)/.target.mk: $(TMP_DIR)/.targetinfo
- $(SCRIPT_DIR)/metadata.pl target_mk < $(TMP_DIR)/.targetinfo > $@
endif
SCAN_COOKIE?=$(shell echo $$$$)
export SCAN_COOKIE
-tmp/.packageinfo tmp/.targetinfo prepare-tmpinfo: FORCE
+prepare-tmpinfo: FORCE
mkdir -p tmp/info
+$(NO_TRACE_MAKE) -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS="$(TOPDIR)/include/package*.mk" SCAN_DEPTH=4 SCAN_EXTRA=""
+$(NO_TRACE_MAKE) -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPS="profiles/*.mk $(TOPDIR)/include/kernel*.mk" SCAN_DEPTH=2 SCAN_EXTRA=""
[ "$$t" -nt "$$f" ] || ./scripts/metadata.pl $${type}_config < "$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false; break; }; \
done
./scripts/metadata.pl package_mk < tmp/.packageinfo > tmp/.packagedeps || { rm -f tmp/.packagedeps; false; }
+ ./scripts/metadata.pl target_mk < $(TMP_DIR)/.targetinfo > tmp/.target.mk
+ touch $(TOPDIR)/tmp/.build
.config: ./scripts/config/conf prepare-tmpinfo
@+if [ \! -f .config ]; then \
%::
@+$(PREP_MK) $(NO_TRACE_MAKE) -s prereq
- @+$(MAKE) $@
+ @+$(MAKE) -r $@
help:
cat README
rm -rf tmp
ifeq ($(findstring v,$(DEBUG)),)
- .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 tmp/.prereq-target tmp/.packageinfo tmp/.targetinfo prepare-tmpinfo
+ .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 tmp/.prereq-target prepare-tmpinfo
endif
.PHONY: help FORCE
.NOTPARALLEL:
#
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2006-2007 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
curdir:=package
-include .config
-include $(TMP_DIR)/.packagedeps
$(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m))
$(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
$(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
$(curdir)/builddirs-install:=. $(sort $(package-y))
-$(curdir)//compile:=.config prereq
+$(curdir)//compile = $(1)/prepare
+$(curdir)//install = $(1)/compile
$(curdir)/install:=$(curdir)/install-cleanup
$(curdir)/install-cleanup:
rm -rf $(BUILD_DIR)/root
$(curdir)/index: FORCE
(cd $(PACKAGE_DIR); $(SCRIPT_DIR)/ipkg-make-index.sh . > Packages)
+$(curdir)/flags-install:= -j1
+
$(eval $(call stampfile,$(curdir),package,prereq))
+$(eval $(call stampfile,$(curdir),package,compile))
+$(eval $(call stampfile,$(curdir),package,install))
+
+$($(curdir)/stamp-install): $($(curdir)/stamp-compile)
+
$(eval $(call subdir,$(curdir)))
#
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2007 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
-include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/target.mk
+curdir:=target
-all: install
+$(curdir)/builddirs:=linux sdk imagebuilder
+$(curdir)/builddirs-prereq:=linux
+$(curdir)/builddirs-default:=linux $(if $(CONFIG_SDK),sdk) $(if $(CONFIG_IB),imagebuilder)
-$(BIN_DIR):
- mkdir -p $(BIN_DIR)
+$(curdir)/imagebuilder/prepare:=$(curdir)/linux/install
-linux-install: $(BIN_DIR)
-image_install: linux-install
+$(eval $(call stampfile,$(curdir),target,prereq))
+$(eval $(call stampfile,$(curdir),target,compile))
+$(eval $(call stampfile,$(curdir),target,install))
-IMAGE_DIR:=linux/$(BOARD)-$(KERNEL)/image
+$($(curdir)/stamp-prereq): .config
+$($(curdir)/stamp-compile): $(TMP_DIR)/.build
+$($(curdir)/stamp-install): $($(curdir)/stamp-compile)
-download: $(patsubst %,%-download,$(TARGETS-y))
-prepare: linux-prepare
-compile: linux-compile image_compile
-install: linux-install image_install
-
-ifeq ($(CONFIG_SDK),y)
-install: sdk_install
-endif
-ifeq ($(CONFIG_IB),y)
-install: imagebuilder_install
-endif
-
-clean: linux-clean sdk-clean imagebuilder-clean image_clean
-
-prereq: FORCE
- $(MAKE) -C linux/$(BOARD)-$(KERNEL) prereq
- [ \! -f $(IMAGE_DIR)/Makefile ] || $(MAKE) -C $(IMAGE_DIR) prereq
-
-sdk_install: FORCE
- $(MAKE) -C sdk install
-
-image_clean: FORCE
- $(MAKE) -C $(IMAGE_DIR) clean
- rm -f $(BIN_DIR)/openwrt-*
-
-image_compile: FORCE
- $(MAKE) -C $(IMAGE_DIR) compile
-
-image_install: image_compile
- $(MAKE) -C $(IMAGE_DIR) install
-
-imagebuilder_install: image_install
- $(MAKE) -C imagebuilder install
-
-%-prereq %-prepare %-download %-clean %-compile %-install %-refresh %-update: FORCE
- $(MAKE) -C $* $(patsubst $*-%,%,$@)
+$(eval $(call subdir,$(curdir)))
#
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2006-2007 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/target.mk
-clean download prepare compile install menuconfig oldconfig update refresh: FORCE
+prereq clean download prepare compile install menuconfig oldconfig update refresh: FORCE
$(MAKE) -C $(BOARD)-$(KERNEL) $@
$(curdir)/gcc/install:=$(curdir)/uClibc/install
# prerequisites for the individual targets
-$(curdir)/ := .config $(tools/stamp-install) prereq
+$(curdir)/ := .config prereq
$(curdir)//prepare = $(STAGING_DIR)/include-host/.done
$(curdir)//compile = $(1)/prepare
$(curdir)//install = $(1)/compile
# prerequisites for the individual targets
$(curdir)/ := .config prereq
-$(curdir)//compile = $(1)/prepare
$(curdir)//install = $(1)/compile
$(eval $(call stampfile,$(curdir),tools,install))