forked from Fantom-foundation/Aida
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
120 lines (101 loc) · 3.92 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
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
# Copyright 2024 Fantom Foundation
# This file is part of Aida Testing Infrastructure for Sonic.
#
# Aida is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Aida is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Aida. If not, see <http://www.gnu.org/licenses/>.
# what are we building
PROJECT := $(shell basename "$(PWD)")
GO_BIN := $(CURDIR)/build
# compile time variables will be injected into the app
APP_VERSION := 1.0
BUILD_DATE := $(shell date "+%a, %d %b %Y %T")
BUILD_COMPILER := $(shell go version)
BUILD_COMMIT := $(shell git show --format="%H" --no-patch)
BUILD_COMMIT_TIME := $(shell git show --format="%cD" --no-patch)
GOPROXY ?= "https://proxy.golang.org,direct"
.PHONY: all clean help test carmen tosca
all: aida-rpc aida-sdb aida-vm-adb aida-vm-sdb aida-stochastic-sdb aida-vm aida-profile util-updateset util-db
carmen:
@cd ./carmen ; \
make -j
tosca:
@cd ./tosca ; \
make -j
aida-rpc: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-rpc \
./cmd/aida-rpc
aida-stochastic-sdb: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-stochastic-sdb \
./cmd/aida-stochastic-sdb
aida-vm-adb: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-vm-adb \
./cmd/aida-vm-adb
aida-vm-sdb: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
CGO_CFLAGS="-g -O2 -DMDBX_FORCE_ASSERTIONS=1 -Wno-error=strict-prototypes" \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-vm-sdb \
./cmd/aida-vm-sdb
aida-vm: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-vm \
./cmd/aida-vm
aida-sdb: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-sdb \
./cmd/aida-sdb
aida-profile: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
CGO_CFLAGS="-g -O2 -DMDBX_FORCE_ASSERTIONS=1 -Wno-error=strict-prototypes" \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-profile \
./cmd/aida-profile
util-updateset: carmen tosca
GOPROXY=$(GOPROXY) \
go build -ldflags "-s -w" \
-o $(GO_BIN)/util-updateset \
./cmd/util-updateset
util-db: carmen tosca
GOPROXY=$(GOPROXY) \
go build -ldflags "-s -w" \
-o $(GO_BIN)/util-db \
./cmd/util-db
test: carmen tosca
@go test ./...
clean:
cd ./carmen ; \
make clean ; \
cd ../tosca ; \
make clean ; \
cd .. ; \
rm -fr ./build/*
help: Makefile
@echo "Choose a make command in "$(PROJECT)":"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo