This repository has been archived by the owner on Mar 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
82 lines (56 loc) · 2.48 KB
/
Makefile
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
GOFILES=int.go int_test.go int8.go int8_test.go int16.go int16_test.go int32.go int32_test.go int64.go int64_test.go extra.go extra_test.go
GOFILES+=uint.go uint_test.go uint8.go uint8_test.go uint16.go uint16_test.go uint32.go uint32_test.go uint64.go uint64_test.go
GOFILES+=bigint.go bigint_test.go bigrat.go bigrat_test.go
all: gen test cov README.md
test: gen
go test .
cov: test
$(eval TEMP:=$(shell mktemp cover.XXXXXXX))
go test -coverprofile=$(TEMP) .
go tool cover -func=$(TEMP)
rm $(TEMP)
README.md: gen
godoc2md github.com/pkg/math > $@
gen: $(GOFILES)
go fmt $^
int8.go: int.go
sed -e 's/Int/Int8/g' -e 's/int/int8/g' $^ > $@
int16.go: int.go
sed -e 's/Int/Int16/g' -e 's/int/int16/g' $^ > $@
int32.go: int.go
sed -e 's/Int/Int32/g' -e 's/int/int32/g' $^ > $@
int64.go: int.go
sed -e 's/Int/Int64/g' -e 's/int/int64/g' $^ > $@
extra.go: int.go
sed -e 's/Int//g' $^ > $@
extra_test.go: int_test.go
sed -e 's/Int//g' $^ > $@
int8_test.go: int_test.go
sed -e 's/Int/Int8/g' -e 's/int/int8/g' $^ > $@
int16_test.go: int_test.go
sed -e 's/Int/Int16/g' -e 's/int/int16/g' $^ > $@
int32_test.go: int_test.go
sed -e 's/Int/Int32/g' -e 's/int/int32/g' $^ > $@
int64_test.go: int_test.go
sed -e 's/Int/Int64/g' -e 's/int/int64/g' $^ > $@
uint.go: int.go
sed -e 's/Int/Uint/g' -e 's/ int/ uint/g' -e 's/\.int/\.uint/g' -e 's/\]int/\]uint/g' $^ > $@
uint8.go: uint.go
sed -e 's/Uint/Uint8/g' -e 's/ uint/ uint8/g' -e 's/\.uint/\.uint8/g' -e 's/\]uint/\]uint8/g' $^ > $@
uint16.go: uint.go
sed -e 's/Uint/Uint16/g' -e 's/ uint/ uint16/g' -e 's/\.uint/\.uint16/g' -e 's/\]uint/\]uint16/g' $^ > $@
uint32.go: uint.go
sed -e 's/Uint/Uint32/g' -e 's/ uint/ uint32/g' -e 's/\.uint/\.uint32/g' -e 's/\]uint/\]uint32/g' $^ > $@
uint64.go: uint.go
sed -e 's/Uint/Uint64/g' -e 's/ uint/ uint64/g' -e 's/\.uint/\.uint64/g' -e 's/\]uint/\]uint64/g' $^ > $@
uint8_test.go: uint_test.go
sed -e 's/Uint/Uint8/g' -e 's/ uint/ uint8/g' -e 's/\.uint/\.uint8/g' -e 's/\]uint/\]uint8/g' $^ > $@
uint16_test.go: uint_test.go
sed -e 's/Uint/Uint16/g' -e 's/ uint/ uint16/g' -e 's/\.uint/\.uint16/g' -e 's/\]uint/\]uint16/g' $^ > $@
uint32_test.go: uint_test.go
sed -e 's/Uint/Uint32/g' -e 's/ uint/ uint32/g' -e 's/\.uint/\.uint32/g' -e 's/\]uint/\]uint32/g' $^ > $@
uint64_test.go: uint_test.go
sed -e 's/Uint/Uint64/g' -e 's/ uint/ uint64/g' -e 's/\.uint/\.uint64/g' -e 's/\]uint/\]uint64/g' $^ > $@
bigrat.go: bigint.go
sed -e 's/BigInt/BigRat/g' -e 's/big\.Int/big\.Rat/g' $^ > $@
.PHONEY: gen test cov