]> xenbits.xensource.com Git - people/liuw/stubdom.git/commitdiff
stubdom: add C example target
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 19 Mar 2008 16:21:39 +0000 (16:21 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 19 Mar 2008 16:21:39 +0000 (16:21 +0000)
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Makefile
c/Makefile [new file with mode: 0644]
c/main.c [new file with mode: 0644]

index 7fdcdb22c05ea0d3b87623b28a6276112f1f0ef4..67a76aedff478424118d60403b7905042ecf73c5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -201,6 +201,14 @@ ioemu: cross-zlib cross-libpci mk-symlinks libxc
 caml:
        $(MAKE) -C $@
 
+###
+# C
+###
+
+.PHONY: c
+c:
+       $(MAKE) -C $@
+
 ########
 # minios
 ########
@@ -211,7 +219,11 @@ qemu-stubdom: mk-symlinks lwip-cvs libxc ioemu
 
 .PHONY: caml-stubdom
 caml-stubdom: mk-symlinks lwip-cvs libxc cross-libpci caml
-       $(MAKE) -C mini-os LWIPDIR=$(CURDIR)/lwia-cvs CAMLDIR=$(CURDIR)/caml
+       $(MAKE) -C mini-os LWIPDIR=$(CURDIR)/lwip-cvs CAMLDIR=$(CURDIR)/caml
+
+.PHONY: c-stubdom
+c-stubdom: mk-symlinks lwip-cvs libxc cross-libpci c
+       $(MAKE) -C mini-os LWIPDIR=$(CURDIR)/lwip-cvs CDIR=$(CURDIR)/c
 
 #########
 # install
diff --git a/c/Makefile b/c/Makefile
new file mode 100644 (file)
index 0000000..6262095
--- /dev/null
@@ -0,0 +1,9 @@
+XEN_ROOT = ../..
+
+include $(XEN_ROOT)/Config.mk
+
+main.a: main.o
+       $(AR) cr $@ $^
+
+clean:
+       rm -f *.a *.o
diff --git a/c/main.c b/c/main.c
new file mode 100644 (file)
index 0000000..12288a6
--- /dev/null
+++ b/c/main.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+int main(void) {
+        sleep(2);
+        printf("Hello, world!\n");
+        return 0;
+}