ia64/xen-unstable

changeset 17278:edfd0c343b13

stubdom: add C example target

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 19 16:21:39 2008 +0000 (2008-03-19)
parents e69025284832
children 27df0fe73b31
files extras/mini-os/Makefile stubdom/Makefile stubdom/c/Makefile stubdom/c/main.c
line diff
     1.1 --- a/extras/mini-os/Makefile	Wed Mar 19 16:21:01 2008 +0000
     1.2 +++ b/extras/mini-os/Makefile	Wed Mar 19 16:21:39 2008 +0000
     1.3 @@ -88,6 +88,11 @@ OBJS += $(QEMUDIR)/i386-dm-stubdom/qemu.
     1.4  CFLAGS += -DCONFIG_QEMU
     1.5  endif
     1.6  
     1.7 +ifneq ($(CDIR),)
     1.8 +OBJS += $(CDIR)/main.a
     1.9 +LDLIBS += 
    1.10 +endif
    1.11 +
    1.12  ifeq ($(libc),y)
    1.13  LDLIBS += -L$(XEN_ROOT)/stubdom/libxc -lxenctrl -lxenguest
    1.14  LDLIBS += -lpci
    1.15 @@ -95,7 +100,7 @@ LDLIBS += -lz
    1.16  LDLIBS += -lc
    1.17  endif
    1.18  
    1.19 -ifneq ($(caml)-$(qemu)-$(lwip),--y)
    1.20 +ifneq ($(caml)-$(qemu)-$(CDIR)-$(lwip),---y)
    1.21  OBJS := $(filter-out daytime.o, $(OBJS))
    1.22  endif
    1.23  
     2.1 --- a/stubdom/Makefile	Wed Mar 19 16:21:01 2008 +0000
     2.2 +++ b/stubdom/Makefile	Wed Mar 19 16:21:39 2008 +0000
     2.3 @@ -201,6 +201,14 @@ ioemu: cross-zlib cross-libpci mk-symlin
     2.4  caml:
     2.5  	$(MAKE) -C $@
     2.6  
     2.7 +###
     2.8 +# C
     2.9 +###
    2.10 +
    2.11 +.PHONY: c
    2.12 +c:
    2.13 +	$(MAKE) -C $@
    2.14 +
    2.15  ########
    2.16  # minios
    2.17  ########
    2.18 @@ -211,7 +219,11 @@ qemu-stubdom: mk-symlinks lwip-cvs libxc
    2.19  
    2.20  .PHONY: caml-stubdom
    2.21  caml-stubdom: mk-symlinks lwip-cvs libxc cross-libpci caml
    2.22 -	$(MAKE) -C mini-os LWIPDIR=$(CURDIR)/lwia-cvs CAMLDIR=$(CURDIR)/caml
    2.23 +	$(MAKE) -C mini-os LWIPDIR=$(CURDIR)/lwip-cvs CAMLDIR=$(CURDIR)/caml
    2.24 +
    2.25 +.PHONY: c-stubdom
    2.26 +c-stubdom: mk-symlinks lwip-cvs libxc cross-libpci c
    2.27 +	$(MAKE) -C mini-os LWIPDIR=$(CURDIR)/lwip-cvs CDIR=$(CURDIR)/c
    2.28  
    2.29  #########
    2.30  # install
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/stubdom/c/Makefile	Wed Mar 19 16:21:39 2008 +0000
     3.3 @@ -0,0 +1,9 @@
     3.4 +XEN_ROOT = ../..
     3.5 +
     3.6 +include $(XEN_ROOT)/Config.mk
     3.7 +
     3.8 +main.a: main.o
     3.9 +	$(AR) cr $@ $^
    3.10 +
    3.11 +clean:
    3.12 +	rm -f *.a *.o
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/stubdom/c/main.c	Wed Mar 19 16:21:39 2008 +0000
     4.3 @@ -0,0 +1,6 @@
     4.4 +#include <stdio.h>
     4.5 +int main(void) {
     4.6 +        sleep(2);
     4.7 +        printf("Hello, world!\n");
     4.8 +        return 0;
     4.9 +}