summaryrefslogtreecommitdiff
path: root/example/Makefile
blob: 95bb274caad692388fac9b72a605038024787692 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d_%H%M)

all: clean simpleMutexProtoc goimports build
	./example

# if this passes, then autogenpb should be working
# and it is OK to 'go install' the binary
test: testGlobal testProtoc

toy:
	../autogenpb --proto toy.proto --package main

testGlobal:
	make clean
	../autogenpb --proto fruit.proto --package main --mutex=false # first build with a global mutex
	make build

testProtoc:
	make clean
	../autogenpb --proto fruit.proto --package main # inserts mutex into protoc .pb.go file
	make build

help:
	../autogenpb --package main --proto bad.proto

modproto: clean withMutex goimports vet build
	./example

rawproto: clean withoutMutex goimports vet build
	./example

deleteproto: clean
	../autogenpb --proto fruit.proto --package main --delete
	make build

vet:
	@GO111MODULE=off go vet

rawbuild:
	GO111MODULE=off go build -v

build: goimports vet
	GO111MODULE=off go build -v

simpleMutexProtoc: clean
	../autogenpb --proto fruit.proto --package main

# why does this fail to compile? I'm not sure. maybe someone smart can figure it out
# basically, it just trys to return the deleted record but says something
# about the RWmutex lock being copied and GO fails to compile
# I'm don't grok what is going on. This autogenerated code should 
# provide as simple as one could hope for automated way to try to debug it though!
simpleMutexProtocWithDeleteCopy: clean
	../autogenpb --proto fruit.proto --package main --delete

simpleMutexGlobal: clean
	../autogenpb --proto fruit.proto --package main --mutex=false

withMutex: clean
	../autogenpb --proto fruit.proto --package main
	../autogenpb --proto file.proto --package main
	../autogenpb --proto patchset.proto --package main

withoutMutex: clean
	../autogenpb --proto fruit.proto --package main --mutex=false
	../autogenpb --proto file.proto --package main --mutex=false
	../autogenpb --proto patchset.proto --package main --mutex=false

dryrun:
	../autogenpb --proto fruit.proto --package main --dry-run
	# ../autogenpb --proto file.proto --package main

goimports:
	goimports -w *.go

clean:
	-rm -f go.*
	-rm -f *.pb.go
	-rm -f example

# 	pwd /home/jcarr/go/src
#	 0 protoc
#	 1 --go_out=.
#	 2 --proto_path=github.com/google/certificate-transparency-go/trillian/migrillian/configpb
#	 3 --go_opt=Mconfig.proto=github.com/google/certificate-transparency-go/trillian/migrillian/configpb
#	 4 config.proto
#
#
#		--go_opt=Mconfig.proto=github.com/google/certificate-transparency-go/trillian/migrillian/configpb \

protoc-tlog-buildtest-all:
	cd ~/go/src && protoc --go_out=. --proto_path=github.com/google/certificate-transparency-go/trillian/migrillian/configpb \
		--go_opt=Mconfig.proto=github.com/google/certificate-transparency-go/trillian/ctfe/configpb \
		--go_opt=Mtrillian/ctfe/configpb/config.proto=github.com/google/certificate-transparency-go \
		config.proto

protoc-tlog-buildtest-old:
	-protoc --go_out=. --proto_path=github.com/google/certificate-transparency-go/trillian/migrillian/configpb \
		--go_opt=Mconfig.proto=certificate-transparency-go/trillian/migrillian/configpb \
		config.proto

protoc-tlog-buildtest-auto:
	autogenpb --proto config.proto

proto-reformat-restore:
	cp -f Signal-Desktop-Backups.proto.orig signal.proto

proto-reformat-comments:
	../autogenpb --proto signal.proto --format-comments

proto-reformat-full:
	../autogenpb --proto signal.proto --format

proto-reformat-full-debug:
	../autogenpb --proto signal.proto --format --debug

proto-reformat-fruit:
	../autogenpb --proto fruit.proto --format

proto-reformat-fruit-debug:
	../autogenpb --proto fruit.proto --format --debug