diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-12-03 18:23:51 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-12-03 18:23:51 +0000 |
commit | db2e4d67e775a2f96ae3e122885a3495da7c9c25 (patch) | |
tree | bcc25f62b342d59fe9bae1adc82615fdd1767f0a /sim/bfin | |
parent | 1d41d75cb6f1e78eedf871801a351e8be761daff (diff) | |
download | gdb-db2e4d67e775a2f96ae3e122885a3495da7c9c25.zip gdb-db2e4d67e775a2f96ae3e122885a3495da7c9c25.tar.gz gdb-db2e4d67e775a2f96ae3e122885a3495da7c9c25.tar.bz2 |
sim: generate build dependencies on the fly
Lift the code that GDB is using to generate dependencies on the fly and
port it over to the sim. Now people shouldn't have to manually maintain
these in their Makefile's.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim/bfin')
-rw-r--r-- | sim/bfin/ChangeLog | 5 | ||||
-rw-r--r-- | sim/bfin/Makefile.in | 34 | ||||
-rw-r--r-- | sim/bfin/aclocal.m4 | 76 | ||||
-rwxr-xr-x | sim/bfin/configure | 225 |
4 files changed, 306 insertions, 34 deletions
diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog index de92451..f8f9ce9 100644 --- a/sim/bfin/ChangeLog +++ b/sim/bfin/ChangeLog @@ -1,3 +1,8 @@ +2011-12-03 Mike Frysinger <vapier@gentoo.org> + + * Makefile.in: Delete all dependency rules. + * aclocal.m4, configure: Regenerate. + 2011-10-19 Mike Frysinger <vapier@gentoo.org> * configure: Regenerate after common/acinclude.m4 update. diff --git a/sim/bfin/Makefile.in b/sim/bfin/Makefile.in index 07dbaa1..7fae4b4 100644 --- a/sim/bfin/Makefile.in +++ b/sim/bfin/Makefile.in @@ -64,37 +64,3 @@ $(srcdir)/linux-fixed-code.h: $(srcdir)/linux-fixed-code.s Makefile.in ) > $@.tmp rm -f linux-fixed-code.o mv $@.tmp $@ - -interp.o: interp.c targ-vals.h linux-targ-map.h linux-fixed-code.h devices.h $(INCLUDE) -bfin-sim.o: bfin-sim.c $(INCLUDE) -gui.o: gui.c $(INCLUDE) -machs.o: machs.c $(INCLUDE) -dv-bfin_cec.o: dv-bfin_cec.c devices.h $(INCLUDE) -dv-bfin_ctimer.o: dv-bfin_ctimer.c devices.h $(INCLUDE) -dv-bfin_dma.o: dv-bfin_dma.c devices.h $(INCLUDE) -dv-bfin_dma_pmap.o: dv-bfin_dma_pmap.c devices.h $(INCLUDE) -dv-bfin_ebiu_amc.o: dv-bfin_ebiu_amc.c devices.h $(INCLUDE) -dv-bfin_ebiu_ddrc.o: dv-bfin_ebiu_ddrc.c devices.h $(INCLUDE) -dv-bfin_ebiu_sdc.o: dv-bfin_ebiu_sdc.c devices.h $(INCLUDE) -dv-bfin_emac.o: dv-bfin_emac.c devices.h $(INCLUDE) -dv-bfin_eppi.o: dv-bfin_eppi.c devices.h $(INCLUDE) -dv-bfin_evt.o: dv-bfin_evt.c devices.h $(INCLUDE) -dv-bfin_gpio.o: dv-bfin_gpio.c devices.h $(INCLUDE) -dv-bfin_gptimer.o: dv-bfin_gptimer.c devices.h $(INCLUDE) -dv-bfin_jtag.o: dv-bfin_jtag.c devices.h $(INCLUDE) -dv-bfin_mmu.o: dv-bfin_mmu.c devices.h $(INCLUDE) -dv-bfin_nfc.o: dv-bfin_nfc.c devices.h $(INCLUDE) -dv-bfin_otp.o: dv-bfin_otp.c devices.h $(INCLUDE) -dv-bfin_pfmon.o: dv-bfin_pfmon.c devices.h $(INCLUDE) -dv-bfin_pll.o: dv-bfin_pll.c devices.h $(INCLUDE) -dv-bfin_ppi.o: dv-bfin_ppi.c devices.h $(INCLUDE) -dv-bfin_rtc.o: dv-bfin_rtc.c devices.h $(INCLUDE) -dv-bfin_sic.o: dv-bfin_sic.c devices.h $(INCLUDE) -dv-bfin_spi.o: dv-bfin_spi.c devices.h $(INCLUDE) -dv-bfin_trace.o: dv-bfin_trace.c devices.h $(INCLUDE) -dv-bfin_twi.o: dv-bfin_twi.c devices.h $(INCLUDE) -dv-bfin_uart.o: dv-bfin_uart.c devices.h $(INCLUDE) -dv-bfin_uart2.o: dv-bfin_uart2.c devices.h $(INCLUDE) -dv-bfin_wdog.o: dv-bfin_wdog.c devices.h $(INCLUDE) -dv-bfin_wp.o: dv-bfin_wp.c devices.h $(INCLUDE) -dv-eth_phy.o: devices.h $(INCLUDE) diff --git a/sim/bfin/aclocal.m4 b/sim/bfin/aclocal.m4 index af3c83d..28aa237 100644 --- a/sim/bfin/aclocal.m4 +++ b/sim/bfin/aclocal.m4 @@ -171,3 +171,79 @@ else fi[]dnl ])# PKG_CHECK_MODULES +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + diff --git a/sim/bfin/configure b/sim/bfin/configure index ffeaf4e..a8c4639 100755 --- a/sim/bfin/configure +++ b/sim/bfin/configure @@ -622,6 +622,12 @@ INCINTL LIBINTL_DEP LIBINTL USE_NLS +GMAKE_FALSE +GMAKE_TRUE +MAKE +CCDEPMODE +DEPDIR +am__leading_dot RANLIB AR HDEFINES @@ -2249,6 +2255,44 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +## -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# Based on depend.m4 from automake 1.9, modified for standalone use in +# an environment where GNU make is required. + +# ZW_PROG_COMPILER_DEPENDENCIES +# ----------------------------- +# Variant of _AM_DEPENDENCIES which just does the dependency probe and +# sets fooDEPMODE accordingly. Cache-variable compatible with +# original; not side-effect compatible. As the users of this macro +# may require accurate dependencies for correct builds, it does *not* +# honor --disable-dependency-checking, and failure to detect a usable +# method is an error. depcomp is assumed to be located in +# $ac_aux_dir. +# +# FIXME: Should use the Autoconf 2.5x language-selection mechanism. + + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. + + +# ZW_CREATE_DEPDIR +# ---------------- +# As AM_SET_DEPDIR, but also create the directory at config.status time. + + @@ -3456,6 +3500,17 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +DEPDIR="${am__leading_dot}deps" + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3969,6 +4024,165 @@ else fi +# Dependency checking. +ac_config_commands="$ac_config_commands depdir" + + +depcc="$CC" am_compiler_list= + +am_depcomp=$ac_aux_dir/depcomp +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + if test $depmode = none; then break; fi + + $as_echo "$as_me:$LINENO: trying $depmode" >&5 + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "include sub/conftest.Po" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + depcmd="depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c" + echo "| $depcmd" | sed -e 's/ */ /g' >&5 + if env $depcmd > conftest.err 2>&1 && + grep sub/conftst6.h sub/conftest.Po >>conftest.err 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po >>conftest.err 2>&1 && + ${MAKE-make} -s -f confmf >>conftest.err 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + $as_echo "$as_me:$LINENO: success" >&5 + break + fi + fi + $as_echo "$as_me:$LINENO: failure, diagnostics are:" >&5 + sed -e 's/^/| /' < conftest.err >&5 + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +if test x${am_cv_CC_dependencies_compiler_type-none} = xnone +then as_fn_error "no usable dependency style found" "$LINENO" 5 +else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + +fi + + +# Check for the 'make' the user wants to use. +for ac_prog in make +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_MAKE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MAKE"; then + ac_cv_prog_MAKE="$MAKE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MAKE="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MAKE=$ac_cv_prog_MAKE +if test -n "$MAKE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 +$as_echo "$MAKE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$MAKE" && break +done + +MAKE_IS_GNU= +case "`$MAKE --version 2>&1 | sed 1q`" in + *GNU*) + MAKE_IS_GNU=yes + ;; +esac + if test "$MAKE_IS_GNU" = yes; then + GMAKE_TRUE= + GMAKE_FALSE='#' +else + GMAKE_TRUE='#' + GMAKE_FALSE= +fi + + ALL_LINGUAS= # If we haven't got the data from the intl directory, # assume NLS is disabled. @@ -5594,6 +5808,10 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs +if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then + as_fn_error "conditional \"GMAKE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : ${CONFIG_STATUS=./config.status} @@ -6177,6 +6395,11 @@ _ASBOX _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR + _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 @@ -6186,6 +6409,7 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;; "$ac_config_links_1") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;; "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;; "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;; @@ -6768,6 +6992,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} case $ac_file$ac_mode in + "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;; "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..." rm -f Makesim1.tmp Makesim2.tmp Makefile sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp |