From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH ARM v8 3/4] mini-os: arm: build system Date: Tue, 21 Oct 2014 12:44:27 +0100 Message-ID: <1413891867.23337.26.camel@citrix.com> References: <1412328051-20015-1-git-send-email-talex5@gmail.com> <1412328051-20015-4-git-send-email-talex5@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XgXrd-00017x-8L for xen-devel@lists.xenproject.org; Tue, 21 Oct 2014 11:44:33 +0000 In-Reply-To: <1412328051-20015-4-git-send-email-talex5@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Thomas Leonard Cc: Dave.Scott@eu.citrix.com, anil@recoil.org, stefano.stabellini@eu.citrix.com, samuel.thibault@ens-lyon.org, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Fri, 2014-10-03 at 10:20 +0100, Thomas Leonard wrote: > diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile > index 6d6537e..77dc9aa 100644 > --- a/extras/mini-os/Makefile > +++ b/extras/mini-os/Makefile WRT the freeze some of the changes here would appear to also affect x86 builds, which means they need more careful consideration. Konrad CCd. > @@ -51,7 +51,7 @@ flags-$(CONFIG_XENBUS) += -DCONFIG_XENBUS > DEF_CFLAGS += $(flags-y) > > # Symlinks and headers that must be created before building the C files > -GENERATED_HEADERS := include/list.h $(ARCH_LINKS) include/mini-os include/xen include/$(TARGET_ARCH_FAM)/mini-os > +GENERATED_HEADERS := include/list.h $(ARCH_LINKS) include/mini-os include/xen include/$(TARGET_ARCH_FAM)/mini-os include/fdt.h include/libfdt.h > > EXTRA_DEPS += $(GENERATED_HEADERS) > > @@ -75,7 +75,18 @@ EXTRA_OBJS = > TARGET := mini-os > > # Subdirectories common to mini-os > -SUBDIRS := lib xenbus console > +SUBDIRS := lib xenbus console libfdt > + > +FDT_SRC := > +ifeq ($(XEN_TARGET_ARCH),arm32) > +# Need libgcc.a for division helpers Is this the __aeabi_* stuff? Samuel, is this sort of thing OK in mini-os? Usually on the Xen/kernel side we avoid libgcc.a and instead have our own copies of such helpers. I don't recall why, I don't think it is licensing (libgcc has an exception). Possibly just to give some control over what gets included? > +LDLIBS += `$(CC) -print-libgcc-file-name` > + > +# Device tree support > +FDT_SRC := libfdt/fdt.c libfdt/fdt_ro.c libfdt/fdt_strerror.c > + > +src-y += ${FDT_SRC} We would normally use $(FDT_SRC) (TBH I'm not sure what the difference is). > +endif > > src-$(CONFIG_BLKFRONT) += blkfront.c > src-$(CONFIG_TPMFRONT) += tpmfront.c > @@ -97,10 +108,13 @@ src-y += sched.c > src-$(CONFIG_TEST) += test.c > > src-y += lib/ctype.c > +ifneq ($(XEN_TARGET_ARCH),arm32) > src-y += lib/math.c > +endif > src-y += lib/printf.c > src-y += lib/stack_chk_fail.c > src-y += lib/string.c > +src-y += lib/memmove.c > src-y += lib/sys.c > src-y += lib/xmalloc.c > src-$(CONFIG_XENBUS) += lib/xs.c > @@ -125,6 +139,21 @@ $(ARCH_LINKS): > $(arch_links) > endif > > +include/fdt.h: > + cp $(XEN_ROOT)/xen/include/xen/libfdt/fdt.h $@ > + > +include/libfdt.h: > + sed 's!xen/libfdt/!!' $(XEN_ROOT)/xen/include/xen/libfdt/libfdt.h > $@ Should both of these not depend on their input? > + > +libfdt: > + mkdir $@ > + > +libfdt/libfdt_internal.h: libfdt > + cp $(XEN_ROOT)/xen/common/libfdt/libfdt_internal.h $@ > + > +libfdt/%.c: libfdt libfdt/libfdt_internal.h > + cp $(XEN_ROOT)/xen/common/libfdt/$*.c $@ And these too. Would ln -s be better than cp? Or even VPATH tricks? > @@ -202,6 +235,7 @@ clean: arch_clean > rm -f $$dir/*.o; \ > done > rm -f include/list.h > + rm -f ${FDT_SRC} libfdt/libfdt_internal.h $(FDT_SRC) again. Ian.