aboutsummaryrefslogtreecommitdiff
path: root/nexgb/Makefile
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2018-09-08 16:54:17 +0200
committerPřemysl Janouch <p@janouch.name>2018-09-08 16:54:17 +0200
commit3173202cc1e08762c6e156a8fffd23269a5ddb2b (patch)
tree95c4a06f8384d41b15e9c22afac0a387de79dc51 /nexgb/Makefile
parent632b3ae494d45755525644fe5d04475c95aae364 (diff)
parent3906399e7c2a40fbaf355de572cf50a314083f64 (diff)
downloadhaven-3173202cc1e08762c6e156a8fffd23269a5ddb2b.tar.gz
haven-3173202cc1e08762c6e156a8fffd23269a5ddb2b.tar.xz
haven-3173202cc1e08762c6e156a8fffd23269a5ddb2b.zip
Merge aarzilli/xgb, branch xcb1.12 as nexgb
History has been linearized and rewritten to stay under the new subdirectory. I want to make changes incompatible to BurntSushi/xgb. The history begs for being thrown away entirely because of its quality and because it doesn't cover the Google period but it is still useful for copyright tracking.
Diffstat (limited to 'nexgb/Makefile')
-rw-r--r--nexgb/Makefile80
1 files changed, 80 insertions, 0 deletions
diff --git a/nexgb/Makefile b/nexgb/Makefile
new file mode 100644
index 0000000..c0ee531
--- /dev/null
+++ b/nexgb/Makefile
@@ -0,0 +1,80 @@
+# This Makefile is used by the developer. It is not needed in any way to build
+# a checkout of the XGB repository.
+# It will be useful, however, if you are hacking at the code generator.
+# i.e., after making a change to the code generator, run 'make' in the
+# xgb directory. This will build xgbgen and regenerate each sub-package.
+# 'make test' will then run any appropriate tests (just tests xproto right now).
+# 'make bench' will test a couple of benchmarks.
+# 'make build-all' will then try to build each extension. This isn't strictly
+# necessary, but it's a good idea to make sure each sub-package is a valid
+# Go package.
+
+# My path to the X protocol XML descriptions.
+ifndef XPROTO
+XPROTO=/usr/share/xcb
+endif
+
+# All of the XML files in my /usr/share/xcb directory EXCEPT XKB. -_-
+# This is intended to build xgbgen and generate Go code for each supported
+# extension.
+all: build-xgbgen \
+ bigreq.xml composite.xml damage.xml dpms.xml dri2.xml \
+ ge.xml glx.xml randr.xml record.xml render.xml res.xml \
+ screensaver.xml shape.xml shm.xml xc_misc.xml \
+ xevie.xml xf86dri.xml xf86vidmode.xml xfixes.xml xinerama.xml \
+ xprint.xml xproto.xml xselinux.xml xtest.xml \
+ xvmc.xml xv.xml
+
+build-xgbgen:
+ (cd xgbgen && go build)
+
+# Builds each individual sub-package to make sure its valid Go code.
+build-all: bigreq.b composite.b damage.b dpms.b dri2.b ge.b glx.b randr.b \
+ record.b render.b res.b screensaver.b shape.b shm.b xcmisc.b \
+ xevie.b xf86dri.b xf86vidmode.b xfixes.b xinerama.b \
+ xprint.b xproto.b xselinux.b xtest.b xv.b xvmc.b
+
+%.b:
+ (cd $* ; go build)
+
+# Installs each individual sub-package.
+install: bigreq.i composite.i damage.i dpms.i dri2.i ge.i glx.i randr.i \
+ record.i render.i res.i screensaver.i shape.i shm.i xcmisc.i \
+ xevie.i xf86dri.i xf86vidmode.i xfixes.i xinerama.i \
+ xprint.i xproto.i xselinux.i xtest.i xv.i xvmc.i
+ go install
+
+%.i:
+ (cd $* ; go install)
+
+# xc_misc is special because it has an underscore.
+# There's probably a way to do this better, but Makefiles aren't my strong suit.
+xc_misc.xml: build-xgbgen
+ mkdir -p xcmisc
+ xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/xc_misc.xml > xcmisc/xcmisc.go
+
+%.xml: build-xgbgen
+ mkdir -p $*
+ xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/$*.xml > $*/$*.go
+
+# Just test the xproto core protocol for now.
+test:
+ (cd xproto ; go test)
+
+# Force all xproto benchmarks to run and no tests.
+bench:
+ (cd xproto ; go test -run 'nomatch' -bench '.*' -cpu 1,2,3,6)
+
+# gofmt all non-auto-generated code.
+# (auto-generated code is already gofmt'd.)
+# Also do a column check (80 cols) after a gofmt.
+# But don't check columns on auto-generated code, since I don't care if they
+# break 80 cols.
+gofmt:
+ gofmt -w *.go xgbgen/*.go examples/*.go examples/*/*.go xproto/xproto_test.go
+ colcheck *.go xgbgen/*.go examples/*.go examples/*/*.go xproto/xproto_test.go
+
+push:
+ git push origin master
+ git push github master
+