GithubHelp home page GithubHelp logo

standardgalactic / ngyp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anvaka/ngyp

0.0 1.0 0.0 834 KB

plain gyp distribution on npm

License: MIT License

JavaScript 0.05% Python 98.65% C++ 0.05% Shell 0.05% Batchfile 0.03% Emacs Lisp 1.16%

ngyp's Introduction

ngyp

Plain gyp distribution on npm. This project does not alter original gyp in any way. The main purpose of this repository is to allow developers to install and play with gyp quickly.

usage

Make sure you have python installed and available in your PATH.

npm install -g ngyp

Once project is installed, you can start generating your projects. By default ngyp command will forward all arguments to gyp_main:

> ngyp
gyp: usage: gyp_main.py [options ...] [build_file ...]

gyp_main.py: error: no build_file

hello world with gyp

Let's say we have the following files:

// main.cc - our main c++ file
#include <iostream>

int main()
{
  std::cout << "Hello World!" << std::endl;
}

In the same folder we have a gyp folder, which defines how to generate project file for this C++ code:

{
  "targets": [
    {
      "target_name": "hello-world",
      "type": "executable",
      "sources": [
        "main.cc"
      ]
    }
  ]
}

To generate a make file that compiles this project:

ngyp main.gyp --depth=. -f make --generator-output=build

This will create a build folder, where we can run make and get our code compiled:

> cd build && make
  CXX(target) out/Default/obj.target/hello-world/main.o
  LINK(target) out/Default/hello-world

> ./out/Default/hello-world
Hello World!

license

This module is distributed under MIT license. gyp license can be found in official repository

ngyp's People

Contributors

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