* make clean doesn't run in gdbserver/common
@ 2011-02-22 21:10 Michael Snyder
2011-02-23 3:31 ` Yao Qi
0 siblings, 1 reply; 5+ messages in thread
From: Michael Snyder @ 2011-02-22 21:10 UTC (permalink / raw)
To: gdb, Yao Qi
Hi,
I think gdbserver/Makefile.in needs to be told to run make clean and
make distclean in the common subdir.
Thanks,
Michael
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: make clean doesn't run in gdbserver/common
2011-02-22 21:10 make clean doesn't run in gdbserver/common Michael Snyder
@ 2011-02-23 3:31 ` Yao Qi
2011-02-23 3:36 ` Joel Brobecker
0 siblings, 1 reply; 5+ messages in thread
From: Yao Qi @ 2011-02-23 3:31 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb
[-- Attachment #1: Type: text/plain, Size: 221 bytes --]
On 02/23/2011 05:10 AM, Michael Snyder wrote:
> Hi,
>
> I think gdbserver/Makefile.in needs to be told to run make clean and
> make distclean in the common subdir.
Here is the patch to fix this.
--
Yao (é½å°§)
[-- Attachment #2: gdbserver-make-clean-0223.patch --]
[-- Type: text/x-patch, Size: 1794 bytes --]
gdb/gdbserver/
* Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
(subdir_do): New make target. Copied from gdb/Makefile.
(maintainer-clean, realclean, distclean, clean): Call corresponding
make targets in common/Makefile.
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 07e020f..d27c942 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -136,6 +136,9 @@ LIBCOMMON_DIR = common
LIBCOMMON = $(LIBCOMMON_DIR)/libcommon.a
LIBCOMMON_SRC = $(srcdir)/$(LIBCOMMON_DIR)
+CLEANDIRS = $(LIBCOMMON_DIR)
+REQUIRED_SUBDIRS = $(LIBCOMMON_DIR)
+
SOURCES = $(SFILES)
TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
@@ -291,6 +294,7 @@ TAGS: ${TAGFILES}
tags: TAGS
clean:
+ @$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(CLEANDIRS)" subdir_do
rm -f *.o ${ADD_FILES} *~
rm -f version.c
rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
@@ -314,6 +318,7 @@ clean:
rm -f i386-mmx.c i386-mmx-linux.c
maintainer-clean realclean distclean: clean
+ @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(CLEANDIRS)" subdir_do
rm -f nm.h tm.h xm.h config.status config.h stamp-h config.log
rm -f Makefile
@@ -321,6 +326,22 @@ config.h: stamp-h ; @true
stamp-h: config.in config.status
CONFIG_FILES="" CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
+subdir_do: force
+ @for i in $(DODIRS); do \
+ case $$i in \
+ $(REQUIRED_SUBDIRS)) \
+ if [ ! -f ./$$i/Makefile ] ; then \
+ echo "Missing $$i/Makefile" >&2 ; \
+ exit 1 ; \
+ fi ;; \
+ esac ; \
+ if [ -f ./$$i/Makefile ] ; then \
+ if (cd ./$$i; \
+ $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
+ else exit 1 ; fi ; \
+ else true ; fi ; \
+ done
+
Makefile: Makefile.in config.status
CONFIG_HEADERS="" $(SHELL) ./config.status
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: make clean doesn't run in gdbserver/common
2011-02-23 3:31 ` Yao Qi
@ 2011-02-23 3:36 ` Joel Brobecker
2011-02-23 3:51 ` Yao Qi
0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2011-02-23 3:36 UTC (permalink / raw)
To: Yao Qi; +Cc: Michael Snyder, gdb
> gdb/gdbserver/
>
> * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
> (subdir_do): New make target. Copied from gdb/Makefile.
> (maintainer-clean, realclean, distclean, clean): Call corresponding
> make targets in common/Makefile.
What happens if you do a "make distclean" on a platform where both GDB
& GDBserver get built automatically in one "make"? It looks like we
will first do a distclean in gdb/ first, deleting gdb/common/Makefile,
and then do a distclean in gdbserver/, which will try to do a distclean
a second time in gdb/common, no? The second one will fail due to the
missing Makefile.
--
Joel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: make clean doesn't run in gdbserver/common
2011-02-23 3:36 ` Joel Brobecker
@ 2011-02-23 3:51 ` Yao Qi
2011-02-23 4:29 ` Joel Brobecker
0 siblings, 1 reply; 5+ messages in thread
From: Yao Qi @ 2011-02-23 3:51 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Michael Snyder, gdb
On 02/23/2011 11:36 AM, Joel Brobecker wrote:
> What happens if you do a "make distclean" on a platform where both GDB
> & GDBserver get built automatically in one "make"? It looks like we
> will first do a distclean in gdb/ first, deleting gdb/common/Makefile,
> and then do a distclean in gdbserver/, which will try to do a distclean
> a second time in gdb/common, no? The second one will fail due to the
> missing Makefile.
There are two common dirs in build tree, under gdb/ and gdbserver/
respectively, so it is not a problem to run 'make distclean' on top of
gdb build tree.
When building native gdb, it is redundant here to build libcommon.a for
the same target twice, but given gdb and gdbserver should be built
separately, we have to build libcommon.a separately. Yes, we can think
of a method to build libcommon.a once when building a native gdb.
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: make clean doesn't run in gdbserver/common
2011-02-23 3:51 ` Yao Qi
@ 2011-02-23 4:29 ` Joel Brobecker
0 siblings, 0 replies; 5+ messages in thread
From: Joel Brobecker @ 2011-02-23 4:29 UTC (permalink / raw)
To: Yao Qi; +Cc: Michael Snyder, gdb
> There are two common dirs in build tree, under gdb/ and gdbserver/
> respectively, so it is not a problem to run 'make distclean' on top of
> gdb build tree.
Aha, OK. Thanks for the explanation.
> When building native gdb, it is redundant here to build libcommon.a for
> the same target twice, but given gdb and gdbserver should be built
> separately, we have to build libcommon.a separately. Yes, we can think
> of a method to build libcommon.a once when building a native gdb.
Given that this isn't going to work in the cross case (where gdbserver
is going to be cross-compiled), I am not sure that it's really worth
the effort and/or complication (if any).
--
Joel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-02-23 4:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-22 21:10 make clean doesn't run in gdbserver/common Michael Snyder
2011-02-23 3:31 ` Yao Qi
2011-02-23 3:36 ` Joel Brobecker
2011-02-23 3:51 ` Yao Qi
2011-02-23 4:29 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox