Commit 6acff7da2b1a22789f23771c411586e4620049df

Authored by Juan Quintela
Committed by Anthony Liguori
1 parent e73aae67

simplify TARGET_BASE_ARCH generation

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing 2 changed files with 16 additions and 21 deletions
Makefile.target
1 include config.mak 1 include config.mak
2 include $(SRC_PATH)/rules.mak 2 include $(SRC_PATH)/rules.mak
3 3
4 -ifndef TARGET_BASE_ARCH  
5 -TARGET_BASE_ARCH:=$(TARGET_ARCH)  
6 -endif  
7 -  
8 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) 4 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
9 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw 5 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
10 CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H 6 CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
configure
@@ -1892,14 +1892,14 @@ echo &quot;#define CONFIG_QEMU_PREFIX \&quot;$interp_prefix1\&quot;&quot; &gt;&gt; $config_h @@ -1892,14 +1892,14 @@ echo &quot;#define CONFIG_QEMU_PREFIX \&quot;$interp_prefix1\&quot;&quot; &gt;&gt; $config_h
1892 gdb_xml_files="" 1892 gdb_xml_files=""
1893 1893
1894 TARGET_ARCH="$target_arch2" 1894 TARGET_ARCH="$target_arch2"
  1895 +TARGET_BASE_ARCH=""
