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 1 include config.mak
2 2 include $(SRC_PATH)/rules.mak
3 3  
4   -ifndef TARGET_BASE_ARCH
5   -TARGET_BASE_ARCH:=$(TARGET_ARCH)
6   -endif
7   -
8 4 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
9 5 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
10 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 1892 gdb_xml_files=""
1893 1893  
1894 1894 TARGET_ARCH="$target_arch2"
  1895 +TARGET_BASE_ARCH=""
1895 1896  
1896 1897 case "$target_arch2" in
1897 1898 i386)
1898 1899 target_phys_bits=32
1899 1900 ;;
1900 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 1903 target_phys_bits=64
1904 1904 ;;
1905 1905 alpha)
... ... @@ -1937,16 +1937,14 @@ case &quot;$target_arch2&quot; in
1937 1937 mipsn32|mipsn32el)
1938 1938 TARGET_ARCH=mipsn32
1939 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 1941 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1943 1942 target_phys_bits=64
1944 1943 ;;
1945 1944 mips64|mips64el)
1946 1945 TARGET_ARCH=mips64
1947 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 1948 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1951 1949 target_phys_bits=64
1952 1950 ;;
... ... @@ -1955,25 +1953,22 @@ case &quot;$target_arch2&quot; in
1955 1953 target_phys_bits=32
1956 1954 ;;
1957 1955 ppcemb)
1958   - echo "TARGET_BASE_ARCH=ppc" >> $config_mak
  1956 + TARGET_BASE_ARCH=ppc
1959 1957 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1960   - echo "#define TARGET_PPC 1" >> $config_h
1961 1958 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1962 1959 target_phys_bits=64
1963 1960 ;;
1964 1961 ppc64)
1965   - echo "TARGET_BASE_ARCH=ppc" >> $config_mak
  1962 + TARGET_BASE_ARCH=ppc
1966 1963 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1967   - echo "#define TARGET_PPC 1" >> $config_h
1968 1964 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1969 1965 target_phys_bits=64
1970 1966 ;;
1971 1967 ppc64abi32)
1972 1968 TARGET_ARCH=ppc64
1973   - echo "TARGET_BASE_ARCH=ppc" >> $config_mak
  1969 + TARGET_BASE_ARCH=ppc
1974 1970 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1975 1971 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1976   - echo "#define TARGET_PPC 1" >> $config_h
1977 1972 echo "#define TARGET_ABI32 1" >> $config_h
1978 1973 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1979 1974 target_phys_bits=64
... ... @@ -1989,17 +1984,15 @@ case &quot;$target_arch2&quot; in
1989 1984 target_phys_bits=64
1990 1985 ;;
1991 1986 sparc64)
1992   - echo "TARGET_BASE_ARCH=sparc" >> $config_mak
1993   - echo "#define TARGET_SPARC 1" >> $config_h
  1987 + TARGET_BASE_ARCH=sparc
1994 1988 elfload32="yes"
1995 1989 target_phys_bits=64
1996 1990 ;;
1997 1991 sparc32plus)
1998 1992 TARGET_ARCH=sparc64
1999   - echo "TARGET_BASE_ARCH=sparc" >> $config_mak
  1993 + TARGET_BASE_ARCH=sparc
2000 1994 echo "TARGET_ABI_DIR=sparc" >> $config_mak
2001 1995 echo "TARGET_ARCH2=$target_arch2" >> $config_mak
2002   - echo "#define TARGET_SPARC 1" >> $config_h
2003 1996 echo "#define TARGET_ABI32 1" >> $config_h
2004 1997 target_phys_bits=64
2005 1998 ;;
... ... @@ -2012,7 +2005,13 @@ echo &quot;TARGET_ARCH=$TARGET_ARCH&quot; &gt;&gt; $config_mak
2012 2005 echo "#define TARGET_ARCH \"$TARGET_ARCH\"" >> $config_h
2013 2006 target_arch_name=`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`
2014 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 2015 if [ $target_phys_bits -lt $hostlongbits ] ; then
2017 2016 target_phys_bits=$hostlongbits
2018 2017 fi
... ...