添加Makefile

添加日志输出
添加Makefile 方便编译
This commit is contained in:
P001water 2024-05-22 20:21:45 +08:00
parent abdad98ff6
commit 080eb25281
2 changed files with 40 additions and 1 deletions

38
Makefile Normal file
View File

@ -0,0 +1,38 @@
BUILD_ENV = CGO_ENABLED=0
OPTIONS = -trimpath -ldflags "-w -s"
NAME = fscan
.PHONY: all linux windows macos mips arm clean
all:
${BUILD_ENV} GOOS=linux GOARCH=386 go build ${OPTIONS} -o release/${NAME}_86 main.go
${BUILD_ENV} GOOS=linux GOARCH=amd64 go build ${OPTIONS} -o release/${NAME}_64 main.go
${BUILD_ENV} GOOS=windows GOARCH=amd64 go build ${OPTIONS} -o release/${NAME}_64.exe main.go
${BUILD_ENV} GOOS=windows GOARCH=386 go build ${OPTIONS} -o release/${NAME}_86.exe main.go
${BUILD_ENV} GOOS=darwin GOARCH=amd64 go build ${OPTIONS} -o release/${NAME}_darwin64 main.go
${BUILD_ENV} GOOS=darwin GOARCH=arm64 go build ${OPTIONS} -o release/${NAME}_darwinarm64 main.go
${BUILD_ENV} GOOS=linux GOARCH=mipsle go build ${OPTIONS} -o release/${NAME}_mipsel main.go
${BUILD_ENV} GOOS=linux GOARCH=arm64 go build ${OPTIONS} -o release/${NAME}_arm64 main.go
linux:
${BUILD_ENV} GOOS=linux GOARCH=386 go build ${OPTIONS} -o release/${NAME}_86 main.go
${BUILD_ENV} GOOS=linux GOARCH=amd64 go build ${OPTIONS} -o release/${NAME}_64 main.go
${BUILD_ENV} GOOS=linux GOARCH=arm64 go build ${OPTIONS} -o release/${NAME}_arm64 main.go
windows:
${BUILD_ENV} GOOS=windows GOARCH=amd64 go build ${OPTIONS} -o release/${NAME}_64.exe main.go
${BUILD_ENV} GOOS=windows GOARCH=386 go build ${OPTIONS} -o release/${NAME}_86.exe main.go
macos:
${BUILD_ENV} GOOS=darwin GOARCH=amd64 go build ${OPTIONS} -o release/${NAME}_darwin64 main.go
${BUILD_ENV} GOOS=darwin GOARCH=arm64 go build ${OPTIONS} -o release/${NAME}_darwinarm64 main.go
arm:
${BUILD_ENV} GOOS=linux GOARCH=arm GOARM=5 go build ${OPTIONS} -o release/${NAME}_arm64 main.go
mips:
${BUILD_ENV} GOOS=linux GOARCH=mipsle go build ${OPTIONS} -o release/${NAME}_mipsel main.go
clean:
@rm release/*

View File

@ -25,7 +25,8 @@ func Scan(info common.HostInfo) {
if len(Hosts) > 0 || len(common.HostPort) > 0 {
if common.NoPing == false && len(Hosts) > 1 || common.Scantype == "icmp" {
Hosts = CheckLive(Hosts, common.Ping)
fmt.Println("[*] Icmp alive hosts len is:", len(Hosts))
result := fmt.Sprintf("[*] Icmp alive hosts len is: %d", len(Hosts))
common.LogSuccess(result)
}
if common.Scantype == "icmp" {
common.LogWG.Wait()