* Re: [PATCH] sim: generate build dependencies on the fly
[not found] <1310436152-8693-1-git-send-email-vapier__46811.2245122485$1310436164$gmane$org@gentoo.org>
@ 2011-07-12 19:49 ` Tom Tromey
2011-07-12 20:59 ` Mike Frysinger
[not found] ` <CAJaTeTqM-Kr3Nrr4JKyfpys7=+aWk_YJCA+=AensJyBTUvg4dQ__24418.5384632603$1310503395$gmane$org@mail.gmail.com>
0 siblings, 2 replies; 8+ messages in thread
From: Tom Tromey @ 2011-07-12 19:49 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel
>>>>> "Mike" == Mike Frysinger <vapier@gentoo.org> writes:
Mike> Lift the code that GDB is using to generate dependencies on the
Mike> fly and port it over to the sim. Now people shouldn't have to
Mike> manually maintain these in their Makefile's (for the most part).
Thanks. I think it is a good idea.
Mike> Generated header files still need to be manually tracked.
Why is that?
Mike> -VPATH = @srcdir@
Mike> +VPATH = @srcdir@:$(srccom)
The Autoconf manual lists various problems with VPATH.
You can't use variable references in VPATH.
Also VPATH won't work properly with built sources. I'm not sure if your
patch relies on that or not.
Finally I thought there was some problem with multiple entries in VPATH,
but I cannot find that in the docs. Perhaps it is one of those ancient
incorrect memories. It would bear testing with a non-GNU make.
Mike> +depcomp = $(SHELL) $(srcdir)/../depcomp
This seems like the wrong directory to me.
I would have expected $(srcdir)/../../depcomp.
Tom
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] sim: generate build dependencies on the fly
2011-07-12 19:49 ` [PATCH] sim: generate build dependencies on the fly Tom Tromey
@ 2011-07-12 20:59 ` Mike Frysinger
[not found] ` <CAJaTeTqM-Kr3Nrr4JKyfpys7=+aWk_YJCA+=AensJyBTUvg4dQ__24418.5384632603$1310503395$gmane$org@mail.gmail.com>
1 sibling, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2011-07-12 20:59 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches, toolchain-devel
On Tue, Jul 12, 2011 at 15:48, Tom Tromey wrote:
>>>>>> "Mike" == Mike Frysinger writes:
> Mike> Generated header files still need to be manually tracked.
>
> Why is that?
it didnt seem to work :). if the dependency generation step is done
inline with the compile step, how can we figure out the dependency
info of a header file that is generated ? does gdb handle this and i
just missed it in its Makefile ?
a good example is the mn10300 subdir (which coincidentally, i'm pretty
sure is already missing dependency info and often fails to build in
parallel today). the "sim-main.h" header is included by pretty much
all sim files and each arch must create it. mn10300's sim-main.h
relies on the generated headers "itable.h" and "idecode.h" which come
from running ../igen/igen. so they add those headers to
SIM_EXTRA_DEPS as most objects will depend on the files in that
existing.
> Mike> -VPATH = @srcdir@
> Mike> +VPATH = @srcdir@:$(srccom)
>
> The Autoconf manual lists various problems with VPATH.
>
> You can't use variable references in VPATH.
i read some info on that, but it sounded like the known issues were
worked around by configure. such as empty vpath and "." entries. but
i guess i didnt delve into the autoconf manual to double check.
> Also VPATH won't work properly with built sources. I'm not sure if your
> patch relies on that or not.
the common subdir does generate one "sim-inline.c" file for a few
targets. seemed to generate/build on my system, but i'm using
up-to-date GNU make, so that probably doesnt count.
> Finally I thought there was some problem with multiple entries in VPATH,
> but I cannot find that in the docs. Perhaps it is one of those ancient
> incorrect memories. It would bear testing with a non-GNU make.
sounds like all good reasons to use automake :). otherwise all the
files in common/ need manual deps (like gdb does with files in
subdirs), and that semi-defeats the purpose of this in the first
place.
> Mike> +depcomp = $(SHELL) $(srcdir)/../depcomp
>
> This seems like the wrong directory to me.
> I would have expected $(srcdir)/../../depcomp.
yeah ... i didnt notice as my stuff all went through gcc for dep info.
probably better to use $(srcroot)/depcomp.
-mike
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] sim: generate build dependencies on the fly
[not found] ` <CAJaTeTqM-Kr3Nrr4JKyfpys7=+aWk_YJCA+=AensJyBTUvg4dQ__24418.5384632603$1310503395$gmane$org@mail.gmail.com>
@ 2011-07-12 21:15 ` Tom Tromey
2011-07-13 2:04 ` Mike Frysinger
[not found] ` <CAJaTeTpoc=UUiePTTBNiRA=dREKdYABMfXQ+HdCsDWaa4wuG0w__27433.0390304842$1310506984$gmane$org@mail.gmail.com>
0 siblings, 2 replies; 8+ messages in thread
From: Tom Tromey @ 2011-07-12 21:15 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel
>>>>> "Mike" == Mike Frysinger <vapier@gentoo.org> writes:
Tom> Why is that?
Mike> it didnt seem to work :). if the dependency generation step is done
Mike> inline with the compile step, how can we figure out the dependency
Mike> info of a header file that is generated ? does gdb handle this and i
Mike> just missed it in its Makefile ?
Ok, I see. I misunderstood what you meant.
GDB arranges for generated files to be built early, via order-only
dependencies. Order-only dependencies ensure that merely touching one
of the generated files doesn't cause a global recompile.
The relevant code is down near the end of gdb/Makefile.in:
# Ensure that generated files are created early. Use order-only
# dependencies if available. They require GNU make 3.80 or newer,
# and the .VARIABLES variable was introduced at the same time.
@GMAKE_TRUE@ifdef .VARIABLES
@GMAKE_TRUE@$(all_object_files): | $(generated_files)
@GMAKE_TRUE@else
$(all_object_files) : $(generated_files)
@GMAKE_TRUE@endif
Tom> Finally I thought there was some problem with multiple entries in VPATH,
Tom> but I cannot find that in the docs. Perhaps it is one of those ancient
Tom> incorrect memories. It would bear testing with a non-GNU make.
Mike> sounds like all good reasons to use automake :). otherwise all the
Mike> files in common/ need manual deps (like gdb does with files in
Mike> subdirs), and that semi-defeats the purpose of this in the first
Mike> place.
Yeah. I am not actually sure how well Automake would currently handle
sources in "../common/". Neither here nor there I guess.
Fedora includes the BSD make (yum install bmake); I assume other distros
do too. So you could try a build with that.
Mike> yeah ... i didnt notice as my stuff all went through gcc for dep info.
Mike> probably better to use $(srcroot)/depcomp.
You can edit the Makefile.in or generated Makefile slightly to test the
non-gcc3 path.
Tom
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] sim: generate build dependencies on the fly
2011-07-12 21:15 ` Tom Tromey
@ 2011-07-13 2:04 ` Mike Frysinger
[not found] ` <CAJaTeTpoc=UUiePTTBNiRA=dREKdYABMfXQ+HdCsDWaa4wuG0w__27433.0390304842$1310506984$gmane$org@mail.gmail.com>
1 sibling, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2011-07-13 2:04 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches, toolchain-devel
On Tue, Jul 12, 2011 at 17:08, Tom Tromey wrote:
> GDB arranges for generated files to be built early, via order-only
> dependencies. Order-only dependencies ensure that merely touching one
> of the generated files doesn't cause a global recompile.
>
> # Ensure that generated files are created early. Use order-only
> # dependencies if available. They require GNU make 3.80 or newer,
> # and the .VARIABLES variable was introduced at the same time.
> @GMAKE_TRUE@ifdef .VARIABLES
> @GMAKE_TRUE@$(all_object_files): | $(generated_files)
> @GMAKE_TRUE@else
> $(all_object_files) : $(generated_files)
> @GMAKE_TRUE@endif
oh, ok. i saw that, but didnt quite grok what was going on. this
will make things much easier to work with, so i'll take this approach
and send an updated patch.
> Tom> Finally I thought there was some problem with multiple entries in VPATH,
> Tom> but I cannot find that in the docs. Perhaps it is one of those ancient
> Tom> incorrect memories. It would bear testing with a non-GNU make.
>
> Mike> sounds like all good reasons to use automake :). otherwise all the
> Mike> files in common/ need manual deps (like gdb does with files in
> Mike> subdirs), and that semi-defeats the purpose of this in the first
> Mike> place.
>
> Yeah. I am not actually sure how well Automake would currently handle
> sources in "../common/". Neither here nor there I guess.
pretty sure it wouldnt care. it can handle relative paths in subdirs
last i looked (foo/blah.c), so i dont see why relative paths in a
sibling tree (../foo/blah.c) would be different. knock on wood :x.
> Fedora includes the BSD make (yum install bmake); I assume other distros
> do too. So you could try a build with that.
yes, Gentoo includes many alternative makes including bmake and pmake.
Gentoo works natively on BSD systems too you know :).
but would saying "yes, this works on current BSD makes" be
satisfactory when the complaint in the manual alludes to "ancient makes" ?
-mike
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] sim: generate build dependencies on the fly
[not found] ` <CAJaTeTpoc=UUiePTTBNiRA=dREKdYABMfXQ+HdCsDWaa4wuG0w__27433.0390304842$1310506984$gmane$org@mail.gmail.com>
@ 2011-07-13 13:59 ` Tom Tromey
2011-07-13 20:17 ` Mike Frysinger
0 siblings, 1 reply; 8+ messages in thread
From: Tom Tromey @ 2011-07-13 13:59 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel
>>>>> "Mike" == Mike Frysinger <vapier@gentoo.org> writes:
Mike> but would saying "yes, this works on current BSD makes" be
Mike> satisfactory when the complaint in the manual alludes to "ancient
Mike> makes" ?
It would be a good start.
A general problem in gdb is that we aren't always aware of what hosts
users build on -- we can't distinguish "no report because it just kept
working" from "no report because there are no more users".
Joel builds on some odd hosts, maybe he could say what versions of make
he uses. Likewise perhaps the Sourcerers.
Tom
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] sim: generate build dependencies on the fly
2011-07-13 13:59 ` Tom Tromey
@ 2011-07-13 20:17 ` Mike Frysinger
0 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2011-07-13 20:17 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches, toolchain-devel
[-- Attachment #1: Type: Text/Plain, Size: 748 bytes --]
On Wednesday, July 13, 2011 09:21:24 Tom Tromey wrote:
> >>>>> "Mike" == Mike Frysinger <vapier@gentoo.org> writes:
> Mike> but would saying "yes, this works on current BSD makes" be
> Mike> satisfactory when the complaint in the manual alludes to "ancient
> Mike> makes" ?
>
> It would be a good start.
bmake-20090222, bmake-20110606, and pmake-1.111.3.1 seem to work with my patch
i did notice that the dependency files are not generated though, nor are they
included. but this seems to be by design as the gdb subdir is the same way,
and the code in the Makefile is only enabled for GNU make.
also, i seems that the gdb/gdbtk/plugins/ only works with GNU make :). it use
"ifeq" constructs in the Make-rules file.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] sim: generate build dependencies on the fly
2011-07-12 5:18 Mike Frysinger
@ 2011-12-03 18:24 ` Mike Frysinger
0 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2011-12-03 18:24 UTC (permalink / raw)
To: gdb-patches; +Cc: toolchain-devel
[-- Attachment #1: Type: Text/Plain, Size: 394 bytes --]
On Monday 11 July 2011 22:02:32 Mike Frysinger wrote:
> 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 (for the most part). Generated header files
> still need to be manually tracked.
i've committed this now (after also adding in sim/rl78 to my regen/tests)
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] sim: generate build dependencies on the fly
@ 2011-07-12 5:18 Mike Frysinger
2011-12-03 18:24 ` Mike Frysinger
0 siblings, 1 reply; 8+ messages in thread
From: Mike Frysinger @ 2011-07-12 5:18 UTC (permalink / raw)
To: gdb-patches; +Cc: toolchain-devel
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 (for the most part). Generated header files
still need to be manually tracked.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sim/bfin/:
2011-07-11 Mike Frysinger <vapier@gentoo.org>
* Makefile.in: Replace all dependency rules with a single rule
for interp.o.
* aclocal.m4, configure: Regenerate.
sim/arm/:
sim/avr/:
sim/cr16/:
sim/cris/:
sim/d10v/:
sim/erc32/:
sim/frv/:
sim/h8300/:
sim/igen/:
sim/iq2000/:
sim/lm32/:
sim/m32c/:
sim/m32r/:
sim/m68hc11/:
sim/mcore/:
sim/microblaze/:
sim/mips/:
sim/mn10300/:
sim/moxie/:
sim/ppc/:
sim/rx/:
sim/sh/:
sim/sh64/:
sim/v850/:
2011-07-11 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4: New file.
* configure: Regenerate.
sim/common/:
2011-07-11 Mike Frysinger <vapier@gentoo.org>
* Make-common.in (VPATH): Add $(srccom).
(DEP): Delete.
(DEPMODE, DEPDIR, depcomp, COMPILE.pre, COMPILE.post, COMPILE,
POSTCOMPILE): New variables.
(run.o, sim-command.o, sim-core.o, sim-cpu.o, sim-endian.o,
sim-engine.o, sim-hw.o, sim-memopt.o, sim-module.o, sim-options.o,
sim-reason.o, sim-reg.o, sim-resume.o, sim-run.o, sim-signal.o,
sim-stop.o, sim-trace.o, sim-profile.o, sim-model.o, sim-utils.o,
sim-watch.o, sim-load.o, hw-alloc.o, hw-device.o, hw-events.o,
hw-instances.o, hw-handles.o, hw-ports.o, hw-properties.o, hw-tree.o,
dv-cfi.o, dv-core.o, dv-glue.o, dv-pal.o, dv-sockser.o, nrun.o,
cgen-run.o, cgen-scache.o, cgen-trace.o, cgen-fpu.o, cgen-accfp.o,
cgen-utils.o, cgen-par.o): Delete rules.
(sim-abort.o, sim-arange.o, sim-bits.o, sim-config.o, sim-events.o,
sim-fpu.o, sim-hload.o, sim-hrw.o, sim-info.o): Replace build recipe
with dependency rule on $(SIM_EXTRA_DEPS).
(callback.o, syscall.o, sim-io.o): Replace build recipe with
dependency rule on targ-vals.h.
(hw-base.o): Replace build recipe with dependency rule on hw-config.h.
(.c.o): Replace recipe with call to $(COMPILE) and $(POSTCOMPILE).
Include dependency files, when using GNU Make.
* aclocal.m4: Include ../../config/depstand.m4. Call
ZW_CREATE_DEPDIR and ZW_PROG_COMPILER_DEPENDENCIES.
(MAKE, GMAKE): New substs.
---
sim/bfin/Makefile.in | 43 +-------
sim/common/Make-common.in | 264 +++++++++++++--------------------------------
sim/common/acinclude.m4 | 15 +++
3 files changed, 91 insertions(+), 231 deletions(-)
diff --git a/sim/bfin/Makefile.in b/sim/bfin/Makefile.in
index 67e73c0..20e438f 100644
--- a/sim/bfin/Makefile.in
+++ b/sim/bfin/Makefile.in
@@ -65,45 +65,4 @@ $(srcdir)/linux-fixed-code.h: $(srcdir)/linux-fixed-code.s Makefile.in
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_cgu.o: dv-bfin_cgu.c devices.h $(INCLUDE)
-dv-bfin_ctimer.o: dv-bfin_ctimer.c devices.h $(INCLUDE)
-dv-bfin_dde.o: dv-bfin_dde.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_efs.o: dv-bfin_efs.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_gpio2.o: dv-bfin_gpio2.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_pint.o: dv-bfin_pint.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_sec.o: dv-bfin_sec.c devices.h $(INCLUDE)
-dv-bfin_sic.o: dv-bfin_sic.c devices.h $(INCLUDE)
-dv-bfin_smc.o: dv-bfin_smc.c devices.h $(INCLUDE)
-dv-bfin_spi.o: dv-bfin_spi.c devices.h $(INCLUDE)
-dv-bfin_spu.o: dv-bfin_spu.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_uart4.o: dv-bfin_uart4.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)
+interp.o: targ-vals.h
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 42e3192..b6d9573 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -35,7 +35,7 @@
## COMMON_PRE_CONFIG_FRAG
-VPATH = @srcdir@
+VPATH = @srcdir@:$(srccom)
srcdir = @srcdir@
srccom = $(srcdir)/../common
srcroot = $(srcdir)/../..
@@ -109,7 +109,17 @@ AR_FLAGS = rc
RANLIB = @RANLIB@
MAKEINFO = makeinfo
-DEP = $(srcroot)/mkdep
+# Dependency tracking information.
+DEPMODE = @CCDEPMODE@
+DEPDIR = @DEPDIR@
+depcomp = $(SHELL) $(srcdir)/../depcomp
+
+# Note that these are overridden by GNU make-specific code below if
+# GNU make is used. The overrides implement dependency tracking.
+COMPILE.pre = $(CC)
+COMPILE.post = -c -o $@
+COMPILE = $(COMPILE.pre) $(ALL_CFLAGS) $(COMPILE.post)
+POSTCOMPILE = @true
# Each simulator's Makefile.in defines one or more of these variables
# to override our settings as necessary. There is no need to define these
@@ -272,19 +282,13 @@ run$(EXEEXT): $(SIM_RUN_OBJS) libsim.a $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o run$(EXEEXT) \
$(SIM_RUN_OBJS) libsim.a $(EXTRA_LIBS)
-run.o: $(srccom)/run.c config.h tconfig.h $(remote_sim_h) $(callback_h)
- $(CC) -c $(srccom)/run.c $(ALL_CFLAGS)
-
# FIXME: Ideally, callback.o and friends live in a library outside of
# both the gdb and simulator source trees (e.g. devo/remote. Not
# devo/libremote because this directory would contain more than just
# a library).
-callback.o: $(srccom)/callback.c config.h tconfig.h $(callback_h) targ-vals.h
- $(CC) -c $(srccom)/callback.c $(ALL_CFLAGS)
-
-syscall.o: $(srccom)/syscall.c config.h tconfig.h $(callback_h) targ-vals.h
- $(CC) -c $(srccom)/syscall.c $(ALL_CFLAGS)
+callback.o: targ-vals.h
+syscall.o: targ-vals.h
targ-map.o: targ-map.c targ-vals.h
@@ -409,127 +413,68 @@ hw_main_headers = \
$(hw-ports_h) \
$(hw-properties_h) \
-# FIXME: If this complicated way of building .o files from ../common is
-# necessary, the reason should be documented here.
+#
+# Dependency tracking. Most of this is conditional on GNU Make being
+# found by configure; if GNU Make is not found, we fall back to a
+# simpler scheme.
+#
+
+@GMAKE_TRUE@ifeq ($(DEPMODE),depmode=gcc3)
+# Note that we put the dependencies into a .Tpo file, then move them
+# into place if the compile succeeds. We need this because gcc does
+# not atomically write the dependency output file.
+@GMAKE_TRUE@override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
+@GMAKE_TRUE@ -MF $(DEPDIR)/$(basename $(@F)).Tpo
+@GMAKE_TRUE@override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \
+@GMAKE_TRUE@ $(DEPDIR)/$(basename $(@F)).Po
+@GMAKE_TRUE@else
+@GMAKE_TRUE@override COMPILE.pre = source='$<' object='$@' libtool=no \
+@GMAKE_TRUE@ DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC)
+# depcomp handles atomicity for us, so we don't need a postcompile
+# step.
+@GMAKE_TRUE@override POSTCOMPILE =
+@GMAKE_TRUE@endif
BUILT_SRC_FROM_COMMON= \
sim-inline.c
-sim-abort.o: $(srccom)/sim-abort.c \
- $(SIM_EXTRA_DEPS)
- $(CC) -c $(srccom)/sim-abort.c $(ALL_CFLAGS)
-
-sim-arange.o: $(srccom)/sim-arange.c $(sim-arange_h) $(SIM_EXTRA_DEPS)
- $(CC) -c $(srccom)/sim-arange.c $(ALL_CFLAGS)
-
-sim-bits.o: $(srccom)/sim-bits.c $(sim-bits_h) $(sim-n-bits_h) \
- $(SIM_EXTRA_DEPS)
- $(CC) -c $(srccom)/sim-bits.c $(ALL_CFLAGS)
-
-sim-command.o: $(srccom)/sim-command.c $(sim_main_headers)
- $(CC) -c $(srccom)/sim-command.c $(ALL_CFLAGS)
-
-sim-config.o: $(srccom)/sim-config.c $(sim-config_h) sim-main.h \
- $(SIM_EXTRA_DEPS)
- $(CC) -c $(srccom)/sim-config.c $(ALL_CFLAGS)
-
-sim-core.o: $(srccom)/sim-core.c $(sim_main_headers) \
- $(sim-core_h) $(sim-n-core_h)
- $(CC) -c $(srccom)/sim-core.c $(ALL_CFLAGS)
-
-sim-cpu.o: $(srccom)/sim-cpu.c $(sim_main_headers)
- $(CC) -c $(srccom)/sim-cpu.c $(ALL_CFLAGS)
-
-sim-endian.o: $(srccom)/sim-endian.c $(sim-endian_h) $(sim-n-endian_h)
- $(CC) -c $(srccom)/sim-endian.c $(ALL_CFLAGS)
-
-sim-engine.o: $(srccom)/sim-engine.c $(sim_main_headers) $(sim-engine_h)
- $(CC) -c $(srccom)/sim-engine.c $(ALL_CFLAGS)
-
-sim-events.o: $(srccom)/sim-events.c $(sim-events_h) sim-main.h \
- $(SIM_EXTRA_DEPS)
- $(CC) -c $(srccom)/sim-events.c $(ALL_CFLAGS)
-
-sim-fpu.o: $(srccom)/sim-fpu.c $(sim-fpu_h) \
- $(SIM_EXTRA_DEPS)
- $(CC) -c $(srccom)/sim-fpu.c $(ALL_CFLAGS)
-
-sim-hload.o: $(srccom)/sim-hload.c $(sim-assert_h) $(remote_sim_h) \
- $(SIM_EXTRA_DEPS)
- $(CC) -c $(srccom)/sim-hload.c $(ALL_CFLAGS)
-
-sim-hrw.o: $(srccom)/sim-hrw.c $(sim-assert_h) $(sim_core_h) $(remote_sim_h) \
- $(SIM_EXTRA_DEPS)
- $(CC) -c $(srccom)/sim-hrw.c $(ALL_CFLAGS)
-
-sim-hw.o: $(srccom)/sim-hw.c $(sim_main_headers)
- $(CC) -c $(srccom)/sim-hw.c $(ALL_CFLAGS)
-
-sim-info.o: $(srccom)/sim-info.c $(sim-assert_h) $(remote_sim_h) \
- $(SIM_EXTRA_DEPS)
- $(CC) -c $(srccom)/sim-info.c $(ALL_CFLAGS)
-
sim-inline.c: $(srccom)/sim-inline.c
rm -f $@ tmp-$@
echo "# 1 \"$(srccom)/$@\"" > tmp-$@
cat $(srccom)/$@ >> tmp-$@
$(SHELL) $(srcdir)/../../move-if-change tmp-$@ $@
-sim-io.o: $(srccom)/sim-io.c $(sim_main_headers) $(sim-io_h) $(remote_sim_h) \
- targ-vals.h
- $(CC) -c $(srccom)/sim-io.c $(ALL_CFLAGS)
-
-sim-memopt.o: $(srccom)/sim-memopt.c $(sim_main_headers) \
- $(sim-io_h)
- $(CC) -c $(srccom)/sim-memopt.c $(ALL_CFLAGS)
-
-sim-module.o: $(srccom)/sim-module.c $(sim_main_headers) \
- $(sim-io_h)
- $(CC) -c $(srccom)/sim-module.c $(ALL_CFLAGS)
-
-sim-options.o: $(srccom)/sim-options.c $(sim_main_headers) \
- $(sim-options_h) $(sim-io_h)
- $(CC) -c $(srccom)/sim-options.c $(ALL_CFLAGS)
-
-sim-reason.o: $(srccom)/sim-reason.c $(sim_main_headers) $(remote_sim_h)
- $(CC) -c $(srccom)/sim-reason.c $(ALL_CFLAGS)
-
-sim-reg.o: $(srccom)/sim-reg.c $(sim_main_headers) $(remote_sim_h)
- $(CC) -c $(srccom)/sim-reg.c $(ALL_CFLAGS)
-
-sim-resume.o: $(srccom)/sim-resume.c $(sim_main_headers) $(remote_sim_h)
- $(CC) -c $(srccom)/sim-resume.c $(ALL_CFLAGS)
-
-sim-run.o: $(srccom)/sim-run.c $(sim_main_headers)
- $(CC) -c $(srccom)/sim-run.c $(ALL_CFLAGS)
-
-sim-signal.o: $(srccom)/sim-signal.c $(sim_main_headers) $(sim-signal_h)
- $(CC) -c $(srccom)/sim-signal.c $(ALL_CFLAGS)
-
-sim-stop.o: $(srccom)/sim-stop.c $(sim_main_headers)
- $(CC) -c $(srccom)/sim-stop.c $(ALL_CFLAGS)
-
-sim-trace.o: $(srccom)/sim-trace.c $(sim_main_headers) \
- $(sim-options_h) $(sim-io_h)
- $(CC) -c $(srccom)/sim-trace.c $(ALL_CFLAGS)
-
-sim-profile.o: $(srccom)/sim-profile.c $(sim_main_headers) \
- $(sim-options_h) $(sim-io_h)
- $(CC) -c $(srccom)/sim-profile.c $(ALL_CFLAGS)
-
-sim-model.o: $(srccom)/sim-model.c $(sim_main_headers) \
- $(sim-io_h)
- $(CC) -c $(srccom)/sim-model.c $(ALL_CFLAGS)
-
-sim-utils.o: $(srccom)/sim-utils.c $(sim_main_headers)
- $(CC) -c $(srccom)/sim-utils.c $(ALL_CFLAGS)
-
-sim-watch.o: $(srccom)/sim-watch.c $(sim_main_headers)
- $(CC) -c $(srccom)/sim-watch.c $(ALL_CFLAGS)
-
-sim-load.o: $(srccom)/sim-load.c $(callback_h) $(sim-basics_h) $(remote_sim_h)
- $(CC) -c $(srccom)/sim-load.c $(ALL_CFLAGS)
-
+sim-abort.o \
+sim-arange.o \
+sim-bits.o \
+sim-command.o \
+sim-config.o \
+sim-core.o \
+sim-cpu.o \
+sim-engine.o \
+sim-events.o \
+sim-fpu.o \
+sim-hload.o \
+sim-hw.o \
+sim-hrw.o \
+sim-info.o \
+sim-io.o \
+sim-memopt.o \
+sim-module.o \
+sim-options.o \
+sim-reason.o \
+sim-reg.o \
+sim-resume.o \
+sim-run.o \
+sim-signal.o \
+sim-stop.o \
+sim-trace.o \
+sim-profile.o \
+sim-model.o \
+sim-utils.o \
+sim-watch.o \
+sim-load.o: $(SIM_EXTRA_DEPS)
+sim-io.o: targ-vals.h
# FIXME This is one very simple-minded way of generating the file hw-config.h
hw-config.h: Makefile.in $(srccom)/Make-common.in config.status Makefile
@@ -546,58 +491,21 @@ hw-config.h: Makefile.in $(srccom)/Make-common.in config.status Makefile
echo "};" >> tmp-hw.h
mv tmp-hw.h hw-config.h
-hw-alloc.o: $(srccom)/hw-alloc.c $(hw_main_headers)
- $(CC) -c $(srccom)/hw-alloc.c $(ALL_CFLAGS)
-
-hw-base.o: $(srccom)/hw-base.c $(hw_main_headers) hw-config.h
- $(CC) -c $(srccom)/hw-base.c $(ALL_CFLAGS)
-
-hw-device.o: $(srccom)/hw-device.c $(hw_main_headers)
- $(CC) -c $(srccom)/hw-device.c $(ALL_CFLAGS)
-
-hw-events.o: $(srccom)/hw-events.c $(hw_main_headers) $(sim_main_headers)
- $(CC) -c $(srccom)/hw-events.c $(ALL_CFLAGS)
+hw-base.o: hw-config.h
test-hw-events: $(srccom)/hw-events.c libsim.a
$(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \
$(srccom)/hw-events.c libsim.a $(EXTRA_LIBS)
-hw-instances.o: $(srccom)/hw-instances.c $(hw_main_headers)
- $(CC) -c $(srccom)/hw-instances.c $(ALL_CFLAGS)
-
-hw-handles.o: $(srccom)/hw-handles.c $(hw_main_headers)
- $(CC) -c $(srccom)/hw-handles.c $(ALL_CFLAGS)
-
-hw-ports.o: $(srccom)/hw-ports.c $(hw_main_headers)
- $(CC) -c $(srccom)/hw-ports.c $(ALL_CFLAGS)
-
-hw-properties.o: $(srccom)/hw-properties.c $(hw_main_headers)
- $(CC) -c $(srccom)/hw-properties.c $(ALL_CFLAGS)
-
-hw-tree.o: $(srccom)/hw-tree.c $(hw_main_headers) $(hw-tree_h)
- $(CC) -c $(srccom)/hw-tree.c $(ALL_CFLAGS)
-
# Devices.
-dv-cfi.o: $(srccom)/dv-cfi.c $(hw_main_headers) $(sim_main_headers)
- $(CC) -c $(srccom)/dv-cfi.c $(ALL_CFLAGS)
-
-dv-core.o: $(srccom)/dv-core.c $(hw_main_headers) $(sim_main_headers)
- $(CC) -c $(srccom)/dv-core.c $(ALL_CFLAGS)
-
-dv-glue.o: $(srccom)/dv-glue.c $(hw_main_headers) $(sim_main_headers)
- $(CC) -c $(srccom)/dv-glue.c $(ALL_CFLAGS)
-
-dv-pal.o: $(srccom)/dv-pal.c $(hw_main_headers) $(sim_main_headers)
- $(CC) -c $(srccom)/dv-pal.c $(ALL_CFLAGS)
-
-dv-sockser.o: $(srccom)/dv-sockser.h $(sim_main_headers)
- $(CC) -c $(srccom)/dv-sockser.c $(ALL_CFLAGS)
-
+dv-cfi.o \
+dv-core.o \
+dv-glue.o \
+dv-pal.o \
+dv-sockser.o: $(SIM_EXTRA_DEPS)
-nrun.o: $(srccom)/nrun.c config.h tconfig.h $(remote_sim_h) $(callback_h) \
- $(sim_main_headers)
- $(CC) -c $(srccom)/nrun.c $(ALL_CFLAGS)
+nrun.o: $(SIM_EXTRA_DEPS)
# CGEN support.
@@ -607,29 +515,6 @@ CGEN_MAIN_CPU_DEPS = \
$(srccom)/cgen-ops.h \
$(srccom)/cgen-mem.h
-cgen-run.o: $(srccom)/cgen-run.c $(sim_main_headers)
- $(CC) -c $(srccom)/cgen-run.c $(ALL_CFLAGS)
-
-cgen-scache.o: $(srccom)/cgen-scache.c $(sim_main_headers)
- $(CC) -c $(srccom)/cgen-scache.c $(ALL_CFLAGS)
-
-cgen-trace.o: $(srccom)/cgen-trace.c $(sim_main_headers)
- $(CC) -c $(srccom)/cgen-trace.c $(ALL_CFLAGS)
-
-cgen-fpu.o: $(srccom)/cgen-fpu.c $(sim_main_headers) $(sim-fpu_h)
- $(CC) -c $(srccom)/cgen-fpu.c $(ALL_CFLAGS)
-
-cgen-accfp.o: $(srccom)/cgen-accfp.c $(sim_main_headers) $(sim-fpu_h)
- $(CC) -c $(srccom)/cgen-accfp.c $(ALL_CFLAGS)
-
-cgen-utils.o: $(srccom)/cgen-utils.c $(sim_main_headers) \
- $(srccom)/cgen-mem.h $(srccom)/cgen-ops.h $(srccom)/cgen-engine.h
- $(CC) -c $(srccom)/cgen-utils.c $(ALL_CFLAGS)
-
-cgen-par.o: $(srccom)/cgen-par.c $(sim_main_headers) \
- $(srccom)/cgen-mem.h $(srccom)/cgen-par.h
- $(CC) -c $(srccom)/cgen-par.c $(ALL_CFLAGS)
-
# Support targets.
install: install-common $(SIM_EXTRA_INSTALL)
@@ -680,7 +565,8 @@ distclean mostlyclean maintainer-clean realclean: clean $(SIM_EXTRA_DISTCLEAN)
rm -f targ-vals.def
.c.o:
- $(CC) -c $(ALL_CFLAGS) $<
+ $(COMPILE) $<
+ $(POSTCOMPILE)
# Dummy target to force execution of dependent targets.
force:
diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4
index 11398f5..70feca4 100644
--- a/sim/common/acinclude.m4
+++ b/sim/common/acinclude.m4
@@ -21,6 +21,7 @@
# Include global overrides and fixes for Autoconf.
m4_include(../../config/override.m4)
sinclude([../../config/zlib.m4])
+sinclude([../../config/depstand.m4])
AC_DEFUN([SIM_AC_COMMON],
[
@@ -45,6 +46,20 @@ AR=${AR-ar}
AC_SUBST(AR)
AC_PROG_RANLIB
+# Dependency checking.
+ZW_CREATE_DEPDIR
+ZW_PROG_COMPILER_DEPENDENCIES([CC])
+
+# Check for the 'make' the user wants to use.
+AC_CHECK_PROGS(MAKE, make)
+MAKE_IS_GNU=
+case "`$MAKE --version 2>&1 | sed 1q`" in
+ *GNU*)
+ MAKE_IS_GNU=yes
+ ;;
+esac
+AM_CONDITIONAL(GMAKE, test "$MAKE_IS_GNU" = yes)
+
dnl We don't use gettext, but bfd does. So we do the appropriate checks
dnl to see if there are intl libraries we should link against.
ALL_LINGUAS=
--
1.7.6
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-12-03 18:24 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1310436152-8693-1-git-send-email-vapier__46811.2245122485$1310436164$gmane$org@gentoo.org>
2011-07-12 19:49 ` [PATCH] sim: generate build dependencies on the fly Tom Tromey
2011-07-12 20:59 ` Mike Frysinger
[not found] ` <CAJaTeTqM-Kr3Nrr4JKyfpys7=+aWk_YJCA+=AensJyBTUvg4dQ__24418.5384632603$1310503395$gmane$org@mail.gmail.com>
2011-07-12 21:15 ` Tom Tromey
2011-07-13 2:04 ` Mike Frysinger
[not found] ` <CAJaTeTpoc=UUiePTTBNiRA=dREKdYABMfXQ+HdCsDWaa4wuG0w__27433.0390304842$1310506984$gmane$org@mail.gmail.com>
2011-07-13 13:59 ` Tom Tromey
2011-07-13 20:17 ` Mike Frysinger
2011-07-12 5:18 Mike Frysinger
2011-12-03 18:24 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox