diff --git a/Makefile b/Makefile index 25381cbc..36b796f1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ TARGET=bettercap-ng +PCAP=http://www.tcpdump.org/release/libpcap-1.8.1.tar.gz +LDFLAGS='-linkmode external -extldflags "-static -s -w"' all: fmt vet build @echo "@ Done" @@ -10,6 +12,22 @@ build: resources @echo "@ Building ..." @go build $(FLAGS) -o $(TARGET) . +linux_arm: + @echo "@ Cross compiling for linux/arm-7" + @xgo -ldflags=$(LDFLAGS) --deps=$(PCAP) --depsargs="--with-pcap=linux" --targets=linux/arm-7 . + +linux_arm64: + @echo "@ Cross compiling for linux/arm64" + @xgo -ldflags=$(LDFLAGS) --deps=$(PCAP) --depsargs="--with-pcap=linux" --targets=linux/arm64 . + +linux_mips: + @echo "@ Cross compiling for linux/mips" + @xgo -ldflags=$(LDFLAGS) --deps=$(PCAP) --depsargs="--with-pcap=linux" --targets=linux/mips . + +linux_mips64: + @echo "@ Cross compiling for linux/mips64" + @xgo -ldflags=$(LDFLAGS) --deps=$(PCAP) --depsargs="--with-pcap=linux" --targets=linux/mips64 . + resources: oui oui: @@ -26,6 +44,7 @@ lint: deps: @go get -u github.com/jteeuwen/go-bindata/... + @go get github.com/ykyuen/xgo @go get ./... clean: