Skip to content

Latest commit

 

History

70 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gomake-Rodina

This is a useful app for parsing makefiles and running target commands while taking dependencies into account.

Features:

  • 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.

Formatting of makefiles for ease of use:

  • 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.

Manual:

  1. Clone the repository:
$ git clone https://github.com/codescalersinternships/gomake-Rodina.git
  1. Go to the repository directory:
$ cd gomake-Rodina
  1. Install dependencies:
$ go get -d ./...
  1. Build the package:
$ go build -o "bin/gomake" cmd/main.go

How to use?

$ gomake -f Makefile -t target

Note: you need to move the binary to any $PATH directory first.

Here is an example for a makefile:

build:
	@echo 'executing build'
	echo 'cmd2'

test: build 
	@echo 'executing test'

publish:  
	@echo 'executing publish'

How to test?:

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.006s

If any test fails, the output will tell which test failed.

About

gomake-Rodina is an app that helps you run commands from makefiles in a smart way. It can read a makefile and build a graph of targets and their dependencies. It can also check for cycles in the graph and exit if there are any. It can execute the commands in the right order, starting from the dependencies and then the target.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages