CONFIG_CONFIG_IN=Config.in
CONFIG_DEFCONFIG=.defconfig
CONFIG=package/config
-DATE:=$(shell date -u +%Y%m%d)
+DATE:=$(shell date +%Y%m%d)
noconfig_targets:=menuconfig config oldconfig randconfig \
defconfig allyesconfig allnoconfig release tags \
source-check help
-# $(shell find . -name *_defconfig |sed 's/.*\///')
+# Use shell variables, if defined
+ifneq ($(BUILDROOT_LOCAL),)
+BR2_LOCAL:=$(BUILDROOT_LOCAL)
+else
+BR2_LOCAL:=$(TOPDIR)/local
+endif
+
+# $(shell find . -name *_defconfig |sed 's/.*\///')
# Pull in the user's configuration file
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
ifeq ($(BOARD),)
--include $(TOPDIR).config
+# if "make BOARD=xyz" command
+-include .config
else
--include $(TOPDIR)/local/$(BOARD)/$(BOARD).config
+# if "make" command
+-include $(BR2_LOCAL)/$(BOARD)/$(BOARD).config
endif
endif
+
+# Override BR2_DL_DIR if shell variable defined
ifneq ($(BUILDROOT_DL_DIR),)
BR2_DL_DIR:=$(BUILDROOT_DL_DIR)
endif
-ifneq ($(BUILDROOT_LOCAL),)
-LOCAL:=$(BUILDROOT_LOCAL)
-else
-LOCAL:=local
-endif
+LOCAL:=$(BR2_LOCAL)
# To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands
ifndef HOSTCXX
HOSTCXX:=g++
endif
+ifndef HOSTFC
+HOSTFC:=gfortran
+endif
ifndef HOSTCPP
HOSTCPP:=cpp
endif
HOSTAS:=$(shell $(CONFIG_SHELL) -c "which $(HOSTAS)" || type -p $(HOSTAS) || echo as)
HOSTCC:=$(shell $(CONFIG_SHELL) -c "which $(HOSTCC)" || type -p $(HOSTCC) || echo gcc)
HOSTCXX:=$(shell $(CONFIG_SHELL) -c "which $(HOSTCXX)" || type -p $(HOSTCXX) || echo g++)
+HOSTFC:=$(shell $(CONFIG_SHELL) -c "which $(HOSTLD)" || type -p $(HOSTLD) || echo || which g77 || type -p g77 || echo gfortran)
HOSTCPP:=$(shell $(CONFIG_SHELL) -c "which $(HOSTCPP)" || type -p $(HOSTCPP) || echo cpp)
HOSTLD:=$(shell $(CONFIG_SHELL) -c "which $(HOSTLD)" || type -p $(HOSTLD) || echo ld)
HOSTLN:=$(shell $(CONFIG_SHELL) -c "which $(HOSTLN)" || type -p $(HOSTLN) || echo ln)
HOSTNM:=$(shell $(CONFIG_SHELL) -c "which $(HOSTNM)" || type -p $(HOSTNM) || echo nm)
+HOST_GLIB_BIN:=`dirname $(shell $(CONFIG_SHELL) -c "which glib-genmarshal" || echo /usr/bin/glib-genmarshal)`
+HOST_GLIB:=$(shell $(CONFIG_SHELL) -c "dirname $(HOST_GLIB_BIN)" || echo /usr)
+
+
ifndef CFLAGS_FOR_BUILD
CFLAGS_FOR_BUILD:=-g -O2
endif
-export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
+ifndef CXXFLAGS_FOR_BUILD
+CXXFLAGS_FOR_BUILD:=-g -O2
+endif
+ifndef FCFLAGS_FOR_BUILD
+FCFLAGS_FOR_BUILD:=-g -O2
+endif
+export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD
-ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
+ifeq ($(BR2_HAVE_DOT_CONFIG),y)
# cc-option
# Usage: cflags-y+=$(call cc-option, -march=winchip-c6, -march=i586)
HOST_EXEEXT:=.exe
HOST_LIBEXT:=.lib
HOST_SHREXT:=.dll
+HOST_LOADLIBES="-lcurses -lintl"
+export HOST_LOADLIBES
endif
ifneq ($(findstring mingw,$(BR2_GNU_BUILD_SUFFIX)),)
HOST_EXEEXT:=.exe
#
##############################################################
ifeq ($(BR2_TOOLCHAIN_SOURCE),y)
-BASE_TARGETS:=uclibc-configured binutils cross_compiler uclibc-target-utils
+BASE_TARGETS:=uclibc-configured binutils cross_compiler uclibc-target-utils kernel-headers
else
-BASE_TARGETS:=uclibc
+BASE_TARGETS:=uclibc kernel-headers
endif
TARGETS:=
include package/*/*.mk
+TARGETS+=target-devfiles
+
# target stuff is last so it can override anything else
include target/Makefile.in
-TARGETS+=erase-fakeroots
+TARGETS+=erase-fakeroots
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS))
ifeq ($(BR2_TOOLCHAIN_SYSROOT),y)
@mkdir -p $(STAGING_DIR)/usr/lib
else
+ifneq ($(BR2_TOOLCHAIN_EXTERNAL),y)
@ln -snf . $(STAGING_DIR)/usr
@mkdir -p $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)
@ln -snf ../lib $(STAGING_DIR)/usr/lib
@ln -snf ../lib $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib
+endif
endif
@mkdir -p $(STAGING_DIR)/usr/include
fi; \
touch $(STAGING_DIR)/.fakeroot.00000; \
fi
- -find $(TARGET_DIR) -type d -name CVS | xargs rm -rf
- -find $(TARGET_DIR) -type d -name .svn | xargs rm -rf
+ -find $(TARGET_DIR) -type d -name CVS -o -name .svn | xargs rm -rf
+ -find $(TARGET_DIR) -type f -name .empty | xargs rm -rf
touch $@
$(TARGET_DIR): $(PROJECT_BUILD_DIR)/.root
erase-fakeroots:
rm -f $(PROJECT_BUILD_DIR)/.fakeroot*
+target-devfiles:
+ifeq ($(BR2_HAVE_DEVFILES),y)
+ ( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
+else
+ rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig
+ find $(TARGET_DIR)/usr/lib -name '*.a' -delete
+ find $(TARGET_DIR)/lib -name '*.a' -delete
+ find $(TARGET_DIR)/usr/lib -name '*.la' -delete
+ find $(TARGET_DIR)/lib -name '*.la' -delete
+endif
+
source: $(TARGETS_SOURCE) $(HOST_SOURCE)
_source-check:
$(MAKE) SPIDER=--spider source
+external-deps:
+ @$(MAKE) -Bs BR2_WGET=$(TOPDIR)/toolchain/wget-show-external-deps.sh \
+ SPIDER=--spider source
+
#############################################################
#
# Cleanup and misc junk
rm -rf $(DL_DIR)
endif
rm -rf $(BUILD_DIR) $(PROJECT_BUILD_DIR) $(BINARIES_DIR) \
- $(LINUX_KERNEL) $(IMAGE) $(BASE_DIR)/include \
+ $(LINUX_KERNEL) $(BASE_DIR)/include \
.config.cmd
$(MAKE) -C $(CONFIG) clean
bzip2 -9 buildroot.tar; \
-else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
+else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
all: menuconfig
#
#############################################################
clean:
- rm -f .config .config.old .config.cmd .tmpconfig.h
+ rm -f .config .config.old .config.cmd .tmpconfig.h .lognr.*
-$(MAKE) -C $(CONFIG) clean
distclean: clean
rm -rf sources/*
-endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
+endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
%_defconfig: $(CONFIG)/conf
cp $(shell find ./target/ -name $@) .config
-@$(MAKE) oldconfig
+update:
+ cp .config $(BOARD_PATH)/$(BOARD_NAME)_defconfig
+
configured: dirs host-sed kernel-headers uclibc-config busybox-config linux26-config
+prepatch: gcc-patched binutils-patched gdb-patched uclibc-patched
+
+.lognr.$(PROJECT):
+ @echo "0" > .lognr.$(PROJECT)
+
+log: .lognr.$(PROJECT)
+ @expr `cat .lognr.$(PROJECT)` + 1 > .lognr.$(PROJECT)
+ @echo Creating $(PROJECT)-`cat .lognr.$(PROJECT)`.log
+ @$(MAKE) > $(PROJECT)-`cat .lognr.$(PROJECT)`.log 2>&1
+
+
cross: $(BASE_TARGETS)
help:
@echo 'Miscellaneous:'
@echo ' source - download all sources needed for offline-build'
@echo ' source-check - check all packages for valid download URLs'
+ @echo ' external-deps - list external packages used'
@echo
@echo 'See docs/README and docs/buildroot.html for further details'
@echo
.PHONY: dummy subdirs release distclean clean config oldconfig \
menuconfig tags check test depend defconfig help
-
+