mirror of
https://github.com/CosmicStar98/bedrocktool.git
synced 2024-06-09 13:39:46 +00:00
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"
|
GC = go build -ldflags "-s -w"
|
||||||
TAG = $(shell git describe --tags)
|
TAG = $(shell git describe --tags)
|
||||||
|
|
||||||
NAME = bedrocktool_${TAG}
|
NAME = bedrocktool-${TAG}
|
||||||
SRCS = $(wildcard *.go)
|
SRCS = $(wildcard *.go)
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,26 +18,27 @@ GC += -overlay overlay.json
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
BUILDS=\
|
||||||
all: windows linux
|
windows_amd64.exe\
|
||||||
|
windows_arm64.exe\
|
||||||
.PHONY: all clean windows linux mac
|
darwin_amd64\
|
||||||
|
darwin_arm64\
|
||||||
windows: $(NAME).exe
|
linux_amd64\
|
||||||
linux: $(NAME)-linux
|
linux_arm64
|
||||||
mac: $(NAME)-mac
|
|
||||||
|
|
||||||
|
|
||||||
$(NAME).exe: $(SRCS)
|
DISTS=$(BUILDS:%=$(NAME)_%)
|
||||||
echo TAG: ${TAG}
|
|
||||||
GOOS=windows $(GC) -o $@
|
|
||||||
|
|
||||||
$(NAME)-linux: $(SRCS)
|
all: $(DISTS)
|
||||||
GOOS=linux $(GC) -o $@
|
|
||||||
|
|
||||||
$(NAME)-mac: $(SRCS)
|
.PHONY: all clean $(DISTS)
|
||||||
GOOS=darwin $(GC) -o $@
|
|
||||||
|
|
||||||
|
$(DISTS): OS = $(word 2,$(subst _, ,$@))
|
||||||
|
$(DISTS): ARCH = $(word 1,$(subst ., ,$(word 3,$(subst _, ,$@))))
|
||||||
|
|
||||||
|
$(DISTS): $(SRCS)
|
||||||
|
@echo "building: $@"
|
||||||
|
GOOS=$(OS) GOARCH=$(ARCH) $(GC) -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm $(NAME).exe $(NAME)-linux $(NAME)-mac
|
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) {
|
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")
|
_status := minecraft.NewStatusProvider("Server")
|
||||||
listener, err := minecraft.ListenConfig{
|
listener, err := minecraft.ListenConfig{
|
||||||
StatusProvider: _status,
|
StatusProvider: _status,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user