I cleaned up the top level makefile in the tools directory. No major changes. Except I have it so that ioemmu is compiled only with x86_32. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> --- tools/Makefile.orig 2005-03-17 21:03:44.000000000 -0600 +++ tools/Makefile 2005-03-22 15:05:20.000000000 -0600 @@ -1,37 +1,33 @@ +XEN_ROOT = ../ +include $(XEN_ROOT)/tools/Rules.mk -all: - $(MAKE) -C check - $(MAKE) -C libxutil - $(MAKE) -C libxc - $(MAKE) -C misc - $(MAKE) -C examples - $(MAKE) -C xentrace - $(MAKE) -C python - $(MAKE) -C xfrd - $(MAKE) -C xcs - $(MAKE) -C ioemu +SUBDIRS :+SUBDIRS += check +SUBDIRS += libxutil +SUBDIRS += libxc +SUBDIRS += misc +SUBDIRS += examples +SUBDIRS += xentrace +SUBDIRS += python +SUBDIRS += xfrd +SUBDIRS += xcs +ifeq ($(XEN_TARGET_ARCH),x86_32) +SUBDIRS += ioemu +endif -install: - $(MAKE) -C check - $(MAKE) -C libxutil install - $(MAKE) -C libxc install - $(MAKE) -C misc install - $(MAKE) -C examples install - $(MAKE) -C xentrace install - $(MAKE) -C python install - $(MAKE) -C xfrd install - $(MAKE) -C sv install - $(MAKE) -C xcs install - $(MAKE) -C ioemu install +.PHONY: all clean install -clean build: - $(MAKE) -C check $@ - $(MAKE) -C libxutil $@ - $(MAKE) -C libxc $@ - $(MAKE) -C misc $@ - $(MAKE) -C examples $@ - $(MAKE) -C xentrace $@ - $(MAKE) -C python $@ - $(MAKE) -C xfrd $@ - $(MAKE) -C xcs clean - $(MAKE) -C ioemu clean +all: + @for subdir in $(SUBDIRS); do \ + $(MAKE) -C $$subdir $@ || exit -1; \ + done + +clean: + @for subdir in $(SUBDIRS); do \ + $(MAKE) -C $$subdir $@ || exit -1; \ + done + +install: + @for subdir in $(SUBDIRS); do \ + $(MAKE) -C $$subdir $@ || exit -1; \ + done -- Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157) ------------------------------------------------------- This SF.net email is sponsored by: 2005 Windows Mobile Application Contest Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones for the chance to win $25,000 and application distribution. Enter today at http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Tue, 22 Mar 2005, Jerone Young wrote:> I cleaned up the top level makefile in the tools directory. No major > changes. Except I have it so that ioemmu is compiled only with x86_32. > > Signed-off-by: Jerone Young <jyoung5@us.ibm.com> > > +all: > + @for subdir in $(SUBDIRS); do \ > + $(MAKE) -C $$subdir $@ || exit -1; \ > + done > + > +clean: > + @for subdir in $(SUBDIRS); do \ > + $(MAKE) -C $$subdir $@ || exit -1; \ > + done > + > +install: > + @for subdir in $(SUBDIRS); do \ > + $(MAKE) -C $$subdir $@ || exit -1; \ > + doneDon''t do it like this. make -j won''t work. Besides, don''t use || exit. Instead, use set -e. ------------------------------------------------------- This SF.net email is sponsored by: 2005 Windows Mobile Application Contest Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones for the chance to win $25,000 and application distribution. Enter today at http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Jerone Young
2005-Mar-22 21:46 UTC
Re: [Xen-devel] [PATCH] tools top level makefile cleanup
On Tue, 2005-03-22 at 15:33 -0600, Adam Heath wrote:> On Tue, 22 Mar 2005, Jerone Young wrote: > > > I cleaned up the top level makefile in the tools directory. No major > > changes. Except I have it so that ioemmu is compiled only with x86_32. > > > > Signed-off-by: Jerone Young <jyoung5@us.ibm.com> > > > > +all: > > + @for subdir in $(SUBDIRS); do \ > > + $(MAKE) -C $$subdir $@ || exit -1; \ > > + done > > + > > +clean: > > + @for subdir in $(SUBDIRS); do \ > > + $(MAKE) -C $$subdir $@ || exit -1; \ > > + done > > + > > +install: > > + @for subdir in $(SUBDIRS); do \ > > + $(MAKE) -C $$subdir $@ || exit -1; \ > > + done > > Don''t do it like this. make -j won''t work.Hmm...I mainly did this to clean up things for development purposes. I don''t know if everyone cares all that much about the using the -j option with building the tools (maybe..someone speakup!). It really does not take anytime now to build them without it. Also you have to build libxutil & libxc first so your not going to get a huge performance increase because everything is dependent on these getting built first.> > Besides, don''t use || exit. Instead, use set -e.We want the build to die (with extreme prejudice :-) ) if something does not go right.>-- Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157) ------------------------------------------------------- This SF.net email is sponsored by: 2005 Windows Mobile Application Contest Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones for the chance to win $25,000 and application distribution. Enter today at http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Jerone Young
2005-Mar-22 22:14 UTC
RE: [Xen-devel] [PATCH] tools top level makefile cleanup
Oh .. I though this was only required for vmx support. Well time to fix ioemmu too :-). On Tue, 2005-03-22 at 14:18 -0800, Nakajima, Jun wrote:> Jerone Young wrote: > > I cleaned up the top level makefile in the tools directory. No major > > changes. Except I have it so that ioemmu is compiled only with x86_32. > > > > Signed-off-by: Jerone Young <jyoung5@us.ibm.com> > > > We need to build eiomu for x86_64 as well. > > Jun >-- Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157) ------------------------------------------------------- This SF.net email is sponsored by: 2005 Windows Mobile Application Contest Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones for the chance to win $25,000 and application distribution. Enter today at http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Nakajima, Jun
2005-Mar-22 22:18 UTC
RE: [Xen-devel] [PATCH] tools top level makefile cleanup
Jerone Young wrote:> I cleaned up the top level makefile in the tools directory. No major > changes. Except I have it so that ioemmu is compiled only with x86_32. > > Signed-off-by: Jerone Young <jyoung5@us.ibm.com> >We need to build eiomu for x86_64 as well. Jun ------------------------------------------------------- This SF.net email is sponsored by: 2005 Windows Mobile Application Contest Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones for the chance to win $25,000 and application distribution. Enter today at http://ads.osdn.com/?ad_idh82&alloc_id148&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Nakajima, Jun
2005-Mar-22 22:25 UTC
RE: [Xen-devel] [PATCH] tools top level makefile cleanup
Jerone Young wrote:> Oh .. I though this was only required for vmx support. Well time to > fix ioemmu too :-). >VMX is available on 64-bit systems. Jun> On Tue, 2005-03-22 at 14:18 -0800, Nakajima, Jun wrote: >> Jerone Young wrote: >>> I cleaned up the top level makefile in the tools directory. No major >>> changes. Except I have it so that ioemmu is compiled only with >>> x86_32. >>> >>> Signed-off-by: Jerone Young <jyoung5@us.ibm.com> >>> >> We need to build eiomu for x86_64 as well. >> >> Jun------------------------------------------------------- This SF.net email is sponsored by: 2005 Windows Mobile Application Contest Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones for the chance to win $25,000 and application distribution. Enter today at http://ads.osdn.com/?ad_idh82&alloc_id148&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Tue, 22 Mar 2005, Jerone Young wrote:> On Tue, 2005-03-22 at 15:33 -0600, Adam Heath wrote: > > On Tue, 22 Mar 2005, Jerone Young wrote: > > > > > I cleaned up the top level makefile in the tools directory. No major > > > changes. Except I have it so that ioemmu is compiled only with x86_32. > > > > > > Signed-off-by: Jerone Young <jyoung5@us.ibm.com> > > > > > > +all: > > > + @for subdir in $(SUBDIRS); do \ > > > + $(MAKE) -C $$subdir $@ || exit -1; \ > > > + done > > > + > > > +clean: > > > + @for subdir in $(SUBDIRS); do \ > > > + $(MAKE) -C $$subdir $@ || exit -1; \ > > > + done > > > + > > > +install: > > > + @for subdir in $(SUBDIRS); do \ > > > + $(MAKE) -C $$subdir $@ || exit -1; \ > > > + done > > > > Don''t do it like this. make -j won''t work. > Hmm...I mainly did this to clean up things for development purposes. I > don''t know if everyone cares all that much about the using the -j option > with building the tools (maybe..someone speakup!). It really does not > take anytime now to build them without it. Also you have to build > libxutil & libxc first so your not going to get a huge performance > increase because everything is dependent on these getting built first.=install: $(patsubst %,install.%,$(SUBDIRS)) $(patsubst %,install.%,$(SUBDIRS)): install.%: CMD := install all: $(patsubst %,all.%,$(SUBDIRS)) $(patsubst %,all.%,$(SUBDIRS)): all.%: CMD := all $(foreach cmd,all install,$(patsubst %,$(cmd).%,$(SUBDIRS))): $(MAKE) -C $* $(CMD) = Adding more commands is left as an exercise, as is converting the first 2 lines into a multi-line variable(ie, define).> > Besides, don''t use || exit. Instead, use set -e. > We want the build to die (with extreme prejudice :-) ) if something does > not go right.Yes, of course. But if you have an error in the definition of SUBDIRS(empty, or bad quote char), then your shell line may not error out. Using set -e is the preferred approach. Generally, like: @set -e; for .... \ ....; \ done Or: SHELL += -e ------------------------------------------------------- This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Hollis Blanchard
2005-Mar-23 20:15 UTC
Re: [Xen-devel] [PATCH] tools top level makefile cleanup
On Wednesday 23 March 2005 12:01, Adam Heath wrote:> install: $(patsubst %,install.%,$(SUBDIRS)) > $(patsubst %,install.%,$(SUBDIRS)): install.%: CMD := install > > all: $(patsubst %,all.%,$(SUBDIRS)) > $(patsubst %,all.%,$(SUBDIRS)): all.%: CMD := all > > $(foreach cmd,all install,$(patsubst %,$(cmd).%,$(SUBDIRS))): > $(MAKE) -C $* $(CMD)The following is working for me and I think easier to read than the above: =CLEANDIRS := $(addprefix _clean_,$(SUBDIRS)) .PHONY: all clean $(SUBDIRS) $(CLEANDIRS) all: $(SUBDIRS) clean: $(CLEANDIRS) $(CLEANDIRS): $(MAKE) -C $(patsubst _clean_%,%,$@) clean $(SUBDIRS): $(MAKE) -C $@ = Well, I guess it''s not very dissimilar after all. But I really don''t like that for every command to recurse with (e.g. clean), you must add more hackery to the Makefile. Your snippet has the same problem (let''s add "clean"...), and it seems all the Makefiles have all the issues discussed in different places. Is there really no better way to solve this problem? -- Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------- This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Jerone Young
2005-Mar-23 20:41 UTC
Re: [Xen-devel] [PATCH] tools top level makefile cleanup
Hmmm.. one cheap way to get around this and keep things nice for cross compiling is to to include thek Rules.mk file at the top level of the tools directory and have something like ifeq ($(XEN_TARGET_ARCH),x86_32) LDLIBS= $(BXLIBS) -L/usr/X11R6/lib -lX11 -lXpm -lstdc++ - L ../../../tools/libxc -L ../../../tools/libxutil -lxc -lxutil -lpthread -lncurses_32) endif ifeq ($(XEN_TARGET_ARCH),x86_64) DLIBS= $(BXLIBS) -L/usr/X11R6/lib64 -lX11 -lXpm -lstdc++ - L ../../../tools/libxc -L ../../../tools/libxutil -lxc -lxutil -lpthread -lncurses endif This is cheap and easy way to get around the problem. On Tue, 2005-03-22 at 15:00 -0800, Arun Sharma wrote:> On 3/22/2005 1:10 PM, Jerone Young wrote: > > I cleaned up the top level makefile in the tools directory. No major > > changes. Except I have it so that ioemmu is compiled only with x86_32. > > > > Signed-off-by: Jerone Young <jyoung5@us.ibm.com> > > We''ve been using the attached patch internally. The patch breaks x86_32. I''d appreciate help from someone who groks makefiles better than I do in fixing up the lib vs lib64 part. > > -Arun > plain text document attachment (ioemu-x86-64.patch) > ===== tools/ioemu/iodev/Makefile 1.4 vs edited ====> --- 1.4/tools/ioemu/iodev/Makefile 2005-02-14 16:54:33 -08:00 > +++ edited/tools/ioemu/iodev/Makefile 2005-03-22 14:51:13 -08:00 > @@ -2,7 +2,7 @@ > CXXFLAGS=-I. -I../include -I.. > OBJS=$(patsubst %.cc,%.o,$(wildcard *.cc)) > BXLIBS = ../gui/libgui.a ../memory/libmemory.a > -LDLIBS= $(BXLIBS) -L/usr/X11R6/lib -lX11 -lXpm -lstdc++ -L ../../../tools/libxc -L ../../../tools/libxutil -lxc -lxutil -lpthread -lncurses > +LDLIBS= $(BXLIBS) -L/usr/X11R6/lib64 -lX11 -lXpm -lstdc++ -L ../../../tools/libxc -L ../../../tools/libxutil -lxc -lxutil -lpthread -lncurses > > all: device-model > > ===== tools/ioemu/iodev/cpu.cc 1.6 vs edited ====> --- 1.6/tools/ioemu/iodev/cpu.cc 2005-02-08 15:57:15 -08:00 > +++ edited/tools/ioemu/iodev/cpu.cc 2005-03-22 14:48:34 -08:00 > @@ -102,20 +102,20 @@ > > for (i = 0; i < req->count; i++) { > tmp = BX_INP(req->addr, req->size); > - BX_MEM_WRITE_PHYSICAL((Bit32u) req->u.pdata + (sign * i * req->size), > + BX_MEM_WRITE_PHYSICAL((dma_addr_t) req->u.pdata + (sign * i * req->size), > req->size, &tmp); > } > } > } else if(req->dir == IOREQ_WRITE) { > if (!req->pdata_valid) { > - BX_OUTP(req->addr, (Bit32u) req->u.data, req->size); > + BX_OUTP(req->addr, (dma_addr_t) req->u.data, req->size); > } else { > for (i = 0; i < req->count; i++) { > unsigned long tmp; > > - BX_MEM_READ_PHYSICAL((Bit32u) req->u.pdata + (sign * i * req->size), req->size, > + BX_MEM_READ_PHYSICAL((dma_addr_t) req->u.pdata + (sign * i * req->size), req->size, > &tmp); > - BX_OUTP(req->addr, (Bit32u) tmp, req->size); > + BX_OUTP(req->addr, (dma_addr_t) tmp, req->size); > } > } > > @@ -133,12 +133,12 @@ > //BX_INFO(("<READ>addr:%llx, pdata:%llx, size: %x, count: %x\n", req->addr, req->u.pdata, req->size, req->count)); > for (i = 0; i < req->count; i++) { > BX_MEM_READ_PHYSICAL(req->addr + (sign * i * req->size), req->size, &tmp); > - BX_MEM_WRITE_PHYSICAL((Bit32u) req->u.pdata + (sign * i * req->size), req->size, &tmp); > + BX_MEM_WRITE_PHYSICAL((dma_addr_t) req->u.pdata + (sign * i * req->size), req->size, &tmp); > } > } else if (req->dir == IOREQ_WRITE) { > //BX_INFO(("<WRITE>addr:%llx, pdata:%llx, size: %x, count: %x\n", req->addr, req->u.pdata, req->size, req->count)); > for (i = 0; i < req->count; i++) { > - BX_MEM_READ_PHYSICAL((Bit32u)req->u.pdata + (sign * i * req->size), req->size, &tmp); > + BX_MEM_READ_PHYSICAL((dma_addr_t)req->u.pdata + (sign * i * req->size), req->size, &tmp); > BX_MEM_WRITE_PHYSICAL(req->addr + (sign * i * req->size), req->size, &tmp); > } > } > @@ -245,6 +245,7 @@ > } > } > > +#ifdef __i386__ > static __inline__ void set_bit(long nr, volatile void *addr) > { > __asm__ __volatile__( "lock ; " > @@ -254,6 +255,18 @@ > > return; > } > +#else > +/* XXX: clean for IPF */ > +static __inline__ void set_bit(long nr, volatile void *addr) > +{ > + __asm__ __volatile__( "lock ; " > + "btsq %1,%0" > + :"=m" ((*(volatile long *)addr)) > + :"Ir" (nr)); > + > + return; > +} > +#endif > > void > bx_cpu_c::interrupt(Bit8u vector) > ===== tools/ioemu/memory/memory.cc 1.1 vs edited ====> --- 1.1/tools/ioemu/memory/memory.cc 2005-01-10 14:19:25 -08:00 > +++ edited/tools/ioemu/memory/memory.cc 2005-03-22 14:48:34 -08:00 > @@ -36,7 +36,7 @@ > #if BX_PROVIDE_CPU_MEMORY > > void BX_CPP_AttrRegparmN(3) > -BX_MEM_C::writePhysicalPage(BX_CPU_C *cpu, Bit32u addr, unsigned len, void *data) > +BX_MEM_C::writePhysicalPage(BX_CPU_C *cpu, dma_addr_t addr, unsigned len, void *data) > { > Bit8u *data_ptr; > Bit32u a20addr; > @@ -235,7 +235,7 @@ > > > void BX_CPP_AttrRegparmN(3) > -BX_MEM_C::readPhysicalPage(BX_CPU_C *cpu, Bit32u addr, unsigned len, void *data) > +BX_MEM_C::readPhysicalPage(BX_CPU_C *cpu, dma_addr_t addr, unsigned len, void *data) > { > Bit8u *data_ptr; > Bit32u a20addr; > ===== tools/ioemu/memory/memory.h 1.1 vs edited ====> --- 1.1/tools/ioemu/memory/memory.h 2005-01-10 14:19:25 -08:00 > +++ edited/tools/ioemu/memory/memory.h 2005-03-22 14:48:35 -08:00 > @@ -37,6 +37,12 @@ > # define BX_MEM_THIS this-> > #endif > > +#if defined(__i386__) > +typedef Bit32u dma_addr_t; > +#elif defined(__x86_64__) > +typedef Bit64u dma_addr_t; > +#endif > + > // alignment of memory vector, must be a power of 2 > #define BX_MEM_VECTOR_ALIGN 4096 > > @@ -64,9 +70,9 @@ > ~BX_MEM_C(void); > BX_MEM_SMF void alloc_vector_aligned (size_t bytes, size_t alignment) BX_CPP_AttrRegparmN(2); > BX_MEM_SMF void init_memory(int memsize); > - BX_MEM_SMF void readPhysicalPage(BX_CPU_C *cpu, Bit32u addr, > + BX_MEM_SMF void readPhysicalPage(BX_CPU_C *cpu, dma_addr_t addr, > unsigned len, void *data) BX_CPP_AttrRegparmN(3); > - BX_MEM_SMF void writePhysicalPage(BX_CPU_C *cpu, Bit32u addr, > + BX_MEM_SMF void writePhysicalPage(BX_CPU_C *cpu, dma_addr_t addr, > unsigned len, void *data) BX_CPP_AttrRegparmN(3); > BX_MEM_SMF void load_ROM(const char *path, Bit32u romaddress, Bit8u type); > BX_MEM_SMF Bit32u get_memory_in_k(void);-- Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157) ------------------------------------------------------- This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Anthony Liguori
2005-Mar-23 20:48 UTC
Re: [Xen-devel] [PATCH] tools top level makefile cleanup
Hollis Blanchard wrote:>Well, I guess it''s not very dissimilar after all. > >But I really don''t like that for every command to recurse with (e.g. clean), >you must add more hackery to the Makefile. Your snippet has the same problem >(let''s add "clean"...), and it seems all the Makefiles have all the issues >discussed in different places. > >Is there really no better way to solve this problem? > >The following works for me. You need a default rule or else make gets really confused but the wildcard rule will catch everything else. SUBDIRS=sub sub1 all: @for i in $(SUBDIRS); do \ $(MAKE) -C $$i $@; \ done %: @for i in $(SUBDIRS); do \ $(MAKE) -C $$i $@; \ done ------------------------------------------------------- This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Hollis Blanchard
2005-Mar-23 20:57 UTC
Re: [Xen-devel] [PATCH] tools top level makefile cleanup
On Wednesday 23 March 2005 14:48, Anthony Liguori wrote:> Hollis Blanchard wrote: > > > >But I really don''t like that for every command to recurse with (e.g. > > clean), you must add more hackery to the Makefile. Your snippet has the > > same problem (let''s add "clean"...), and it seems all the Makefiles have > > all the issues discussed in different places. > > > >Is there really no better way to solve this problem? > > The following works for me. You need a default rule or else make gets > really confused but the wildcard rule will catch everything else. > > SUBDIRS=sub sub1 > > all: > @for i in $(SUBDIRS); do \ > $(MAKE) -C $$i $@; \ > done > > %: > @for i in $(SUBDIRS); do \ > $(MAKE) -C $$i $@; \ > doneBut the for loop was the original approach, and Adam described two problems with it: 1. errors in a sub-make will be ignored 2. the sub-makes cannot be parallelized -- Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------- This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Christian Limpach
2005-Mar-23 21:11 UTC
Re: [Xen-devel] [PATCH] tools top level makefile cleanup
On Tue, 22 Mar 2005 15:10:21 -0600, Jerone Young <jyoung5@us.ibm.com> wrote:> I cleaned up the top level makefile in the tools directory. No major > changes. Except I have it so that ioemmu is compiled only with x86_32.I think the change below changes the behaviour:> +SUBDIRS :> +SUBDIRS += check...> -install: > - $(MAKE) -C check > - $(MAKE) -C libxutil install...> +install: > + @for subdir in $(SUBDIRS); do \ > + $(MAKE) -C $$subdir $@ || exit -1; \ > + doneYou''re calling ``make -C check install'''' while we want to call ``make -C check''''. See the comments in tools/check/Makefile why we want this... # Check this machine is OK for installing on. # DO NOT use this check from ''make install'' in the parent # directory, as that target can be used to make an installable # copy rather than actually installing. At least you didn''t try to go down the insane "try to make everything build in parallel" road, it might work for the tools but you need to be careful to make sure that targets which other targets depend on get built first. None of the fancy Makefile tricks which other people have posted seem to take this into account :-( christian ------------------------------------------------------- This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Hollis Blanchard
2005-Mar-23 21:17 UTC
Re: [Xen-devel] [PATCH] tools top level makefile cleanup
On Wednesday 23 March 2005 15:11, Christian Limpach wrote:> At least you didn''t try to go down the insane "try to make everything > build in parallel" road, it might work for the tools but you need to > be careful to make sure that targets which other targets depend on get > built first. None of the fancy Makefile tricks which other people > have posted seem to take this into account :-(That is explicitly described in the GNU make manual; see the "foo: baz" line here: http://www.gnu.org/software/make/manual/html_chapter/make_4.html#SEC41 So that seems to be a very small problem... -- Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------- This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Christian Limpach
2005-Mar-23 22:35 UTC
Re: [Xen-devel] [PATCH] tools top level makefile cleanup
On Wed, 23 Mar 2005 15:17:53 -0600, Hollis Blanchard <hollisb@us.ibm.com> wrote:> On Wednesday 23 March 2005 15:11, Christian Limpach wrote: > > At least you didn''t try to go down the insane "try to make everything > > build in parallel" road, it might work for the tools but you need to > > be careful to make sure that targets which other targets depend on get > > built first. None of the fancy Makefile tricks which other people > > have posted seem to take this into account :-( > > That is explicitly described in the GNU make manual; see the "foo: baz" line > here: > http://www.gnu.org/software/make/manual/html_chapter/make_4.html#SEC41 > > So that seems to be a very small problem...I know how Makefile dependencies work, thank you. The point I was trying to make was that all the sophisticated Makefile solutions to support parallel builds are nice, but they are useless to us unless someone provides a complete patch which includes correct dependency handling. I like the original patch (except for the small check install oversight), since it''s simple and I can convince myself that it is correct. I''m not sure it is needed right now though. One example would be that it has the potential to break patches applied when building packages. christian ------------------------------------------------------- This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Jimi Xenidis
2005-Mar-24 14:56 UTC
Re: [Xen-devel] [PATCH] tools top level makefile cleanup
>>>>> "JY" == Jerone Young <jyoung5@us.ibm.com> writes:JY> ifeq ($(XEN_TARGET_ARCH),x86_32) JY> LDLIBS= $(BXLIBS) -L/usr/X11R6/lib -lX11 -lXpm -lstdc++ - JY> L ../../../tools/libxc -L ../../../tools/libxutil -lxc -lxutil -lpthread JY> -lncurses_32) JY> endif JY> ifeq ($(XEN_TARGET_ARCH),x86_64) JY> DLIBS= $(BXLIBS) -L/usr/X11R6/lib64 -lX11 -lXpm -lstdc++ - JY> L ../../../tools/libxc -L ../../../tools/libxutil -lxc -lxutil -lpthread JY> -lncurses JY> endif hmm in the interest of exploiting commonality, perhaps x86_32_LDPATH = -L/usr/X11R6/lib x86_32_CURSES = -lncurses_32 x86_64_LDPATH = -L/usr/X11R6/lib64 x86_64_CURSES = -lncurses LDLIBS= $(BXLIBS) $($(XEN_TARGET_ARCH)_LDPATH) -lX11 -lXpm -lstdc++ -L../../../tools/libxc -L../../../tools/libxutil -lxc -lxutil -lpthread $($(XEN_TARGET_ARCH)_CURSES) The cool part of this is that you could locate the arch specific defines in arch specific Rules.mk (or rather Defines.mk?) -JX ------------------------------------------------------- This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Wed, 23 Mar 2005, Hollis Blanchard wrote:> On Wednesday 23 March 2005 12:01, Adam Heath wrote: > > install: $(patsubst %,install.%,$(SUBDIRS)) > > $(patsubst %,install.%,$(SUBDIRS)): install.%: CMD := install > > > > all: $(patsubst %,all.%,$(SUBDIRS)) > > $(patsubst %,all.%,$(SUBDIRS)): all.%: CMD := all > > > > $(foreach cmd,all install,$(patsubst %,$(cmd).%,$(SUBDIRS))): > > $(MAKE) -C $* $(CMD) > > The following is working for me and I think easier to read than the above: > => CLEANDIRS := $(addprefix _clean_,$(SUBDIRS)) > > .PHONY: all clean $(SUBDIRS) $(CLEANDIRS) > > all: $(SUBDIRS) > clean: $(CLEANDIRS) > > $(CLEANDIRS): > $(MAKE) -C $(patsubst _clean_%,%,$@) clean > > $(SUBDIRS): > $(MAKE) -C $@ > => > Well, I guess it''s not very dissimilar after all. > > But I really don''t like that for every command to recurse with (e.g. clean), > you must add more hackery to the Makefile. Your snippet has the same problem > (let''s add "clean"...), and it seems all the Makefiles have all the issues > discussed in different places. > > Is there really no better way to solve this problem?=define subdir.command $(1)_targets := $$(addprefix $(1).,$$(SUBDIRS)) $(1): $$($(1)_targets) $$($(1)_targets): $(1).%: CMD := $(1) $(MAKE) -C $* $(CMD) endef $(eval subdir.command,install) $(eval subdir.command,clean) = I''ve not verified if the above works; ie, the quoting of $ in the multi-line variable. eval is a gnumake extension, so may not work elsewhere. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Wed, 23 Mar 2005, Anthony Liguori wrote:> The following works for me. You need a default rule or else make gets > really confused but the wildcard rule will catch everything else. > > SUBDIRS=sub sub1 > > all: > @for i in $(SUBDIRS); do \ > $(MAKE) -C $$i $@; \ > done > > %: > @for i in $(SUBDIRS); do \ > $(MAKE) -C $$i $@; \ > doneNo, that won''t work, as if the sub-makes fail, the shell loop doesn''t stop(hint, use set -e). Also, it breaks -j. Please go back and reread the previous mails. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Wed, 23 Mar 2005, Christian Limpach wrote:> On Tue, 22 Mar 2005 15:10:21 -0600, Jerone Young <jyoung5@us.ibm.com> wrote: > > I cleaned up the top level makefile in the tools directory. No major > > changes. Except I have it so that ioemmu is compiled only with x86_32. > > I think the change below changes the behaviour: > > > +SUBDIRS :> > +SUBDIRS += check > ... > > -install: > > - $(MAKE) -C check > > - $(MAKE) -C libxutil install > ... > > +install: > > + @for subdir in $(SUBDIRS); do \ > > + $(MAKE) -C $$subdir $@ || exit -1; \ > > + done > > You''re calling ``make -C check install'''' while we want to call ``make > -C check''''. See the comments in tools/check/Makefile why we want > this... > # Check this machine is OK for installing on. > # DO NOT use this check from ''make install'' in the parent > # directory, as that target can be used to make an installable > # copy rather than actually installing. > > At least you didn''t try to go down the insane "try to make everything > build in parallel" road, it might work for the tools but you need to > be careful to make sure that targets which other targets depend on get > built first. None of the fancy Makefile tricks which other people > have posted seem to take this into account :-(=install: check @whatever way people want to recurse check: $(MAKE) -C check # check is a real subdir, so we need to make it PHONY; otherwise, make assumes # it''s uptodate, and the command won''t be run. .PHONY: check = I originally didn''t comment on this, as it wasn''t my focus. But yes, if you are going to replace a set of rules, make certain they do the same thing after as they did before. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Wed, 23 Mar 2005, Hollis Blanchard wrote:> On Wednesday 23 March 2005 14:48, Anthony Liguori wrote: > > Hollis Blanchard wrote: > > > > > >But I really don''t like that for every command to recurse with (e.g. > > > clean), you must add more hackery to the Makefile. Your snippet has the > > > same problem (let''s add "clean"...), and it seems all the Makefiles have > > > all the issues discussed in different places. > > > > > >Is there really no better way to solve this problem? > > > > The following works for me. You need a default rule or else make gets > > really confused but the wildcard rule will catch everything else. > > > > SUBDIRS=sub sub1 > > > > all: > > @for i in $(SUBDIRS); do \ > > $(MAKE) -C $$i $@; \ > > done > > > > %: > > @for i in $(SUBDIRS); do \ > > $(MAKE) -C $$i $@; \ > > done > > But the for loop was the original approach, and Adam described two problems > with it: > 1. errors in a sub-make will be ignored > 2. the sub-makes cannot be parallelizedI''ve done fancy make stuff for years. It''s what eventually made me write jmake(pure java implementation of most of gnu-make; just need to resolve the dependency tree). Hand-written parser, function/expression, implicit rules. It can currently parse the entire 2.6 kernel build system. I need to release it. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel