X-Git-Url: https://git.archive.openwrt.org/?p=openwrt.git;a=blobdiff_plain;f=Makefile;h=9197640b3678e7d168c4338dffe4808ec5722941;hp=db79274c9af0e2f1b9666841a780fb5bc154854f;hb=c0edabca051e029b130d0938f3500637402084e4;hpb=e7b69dec2d776f621354871b04496cd9645b89dc diff --git a/Makefile b/Makefile index db79274c9a..9197640b36 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,10 @@ LC_ALL:=C LANG:=C export TOPDIR LC_ALL LANG +empty:= +space:= $(empty) $(empty) +$(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt directory must not include any spaces)) + world: include $(TOPDIR)/include/host.mk @@ -24,6 +28,8 @@ ifneq ($(OPENWRT_BUILD),1) override OPENWRT_BUILD=1 export OPENWRT_BUILD + GREP_OPTIONS= + export GREP_OPTIONS include $(TOPDIR)/include/debug.mk include $(TOPDIR)/include/depends.mk include $(TOPDIR)/include/toplevel.mk @@ -38,26 +44,27 @@ else $(toolchain/stamp-install): $(tools/stamp-install) $(target/stamp-compile): $(toolchain/stamp-install) $(tools/stamp-install) $(BUILD_DIR)/.prepared -$(package/stamp-cleanup): $(target/stamp-compile) $(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup) $(package/stamp-install): $(package/stamp-compile) -$(package/stamp-rootfs-prepare): $(package/stamp-install) -$(target/stamp-install): $(package/stamp-compile) $(package/stamp-install) $(package/stamp-rootfs-prepare) +$(target/stamp-install): $(package/stamp-compile) $(package/stamp-install) -$(BUILD_DIR)/.prepared: Makefile - @mkdir -p $$(dirname $@) - @touch $@ +printdb: + @true prepare: $(target/stamp-compile) clean: FORCE - $(_SINGLE)$(SUBMAKE) target/linux/clean rm -rf $(BUILD_DIR) $(BIN_DIR) $(BUILD_LOG_DIR) dirclean: clean rm -rf $(STAGING_DIR) $(STAGING_DIR_HOST) $(STAGING_DIR_TOOLCHAIN) $(TOOLCHAIN_DIR) $(BUILD_DIR_HOST) $(BUILD_DIR_TOOLCHAIN) rm -rf $(TMP_DIR) +ifndef DUMP_TARGET_DB +$(BUILD_DIR)/.prepared: Makefile + @mkdir -p $$(dirname $@) + @touch $@ + tmp/.prereq_packages: .config unset ERROR; \ for package in $(sort $(prereq-y) $(prereq-m)); do \ @@ -68,12 +75,19 @@ tmp/.prereq_packages: .config false; \ fi touch $@ +endif # check prerequisites before starting to build prereq: $(target/stamp-prereq) tmp/.prereq_packages + @if [ ! -f "$(INCLUDE_DIR)/site/$(REAL_GNU_TARGET_NAME)" ]; then \ + echo 'ERROR: Missing site config for target "$(REAL_GNU_TARGET_NAME)" !'; \ + echo ' The missing file will cause configure scripts to fail during compilation.'; \ + echo ' Please provide a "$(INCLUDE_DIR)/site/$(REAL_GNU_TARGET_NAME)" file and restart the build.'; \ + exit 1; \ + fi prepare: .config $(tools/stamp-install) $(toolchain/stamp-install) -world: prepare $(target/stamp-compile) $(package/stamp-cleanup) $(package/stamp-compile) $(package/stamp-install) $(package/stamp-rootfs-prepare) $(target/stamp-install) FORCE +world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE $(_SINGLE)$(SUBMAKE) -r package/index # update all feeds, re-create index files, install symlinks