Skip to content

Instantly share code, notes, and snippets.

@lhchavez
Created June 15, 2018 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lhchavez/76de670d1710c2bc59dd0980914ef2ae to your computer and use it in GitHub Desktop.
Save lhchavez/76de670d1710c2bc59dd0980914ef2ae to your computer and use it in GitHub Desktop.
quark Makefile
golangfiles:=$(shell find src/github.com/omegaup/quark -name '*.go')
assetfiles:=$(shell find src/github.com/omegaup/quark/cmd/omegaup-grader/data/dist)
all: bin/omegaup-grader bin/omegaup-broadcaster bin/omegaup-runner
bin/go-bindata:
go get -u github.com/jteeuwen/go-bindata/...
bin/golint:
go get -u golang.org/x/lint/golint
src/github.com/omegaup/quark:
go get -d github.com/libgit2/git2go
(cd src/github.com/libgit2/git2go && ./script/build-libgit2-static.sh)
go get -tags static github.com/omegaup/quark/...
src/github.com/omegaup/quark/cmd/omegaup-grader/bindata.go: $(assetfiles) | bin/go-bindata src/github.com/omegaup/quark
PATH=$(PATH):$(PWD)/bin go generate github.com/omegaup/quark/cmd/omegaup-grader
bin/omegaup-grader: $(golangfiles) src/github.com/omegaup/quark/cmd/omegaup-grader/bindata.go
go install -tags static github.com/omegaup/quark/cmd/omegaup-grader
sudo unlink /usr/bin/omegaup-grader
sudo cp bin/omegaup-grader /usr/bin/omegaup-grader
sudo systemctl restart omegaup-grader
bin/omegaup-broadcaster: $(golangfiles)
go install -tags static github.com/omegaup/quark/cmd/omegaup-broadcaster
sudo unlink /usr/bin/omegaup-broadcaster
sudo cp bin/omegaup-broadcaster /usr/bin/omegaup-broadcaster
sudo systemctl restart omegaup-broadcaster
bin/omegaup-runner: $(golangfiles)
go install -tags static github.com/omegaup/quark/cmd/omegaup-runner
sudo unlink /usr/bin/omegaup-runner
sudo cp bin/omegaup-runner /usr/bin/omegaup-runner
sudo systemctl restart omegaup-runner
.PHONY: coverage
coverage:
sudo chown $(shell whoami) /sys/fs/cgroup/memory/omegajail/
go test -coverprofile=coverage.out -tags static github.com/omegaup/quark/...
go tool cover -html=coverage.out
.PHONY: test
test:
sudo chown $(shell whoami) /sys/fs/cgroup/memory/omegajail/
go test -tags static github.com/omegaup/quark/...
.PHONY: lint
lint: bin/golint
bin/golint github.com/omegaup/quark/...
.PHONY: deploy
deploy: all
cp bin/omegaup-grader bin/omegaup-runner bin/omegaup-broadcaster /vagrant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment