Skip to contentSkip to conversation

tools/xenlight: Create xenlight Makefile

RFC PATCH New Ronald Rojas 1 participant 1 message Dec 22, 2016

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 tools/xenlight: Create xenlight Makefile

Create a basic Makefile to build and install libxenlight Golang bindings. Also add a stub package.

---

Eventually this patch will contain the actual bindings package; for now it just includes a stub package.

To Do:
- Have configure detect golang bindings properly

CC xen-devel <[email protected]>
CC Ian Jackson <[email protected]>
CC Wei Liu <[email protected]>
CC George Dunlap <[email protected]>
CC George Dunlap <[email protected]>
---
 tools/Makefile                    | 16 ++++++++++++++++
 tools/golang/Makefile             | 29 +++++++++++++++++++++++++++++
 tools/golang/xenlight/xenlight.go |  7 +++++++
 3 files changed, 52 insertions(+)
 create mode 100644 tools/golang/Makefile
 create mode 100644 tools/golang/xenlight/xenlight.go
tools/Makefile +16 -0
index 71515b4..f2198e0 100644
@@ -11,6 +11,8 @@ SUBDIRS-y += misc
 SUBDIRS-y += examples
 SUBDIRS-y += hotplug
 SUBDIRS-y += xentrace
+SUBDIRS-y += golang
+#FIXME: Have golang controlled by a configure variable
 SUBDIRS-$(CONFIG_XCUTILS) += xcutils
 SUBDIRS-$(CONFIG_X86) += firmware
 SUBDIRS-y += console
@@ -311,6 +313,20 @@ subdir-install-debugger/gdbsx: .phony
 subdir-all-debugger/gdbsx: .phony
 	$(MAKE) -C debugger/gdbsx all
 
+subdir-all-golang/xenlight: .phony
+	$(MAKE) -C golang all
+
+subdir-clean-golang/xenlight: .phony
+	$(MAKE) -C golang clean
+
+subdir-install-golang/xenlight: .phony
+	$(MAKE) -C golang install
+
+subdir-build-golang/xenlight: .phony
+	$(MAKE) -C golang build
+
+subdir-distclean-golang/xenlight: .phony
+	$(MAKE) -C golang distclean
 
 subdir-clean-debugger/kdd subdir-distclean-debugger/kdd: .phony
 	$(MAKE) -C debugger/kdd clean
tools/golang/Makefile new file +29 -0
new file mode 100644
index 0000000..96589c8
@@ -0,0 +1,29 @@
+XEN_ROOT=$(CURDIR)/../..
+GOLANG_SRC=$(GOPATH)/src/xenproject.org/xenlight
+include $(XEN_ROOT)/tools/Rules.mk
+
+BINARY = xenlight.a
+GO ?= go
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build: xenlight/xenlight.a
+
+.PHONY: install
+install: build
+	$(INSTALL_DIR) $(DESTDIR)$(GOLANG_SRC)
+	$(INSTALL_DATA) xenlight/xenlight.go $(DESTDIR)$(GOLANG_SRC)
+
+.PHONY: clean
+clean:
+	$(RM) xenlight/$(BINARY)
+
+.PHONY: distclean
+distclean: clean
+
+xenlight/xenlight.a: xenlight/xenlight.go
+	$(GO) build -o $@ $<
+
+-include $(DEPS)
tools/golang/xenlight/xenlight.go new file +7 -0
new file mode 100644
index 0000000..9136676
@@ -0,0 +1,7 @@
+package xenlight
+
+import "fmt"
+
+func main() {
+	fmt.Println("go")
+}
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel