Giter Club home page Giter Club logo

gomake's Introduction

GoMake

GoMake is a simple implementation of the make command in Go. It reads a Makefile and executes the specified target and its dependencies.

Installation

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

Usage

$ ./gomake [options] -t [target]

Options

  • -f FILE: Specify the path to the Makefile. If not specified, the default path Makefile will be used.
  • target: target you want to execute

Features

  • Target ordering: GoMake orders the targets based on their dependencies, ensuring that each target is executed only after its dependencies are completed.

  • Circular dependency detection: GoMake checks for circular dependencies between targets and returns an error if a circular dependency is detected.

  • Missing dependency detection: GoMake checks for missing dependencies and returns an error if a target has a dependency that is not defined in the Makefile.

  • Command execution: GoMake executes the commands associated with each target in order, ensuring that the commands are executed only after their dependencies are completed.

  • Error handling GoMake returns detailed error messages for circular dependencies, missing dependencies, and targets with no commands.

Format

GoMake checks a set of rules, each of which specifies a target and its dependencies, along with the commands needed to build the target. Rules have the following format:

target: [dependency ...]
[tab] command
  • target: the name of the target to build.
  • dependency: the name of a target that must be built before the current target can be built.
  • command: the command to execute to build the target.
  • The commands to build the target are indented with a single tab character
  • global commands not allowed
  • comments starts with '#'
  • comments and empty lines are ignored

Here is an example of a simple Makefile:

build: main.o lib.o
	go build -o myprogram main.o lib.o

main.o: main.go
	go build -o main.o -c main.go

lib.o: lib.go
	go build -o lib.o -c lib.go

gomake's People

Contributors

diaabadr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.