This project is currently being reconstructed, please use the Release version instead of building it directly from the repo.
This image is from Gopher Konstructor
Build a GMakefile at lightning speed!
This project is the follow-up maintenance of go-gmake.
This method is limited to systems using apt and dpkg for package management.
Please execute the following commands in the order they were written.
echo 'deb https://deb.lcag.org stable main' | sudo tee /etc/apt/sources.list.d/malonan.list
wget -qO - https://deb.lcag.org/public.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/malonan.gpg add -
sudo apt update && sudo apt install gmake2
Upgrade GMake2
apt update && apt upgrade
Download the latest version from github.
You can build gmake2 directly using Go build, but the version subcommand will not work properly.
git clone https://github.com/3JoB/gmake2 && cd gmake2
# gmake2 installed
gmake2
# gmake2 is not installed
go build -ldflags "-s -w -X 'main.SoftBuildTime=owner' -X 'main.SoftCommit=owner' -X 'main.SoftVersion=owner' -X 'main.SoftVersionCode=owner'"
Write the GMakefile.yml file in the current directory, the content is as follows
vars:
msg: Hello World
all: |
@echo {{.msg}}
mg: |
@echo What's up???
Then run gmake2
on the current command line console, you can see the console print
Hello World
Or execute gmake2 mg
to execute the specified command, and the console will print
What's up???
gmake2 automatically selects the all command when no command is specified.
Keywords moved to Wiki
View in Wiki
Variables moved to Wiki
GMakefile.yml
vars:
msg: Hello World
all: |
@echo {{.msg}}
# Modify the msg variable
@var msg Hello
@echo {{.msg}}
# Create a file
@touch from.txt
@mv from.txt to.txt
@cp to.txt from.txt
@rm from.txt
@rm to.txt
@mkdir from
@mv from to
@cp to from
@rm from
@rm to
@env GOOS linux
go build
gmake2
- Due to unsigned and some high-risk operations, GMake2 may be blocked by some anti-virus software. If you have installed anti-virus software on your device, please manually set GMake2 to the whitelist.
- The binary released by GMake2 is compiled directly from the git library, the specific steps:
- 1_ Write the update
- 2_ Push to github
- 3_ Run the gmake2 command to compile the binary
- GMake2 only has the following binary distribution channels, and cannot guarantee that other channels are safe:
This software is distributed under MPL-2.0 license. :)