add multi arch builds
This commit is contained in:
parent
8c8892abb7
commit
4d50d5fe24
33
Makefile
33
Makefile
|
@ -1,7 +1,7 @@
|
|||
GC = go build -ldflags "-s -w"
|
||||
TAG = $(shell git describe --tags)
|
||||
|
||||
NAME = bedrocktool_${TAG}
|
||||
NAME = bedrocktool-${TAG}
|
||||
SRCS = $(wildcard *.go)
|
||||
|
||||
|
||||
|
@ -18,26 +18,27 @@ GC += -overlay overlay.json
|
|||
endif
|
||||
|
||||
|
||||
|
||||
all: windows linux
|
||||
|
||||
.PHONY: all clean windows linux mac
|
||||
|
||||
windows: $(NAME).exe
|
||||
linux: $(NAME)-linux
|
||||
mac: $(NAME)-mac
|
||||
BUILDS=\
|
||||
windows_amd64.exe\
|
||||
windows_arm64.exe\
|
||||
darwin_amd64\
|
||||
darwin_arm64\
|
||||
linux_amd64\
|
||||
linux_arm64
|
||||
|
||||
|
||||
$(NAME).exe: $(SRCS)
|
||||
echo TAG: ${TAG}
|
||||
GOOS=windows $(GC) -o $@
|
||||
DISTS=$(BUILDS:%=$(NAME)_%)
|
||||
|
||||
$(NAME)-linux: $(SRCS)
|
||||
GOOS=linux $(GC) -o $@
|
||||
all: $(DISTS)
|
||||
|
||||
$(NAME)-mac: $(SRCS)
|
||||
GOOS=darwin $(GC) -o $@
|
||||
.PHONY: all clean $(DISTS)
|
||||
|
||||
$(DISTS): OS = $(word 2,$(subst _, ,$@))
|
||||
$(DISTS): ARCH = $(word 1,$(subst ., ,$(word 3,$(subst _, ,$@))))
|
||||
|
||||
$(DISTS): $(SRCS)
|
||||
@echo "building: $@"
|
||||
GOOS=$(OS) GOARCH=$(ARCH) $(GC) -o $@
|
||||
|
||||
clean:
|
||||
rm $(NAME).exe $(NAME)-linux $(NAME)-mac
|
6
utils.go
6
utils.go
|
@ -134,6 +134,12 @@ func spawn_conn(ctx context.Context, clientConn *minecraft.Conn, serverConn *min
|
|||
}
|
||||
|
||||
func create_proxy(ctx context.Context, server_address string) (l *minecraft.Listener, clientConn, serverConn *minecraft.Conn, err error) {
|
||||
/*
|
||||
if strings.HasSuffix(server_address, ".pcap") {
|
||||
return create_replay_connection(server_address)
|
||||
}
|
||||
*/
|
||||
|
||||
_status := minecraft.NewStatusProvider("Server")
|
||||
listener, err := minecraft.ListenConfig{
|
||||
StatusProvider: _status,
|
||||
|
|
Loading…
Reference in New Issue