some docs in the Makefile and removing a prefix that isn't needed.
This commit is contained in:
		@@ -1,10 +1,20 @@
 | 
				
			|||||||
# This Makefile is used by the developer. It is not needed in any way to build
 | 
					# This Makefile is used by the developer. It is not needed in any way to build
 | 
				
			||||||
# a checkout of the XGB repository.
 | 
					# a checkout of the XGB repository.
 | 
				
			||||||
# It will be useful, however, if you are hacking at the code generator.
 | 
					# 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.
 | 
				
			||||||
XPROTO=/usr/share/xcb
 | 
					XPROTO=/usr/share/xcb
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# All of the XML files in my /usr/share/xcb directory EXCEPT XKB. -_-
 | 
					# 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 \
 | 
					all: build-xgbgen \
 | 
				
			||||||
		 bigreq.xml composite.xml damage.xml dpms.xml dri2.xml \
 | 
							 bigreq.xml composite.xml damage.xml dpms.xml dri2.xml \
 | 
				
			||||||
		 ge.xml glx.xml randr.xml record.xml render.xml res.xml \
 | 
							 ge.xml glx.xml randr.xml record.xml render.xml res.xml \
 | 
				
			||||||
@@ -16,6 +26,7 @@ all: build-xgbgen \
 | 
				
			|||||||
build-xgbgen:
 | 
					build-xgbgen:
 | 
				
			||||||
	(cd xgbgen && go build)
 | 
						(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 \
 | 
					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 sync.b xcmisc.b \
 | 
										 record.b render.b res.b screensaver.b shape.b shm.b sync.b xcmisc.b \
 | 
				
			||||||
					 xevie.b xf86dri.b xf86vidmode.b xfixes.b xinerama.b xinput.b \
 | 
										 xevie.b xf86dri.b xf86vidmode.b xfixes.b xinerama.b xinput.b \
 | 
				
			||||||
@@ -24,6 +35,8 @@ build-all: bigreq.b composite.b damage.b dpms.b dri2.b ge.b glx.b randr.b \
 | 
				
			|||||||
%.b:
 | 
					%.b:
 | 
				
			||||||
	(cd $* ; go build)
 | 
						(cd $* ; go build)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 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
 | 
					xc_misc.xml: build-xgbgen
 | 
				
			||||||
	mkdir -p xcmisc
 | 
						mkdir -p xcmisc
 | 
				
			||||||
	xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/xc_misc.xml > xcmisc/xcmisc.go
 | 
						xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/xc_misc.xml > xcmisc/xcmisc.go
 | 
				
			||||||
@@ -32,14 +45,20 @@ xc_misc.xml: build-xgbgen
 | 
				
			|||||||
	mkdir -p $*
 | 
						mkdir -p $*
 | 
				
			||||||
	xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/$*.xml > $*/$*.go
 | 
						xgbgen/xgbgen --proto-path $(XPROTO) $(XPROTO)/$*.xml > $*/$*.go
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Just test the xproto core protocol for now.
 | 
				
			||||||
test:
 | 
					test:
 | 
				
			||||||
	(cd xproto ; go test)
 | 
						(cd xproto ; go test)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Force all xproto benchmarks to run and no tests.
 | 
				
			||||||
bench:
 | 
					bench:
 | 
				
			||||||
	(cd xproto ; go test -run 'nomatch' -bench '.*' -cpu 1,2,6)
 | 
						(cd xproto ; go test -run 'nomatch' -bench '.*' -cpu 1,2,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:
 | 
				
			||||||
	gofmt -w *.go xgbgen/*.go examples/*.go examples/*/*.go
 | 
						gofmt -w *.go xgbgen/*.go examples/*.go examples/*/*.go xproto/xproto_test.go
 | 
				
			||||||
	colcheck xgbgen/*.go examples/*.go examples/*/*.go xproto/xproto_test.go \
 | 
						colcheck *.go xgbgen/*.go examples/*.go examples/*/*.go xproto/xproto_test.go
 | 
				
			||||||
					 auth.go conn.go cookie.go doc.go xgb.go xgb_help.go
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user