Commit 7dbe3736 by Nicolas Roche Committed by Pierre-Marie de Rodat

Make-lang.in: In the fallback mechanim...

2017-09-13  Nicolas Roche  <roche@adacore.com>

	* Make-lang.in: In the fallback mechanim, parse the associated .ali
	file and try to guess the locations of dependencies.

From-SVN: r252082
parent f216550d
2017-09-13 Nicolas Roche <roche@adacore.com>
* Make-lang.in: In the fallback mechanim, parse the associated .ali
file and try to guess the locations of dependencies.
2017-09-13 Eric Botcazou <ebotcazou@adacore.com> 2017-09-13 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch13.adb (Register_Address_Clause_Check): New procedure to save * sem_ch13.adb (Register_Address_Clause_Check): New procedure to save
......
...@@ -106,14 +106,20 @@ ada/%.o: ada/gcc-interface/%.c ...@@ -106,14 +106,20 @@ ada/%.o: ada/gcc-interface/%.c
# Function that dumps the dependencies of an Ada object. Dependency only work # Function that dumps the dependencies of an Ada object. Dependency only work
# fully if the compiler support -gnatd.n. Otherwise a fallback mechanism is # fully if the compiler support -gnatd.n. Otherwise a fallback mechanism is
# used. The fallback mechanism add dependency on all ada sources in the same # used. The fallback mechanism parse the ali files to get the list of
# directory as the original source. # dependencies and try to guess their location. If the location cannot be found
# then the dependency is ignored.
ifeq ($(findstring -gnatd.n,$(ALL_ADAFLAGS)),) ifeq ($(findstring -gnatd.n,$(ALL_ADAFLAGS)),)
ADA_DEPS=\ ADA_DEPS=\
mkdir -p $(dir $@)/$(DEPDIR); \ mkdir -p $(dir $@)/$(DEPDIR); \
(o="$@: $<"; \ (o="$@: $<"; \
for d in $(dir $<)/*.ad[sb]; do \ a="`echo $@ | sed -e 's/.o$$/.ali/'`"; \
o="$$o $$d"; \ for d in `cat $$a | sed -ne 's;^D \([a-z0-9_\.-]*\).*;\1;gp'`; do \
for l in ada $(srcdir)/ada ada/libgnat $(srcdir)/ada/libgnat; do \
if test -f $$l/$$d; then \
o="$$o $$l/$$d"; \
fi; \
done; \
done; \ done; \
echo "$$o"; echo) \ echo "$$o"; echo) \
>$(dir $@)/$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $@)) >$(dir $@)/$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $@))
...@@ -121,11 +127,9 @@ ADA_OUTPUT_OPTION = $(OUTPUT_OPTION) ...@@ -121,11 +127,9 @@ ADA_OUTPUT_OPTION = $(OUTPUT_OPTION)
else else
ADA_DEPS=\ ADA_DEPS=\
mkdir -p $(dir $@)/$(DEPDIR); \ mkdir -p $(dir $@)/$(DEPDIR); \
(o="$@: $<"; \ (echo "$@: $< " | tr -d '\015' | tr -d '\n'; \
for d in `cat $@.gnatd.n`; do \ cat $@.gnatd.n | tr -d '\015' | tr '\n' ' '; \
o="$$o $$d"; \ echo; echo) \
done; \
echo "$$o"; echo) \
>$(dir $@)/$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $@)) >$(dir $@)/$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $@))
ADA_OUTPUT_OPTION = $(OUTPUT_OPTION) > $@.gnatd.n ADA_OUTPUT_OPTION = $(OUTPUT_OPTION) > $@.gnatd.n
endif endif
...@@ -861,9 +865,11 @@ ada.uninstall: ...@@ -861,9 +865,11 @@ ada.uninstall:
ada.mostlyclean: ada.mostlyclean:
-$(RM) ada/*$(objext) ada/*.ali ada/b_gnat*.ads ada/b_gnat*.adb -$(RM) ada/*$(objext) ada/*.ali ada/b_gnat*.ads ada/b_gnat*.adb
-$(RM) ada/*$(objext).gnatd.n
-$(RM) ada/*$(coverageexts) -$(RM) ada/*$(coverageexts)
-$(RM) ada/sdefault.adb ada/stamp-sdefault ada/stamp-snames -$(RM) ada/sdefault.adb ada/stamp-sdefault ada/stamp-snames
-$(RMDIR) ada/tools -$(RMDIR) ada/tools
-$(RMDIR) ada/libgnat
-$(RM) gnatbind$(exeext) gnat1$(exeext) -$(RM) gnatbind$(exeext) gnat1$(exeext)
ada.clean: ada.clean:
ada.distclean: ada.distclean:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment