This is a useful app for parsing makefiles and running target commands while taking dependencies into account.
- Parsing the command line.
- Reading a Makefile.
- Building a graph of vertices that represent targets, with each vertex containing dependencies and commands as string slices.
- Checking for cyclic dependence and exiting when one is detected.
- Command execution order, where commands of dependencies are executed first, followed by commands of the input target.
- Each target is at the start of a line.
- Each command is on a line that starts with a single tab (/t).
- At least one command must be executed for every target.
- Clone the repository:
$ git clone https://github.com/codescalersinternships/gomake-Rodina.git- Go to the repository directory:
$ cd gomake-Rodina- Install dependencies:
$ go get -d ./...- Build the package:
$ go build -o "bin/gomake" cmd/main.go$ gomake -f Makefile -t targetNote: you need to move the binary to any $PATH directory first.
build:
@echo 'executing build'
echo 'cmd2'
test: build
@echo 'executing test'
publish:
@echo 'executing publish'
Run all the tests as follows:
go test ./....If all tests pass on, the result should show that the tests were successful as follows:
PASS
ok github.com/codescalersinternships/gomake-Rodina/internal 0.006sIf any test fails, the output will tell which test failed.