Add initialization script and a Dockerfile (#15)

Reviewed-on: deep-stack/laconic2d#15
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
2024-03-07 05:10:41 +00:00
committed by ashwin
parent ec147272e6
commit 4e4e9caccf
6 changed files with 154 additions and 27 deletions
+21 -9
View File
@@ -24,26 +24,38 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=laconic \
BUILD_FLAGS := -ldflags '$(ldflags)'
BUILDDIR ?= $(CURDIR)/build
###########
# Install #
###########
go.sum: go.mod
echo "Ensure dependencies have not been modified ..." >&2
go mod verify
go mod tidy
BUILD_TARGETS := build install
build: BUILD_ARGS=-o $(BUILDDIR)/
build-linux:
GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false $(MAKE) build
$(BUILD_TARGETS): go.sum $(BUILDDIR)/
@echo "--> installing laconic2d"
go $@ $(BUILD_FLAGS) $(BUILD_ARGS) ./...
$(BUILDDIR)/:
mkdir -p $(BUILDDIR)/
all: install
install:
@echo "--> ensure dependencies have not been modified"
@go mod verify
@echo "--> installing laconic2d"
@go install $(BUILD_FLAGS) -mod=readonly ./cmd/laconic2d
init:
./scripts/init.sh
.PHONY: build build-linux install
##################
### Protobuf ###
##################
protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)