1895 1896
1896 case "$target_arch2" in 1897 case "$target_arch2" in
1897 i386) 1898 i386)
1898 target_phys_bits=32 1899 target_phys_bits=32
1899 ;; 1900 ;;
1900 x86_64) 1901 x86_64)
1901 - echo "TARGET_BASE_ARCH=i386" >> $config_mak  
1902 - echo "#define TARGET_I386 1" >> $config_h 1902 + TARGET_BASE_ARCH=i386
1903 target_phys_bits=64 1903 target_phys_bits=64
1904 ;; 1904 ;;
1905 alpha) 1905 alpha)
@@ -1937,16 +1937,14 @@ case &quot;$target_arch2&quot; in @@ -1937,16 +1937,14 @@ case &quot;$target_arch2&quot; in
1937 mipsn32|mipsn32el) 1937 mipsn32|mipsn32el)
1938 TARGET_ARCH=mipsn32 1938 TARGET_ARCH=mipsn32
1939 echo "TARGET_ARCH2=$target_arch2" >> $config_mak 1939 echo "TARGET_ARCH2=$target_arch2" >> $config_mak
1940 - echo "TARGET_BASE_ARCH=mips" >> $config_mak  
1941 - echo "#define TARGET_MIPS 1" >> $config_h 1940 + TARGET_BASE_ARCH=mips
1942 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h 1941 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1943 target_phys_bits=64 1942 target_phys_bits=64
1944 ;; 1943 ;;
1945 mips64|mips64el) 1944 mips64|mips64el)
1946 TARGET_ARCH=mips64 1945 TARGET_ARCH=mips64
1947 echo "TARGET_ARCH2=$target_arch2" >> $config_mak 1946 echo "TARGET_ARCH2=$target_arch2" >> $config_mak
1948 - echo "TARGET_BASE_ARCH=mips" >> $config_mak  
1949 - echo "#define TARGET_MIPS 1" >> $config_h 1947 + TARGET_BASE_ARCH=mips
1950 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h 1948 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1951 target_phys_bits=64 1949 target_phys_bits=64
1952 ;; 1950 ;;
@@ -1955,25 +1953,22 @@ case &quot;$target_arch2&quot; in @@ -1955,25 +1953,22 @@ case &quot;$target_arch2&quot; in
1955 target_phys_bits=32 1953 target_phys_bits=32
1956 ;; 1954 ;;
1957 ppcemb) 1955 ppcemb)
1958 - echo "TARGET_BASE_ARCH=ppc" >> $config_mak 1956 + TARGET_BASE_ARCH=ppc
1959 echo "TARGET_ABI_DIR=ppc" >> $config_mak 1957 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1960 - echo "#define TARGET_PPC 1" >> $config_h  
1961 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 1958 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1962 target_phys_bits=64 1959 target_phys_bits=64
1963 ;; 1960 ;;
1964 ppc64) 1961 ppc64)
1965 - echo "TARGET_BASE_ARCH=ppc" >> $config_mak 1962 + TARGET_BASE_ARCH=ppc
1966 echo "TARGET_ABI_DIR=ppc" >> $config_mak 1963 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1967 - echo "#define TARGET_PPC 1" >> $config_h  
1968 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 1964 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1969 target_phys_bits=64 1965 target_phys_bits=64
1970 ;; 1966 ;;
1971 ppc64abi32) 1967 ppc64abi32)
1972 TARGET_ARCH=ppc64 1968 TARGET_ARCH=ppc64
1973 - echo "TARGET_BASE_ARCH=ppc" >> $config_mak 1969 + TARGET_BASE_ARCH=ppc
1974 echo "TARGET_ABI_DIR=ppc" >> $config_mak 1970 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1975 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak 1971 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1976 - echo "#define TARGET_PPC 1" >> $config_h  
1977 echo "#define TARGET_ABI32 1" >> $config_h 1972 echo "#define TARGET_ABI32 1" >> $config_h
1978 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 1973 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1979 target_phys_bits=64 1974 target_phys_bits=64
@@ -1989,17 +1984,15 @@ case &quot;$target_arch2&quot; in @@ -1989,17 +1984,15 @@ case &quot;$target_arch2&quot; in
1989 target_phys_bits=64 1984 target_phys_bits=64
1990 ;; 1985 ;;
1991 sparc64) 1986 sparc64)
1992 - echo "TARGET_BASE_ARCH=sparc" >> $config_mak  
1993 - echo "#define TARGET_SPARC 1" >> $config_h 1987 + TARGET_BASE_ARCH=sparc
1994 elfload32="yes" 1988 elfload32="yes"
1995 target_phys_bits=64 1989 target_phys_bits=64
1996 ;; 1990 ;;
1997 sparc32plus) 1991 sparc32plus)
1998 TARGET_ARCH=sparc64 1992 TARGET_ARCH=sparc64
1999 - echo "TARGET_BASE_ARCH=sparc" >> $config_mak 1993 + TARGET_BASE_ARCH=sparc
2000 echo "TARGET_ABI_DIR=sparc" >> $config_mak 1994 echo "TARGET_ABI_DIR=sparc" >> $config_mak
2001 echo "TARGET_ARCH2=$target_arch2" >> $config_mak 1995 echo "TARGET_ARCH2=$target_arch2" >> $config_mak
2002 - echo "#define TARGET_SPARC 1" >> $config_h  
2003 echo "#define TARGET_ABI32 1" >> $config_h 1996 echo "#define TARGET_ABI32 1" >> $config_h
2004 target_phys_bits=64 1997 target_phys_bits=64
2005 ;; 1998 ;;
@@ -2012,7 +2005,13 @@ echo &quot;TARGET_ARCH=$TARGET_ARCH&quot; &gt;&gt; $config_mak @@ -2012,7 +2005,13 @@ echo &quot;TARGET_ARCH=$TARGET_ARCH&quot; &gt;&gt; $config_mak
2012 echo "#define TARGET_ARCH \"$TARGET_ARCH\"" >> $config_h 2005 echo "#define TARGET_ARCH \"$TARGET_ARCH\"" >> $config_h
2013 target_arch_name=`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'` 2006 target_arch_name=`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`
2014 echo "#define TARGET_$target_arch_name 1" >> $config_h 2007 echo "#define TARGET_$target_arch_name 1" >> $config_h
2015 - 2008 +if [ "$TARGET_BASE_ARCH" = "" ]; then
  2009 + TARGET_BASE_ARCH=$TARGET_ARCH
  2010 +else
  2011 + target_base_arch_name=`echo $TARGET_BASE_ARCH | tr '[:lower:]' '[:upper:]'`
  2012 + echo "#define TARGET_$target_base_arch_name 1" >> $config_h
  2013 +fi
  2014 +echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_mak
2016 if [ $target_phys_bits -lt $hostlongbits ] ; then 2015 if [ $target_phys_bits -lt $hostlongbits ] ; then
2017 target_phys_bits=$hostlongbits 2016 target_phys_bits=$hostlongbits
2018 fi 2017 fi