zoukankan      html  css  js  c++  java
  • 使用Markfile开发GO程序

    Markfile

    makefile是用于构建和运行软件应用程序的自动化工具。

    GO程序

    首先,我们创建一个GO应用程序

    package main
    
    import "fmt"
    
    func main() {
    	fmt.Println("Hello Markfile!!")
    }
    

    创建Markfile

    build:
    	go build -o bin/main main.go
    
    run:
    	go run main.go
    
    compile:
    	# 32-Bit Systems
    	# FreeBDS
    	GOOS=freebsd GOARCH=386 go build -o bin/main-freebsd-386 main.go
    	# MacOS
    	GOOS=darwin GOARCH=386 go build -o bin/main-darwin-386 main.go
    	# Linux
    	GOOS=linux GOARCH=386 go build -o bin/main-linux-386 main.go
    	# Windows
    	GOOS=windows GOARCH=386 go build -o bin/main-windows-386 main.go
      # 64-Bit
    	# FreeBDS
    	GOOS=freebsd GOARCH=amd64 go build -o bin/main-freebsd-amd64 main.go
    	# MacOS
    	GOOS=darwin GOARCH=amd64 go build -o bin/main-darwin-amd64 main.go
    	# Linux
    	GOOS=linux GOARCH=amd64 go build -o bin/main-linux-amd64 main.go
    	# Windows
    	GOOS=windows GOARCH=amd64 go build -o bin/main-windows-amd64 main.go
    

    运行Markfile命令

    构建命令

    为我们的平台构建Go应用程序

    make build
    

    运行命令

    运行go应用程序

    make run
    

    编译命令

    为了针对不同的平台和操作系统编译Go 应用程序

    make compile
    

    参考

    跟我一起写Makefile

    https://harrisonbrock.blog/go-makefile/

  • 相关阅读:
    Permutations II
    N-Queens II
    Palindrome Number
    Minimum Path Sum
    JS的DOM操作2
    JS 的DOM操作
    函数概念
    JavaScript数组
    JavaScript循环及练习
    JS语言
  • 原文地址:https://www.cnblogs.com/warrior/p/12303782.html
Copyright © 2011-2022 走看看