summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-24 04:47:58 -0600
committerJeff Carr <[email protected]>2024-12-24 04:47:58 -0600
commit6169b19c709f504dfc13f197c636d64b7dd57bfb (patch)
tree832b131bbdd620f10445ef25e4dfcede7927bb5c /Makefile
initial somethingv0.0.1
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile83
1 files changed, 83 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..edfedf8
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,83 @@
+VERSION = $(shell git describe --tags)
+GUIVERSION = $(shell git describe --tags)
+BUILDTIME = $(shell date +%Y.%m.%d)
+
+all: go-build
+ @echo "make debian-dry-run # shows what could be packaged"
+ @echo "make debian-build # make .deb files for versions that are missing"
+ @echo "make test-build # test build everything"
+ @echo "make make-install # run 'make install' in each app repo to copy to ~/go/bin"
+ @echo "make list # --list: list packaged apps in the wit repo"
+ @echo "make update # --update: run apt update and apt install on all packages"
+ @echo "make repomap # parse the go.wit.com repomap"
+
+go-build: goimports
+ GO111MODULE=off go build \
+ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
+
+vet:
+ GO111MODULE=off go vet
+
+only-me: go-build
+ ./wit-test --only-me
+
+stderr: go-build
+ echo "writing to /tmp/wit-test.log"
+ ./wit-test >/tmp/wit-test.log 2>&1
+
+goimports:
+ reset
+ goimports -w *.go
+ # // to globally reset paths:
+ # // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go
+
+gocui: go-build
+ ./wit-test --gui gocui >/tmp/wit-test.log 2>&1
+
+install: goimports
+ GO111MODULE=off go install \
+ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
+
+check-git-clean:
+ @git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1)
+
+list: go-build
+ ./wit-test --no-gui --list
+
+pull: go-build
+ ./wit-test --git-pull
+
+update: go-build
+ ./wit-test --apt-update --dry-run
+
+force-build: go-build
+ ./wit-test --force
+
+make-install: install
+ wit-test --no-gui --make-install
+ forge --find-private
+
+test-build: go-build
+ ./wit-test --test-build
+
+make-install-dry-run: go-build
+ ./wit-test --no-gui --make-install --dry-run
+
+protobuf:
+ go-clone go.wit.com/apps/go-clone
+
+debian-dry-run: go-build
+ ./wit-test --no-gui --dry-run --debian
+
+debian-build: go-build
+ ./wit-test --no-gui --debian
+ do-aptly
+
+repomap: go-build
+ ./wit-test --no-gui --repomap /etc/gowebd/repomap
+
+repomap-dryrun: go-build
+ ./wit-test --no-gui --repomap /etc/gowebd/repomap --dry-run
+
+test: go-build
+ ./wit-test --no-gui --make-install --test