Files
umbrix-libcore/Makefile

39 lines
1.7 KiB
Makefile
Raw Normal View History

2023-08-16 15:16:02 +03:30
NAME=hiddify-libcore
BINDIR=bin
TAGS=with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api
GOBUILD=CGO_ENABLED=1 go build -trimpath -tags $(TAGS) -ldflags="-w -s" -buildmode=c-shared
lib_install:
go install -v github.com/sagernet/gomobile/cmd/gomobile@v0.0.0-20230728014906-3de089147f59
go install -v github.com/sagernet/gomobile/cmd/gobind@v0.0.0-20230728014906-3de089147f59
2023-08-19 14:10:13 +03:30
headers:
go build -buildmode=c-archive -o $(BINDIR)/$(NAME)-$@.h ./custom
2023-08-16 15:16:02 +03:30
android:
gomobile bind -v -androidapi=21 -javapkg=io.nekohasekai -libname=box -tags=$(TAGS) -trimpath -ldflags="-w -s" -target=android -o $(BINDIR)/$(NAME)-$@.aar github.com/sagernet/sing-box/experimental/libbox ./mobile
windows-amd64:
env GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.dll ./custom
2023-08-20 08:21:08 +00:00
windows-386:
env GOOS=windows GOARCH=386 CC=i686-w64-mingw32-gcc $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.dll ./custom
2023-08-19 14:10:13 +03:30
linux-amd64:
env GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.so ./custom
2023-08-20 08:21:08 +00:00
linux-386:
env GOOS=linux GOARCH=386 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.so ./custom
macos-amd64:
env GOOS=darwin GOARCH=amd64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags with_gvisor,with_lwip -buildmode=c-shared -o $(BINDIR)/$(NAME)-$@.dylib ./custom
macos-arm64:
env GOOS=darwin GOARCH=arm64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags with_gvisor,with_lwip -buildmode=c-shared -o $(BINDIR)/$(NAME)-$@.dylib ./custom
2023-08-20 08:28:11 +00:00
macos-universal: macos-amd64 macos-arm64
lipo -create $(BINDIR)/$(NAME)-macos-amd64.dylib $(BINDIR)/$(NAME)-macos-arm64.dylib -output $(BINDIR)/$(NAME)-$@.dylib
2023-08-20 08:21:08 +00:00
2023-08-16 15:16:02 +03:30
clean:
rm $(BINDIR)/*