diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-09-26 17:53:32 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-09-26 17:53:32 +0000 |
commit | 4adf55c2f5da144c5dff0ae0f0fab2a68b6c7a7a (patch) | |
tree | 849fdb2994ed9fc322536f52c93263674209798c | |
parent | 5f44d3ff1867d63975c18ab23b4b268df0a587da (diff) |
build: include the cpu type as part of the toolchain/target directory name
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38214 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | include/target.mk | 1 | ||||
-rw-r--r-- | rules.mk | 15 | ||||
-rwxr-xr-x | scripts/metadata.pl | 11 |
3 files changed, 16 insertions, 11 deletions
diff --git a/include/target.mk b/include/target.mk index c3b4c52459..4e7fdf7b90 100644 --- a/include/target.mk +++ b/include/target.mk @@ -254,6 +254,7 @@ define BuildTargets/DumpCurrent echo 'Target-Features: $(FEATURES)'; \ echo 'Target-Depends: $(DEPENDS)'; \ echo 'Target-Optimization: $(if $(CFLAGS),$(CFLAGS),$(DEFAULT_CFLAGS))'; \ + echo 'CPU-Type: $(CPU_TYPE)$(if $(CPU_SUBTYPE),+$(CPU_SUBTYPE))'; \ echo 'Linux-Version: $(LINUX_VERSION)'; \ echo 'Linux-Release: $(LINUX_RELEASE)'; \ echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'; \ @@ -54,22 +54,15 @@ endif HOST_FPIC:=-fPIC -ARCH_SUFFIX:= +ARCH_SUFFIX:=$(call qstrip,$(CONFIG_CPU_TYPE)) GCC_ARCH:= +ifneq ($(ARCH_SUFFIX),) + ARCH_SUFFIX:=_$(ARCH_SUFFIX) +endif ifneq ($(filter -march=armv%,$(TARGET_OPTIMIZATION)),) - ARCH_SUFFIX:=_$(patsubst -march=arm%,%,$(filter -march=armv%,$(TARGET_OPTIMIZATION))) GCC_ARCH:=$(patsubst -march=%,%,$(filter -march=armv%,$(TARGET_OPTIMIZATION))) endif -ifneq ($(filter -mips%r2,$(TARGET_OPTIMIZATION)),) - ARCH_SUFFIX:=_r2 -endif -ifneq ($(filter -mdsp,$(TARGET_OPTIMIZATION)),) - ARCH_SUFFIX:=$(ARCH_SUFFIX)_dsp -endif -ifneq ($(filter -mdspr2,$(TARGET_OPTIMIZATION)),) - ARCH_SUFFIX:=$(ARCH_SUFFIX)_dspr2 -endif ifdef CONFIG_HAS_SPE_FPU TARGET_SUFFIX:=$(TARGET_SUFFIX)spe endif diff --git a/scripts/metadata.pl b/scripts/metadata.pl index 498456ea4d..ddcf50bf32 100755 --- a/scripts/metadata.pl +++ b/scripts/metadata.pl @@ -53,6 +53,7 @@ sub parse_target_metadata() { /^Target-Depends:\s*(.+)\s*$/ and $target->{depends} = [ split(/\s+/, $1) ]; /^Target-Description:/ and $target->{desc} = get_multiline(*FILE); /^Target-Optimization:\s*(.+)\s*$/ and $target->{cflags} = $1; + /^CPU-Type:\s*(.+)\s*$/ and $target->{cputype} = $1; /^Linux-Version:\s*(.+)\s*$/ and $target->{version} = $1; /^Linux-Release:\s*(.+)\s*$/ and $target->{release} = $1; /^Linux-Kernel-Arch:\s*(.+)\s*$/ and $target->{karch} = $1; @@ -372,6 +373,16 @@ EOF print "\tdefault \"".$target->{cflags}."\" if TARGET_".$target->{conf}."\n"; } print "\tdefault \"-Os -pipe -funit-at-a-time\"\n"; + print <<EOF; + +config CPU_TYPE + string +EOF + foreach my $target (@target) { + next if @{$target->{subtargets}} > 0; + print "\tdefault \"".$target->{cputype}."\" if TARGET_".$target->{conf}."\n"; + } + print "\tdefault \"\"\n"; my %kver; foreach my $target (@target) { |