“Make” command for Windows - possible options?

前端 未结 5 566
小蘑菇
小蘑菇 2021-01-02 02:53

I am trying to setup Derby.js for Node on my Windows Machine. According to the Derby.js setup instructions, in order to use coffescript, I must do the following:

<         


        
相关标签:
5条回答
  • 2021-01-02 03:15

    Microsoft's implementation of Make is nmake. I don't think it's as advanced as a lot of Make implementations from various Unices, but it should work for simple Makefiles.

    0 讨论(0)
  • 2021-01-02 03:19

    If you are looking for possible options, I actually have one which will utilize PowerShell. “Make” executes commands in the makefile so that is why I used PowerShell to accomplish similar tasks. However, be warned that I only did this for my Django project. Read below if this interests you and here is the sample:

    1. Created a PowerShell file something like initial.ps1.
    2. Insert contents that you see or expect in the makefile. Here is the example I used for my Django project:

    # Bypass the execution policy (do this if needed)
    Set-ExecutionPolicy RemoteSigned
    
    # Setup variables
    $proj = "proj"
    $app = "app"
    
    # Starting Virtual Environment
    virtualenv $proj
    cd .\$proj
    .\Scripts\activate
    
    # Install project
    pip install --upgrade pip
    pip install django
    
    # Starting app
    django-admin startproject $app
    cd .\$app
    
    # Build the project and the app
    python .\manage.py makemigrations
    python .\manage.py migrate
    python .\manage.py createsuperuser
    
    1. Open CMD and run the ps1.

    This is very handy at least for me so I don’t need to type all those commands over and over when creating new projects. Hope this helps.

    0 讨论(0)
  • 2021-01-02 03:20

    As you found, a stand-alone make wasn't enough; you needed Cygwin.

    make is a program that interprets a makefile and executes the commands in the makefile. But, what are those commands? If you look at your makefile you will see UNIX-style commands that are available in Linux, Mac OS X, or Cygwin but are not available in an off-the-shelf Windows system. Thus, simply grabbing a make wasn't enough.

    0 讨论(0)
  • 2021-01-02 03:34

    So I ended up downloading Cygwin and used the "make" system that came with it. It worked perfectly! I honestly have no idea why the GnuWin32 "make" command didn't work, but I suppose this would be helpful to those who encounter the same issue in the future.

    0 讨论(0)
  • 2021-01-02 03:36

    I assume that by meaning make you are refering to GnuWin's make.

    The cmd throwed an error because the make.exe file is not in the environment variables to call it as a command.

    I tried calling it by giving the complete path (C:\Program Files (x86)\GnuWin32\bin\make.exe) and it worked perfectly.

    Also, you can register it with cmd to invoke it as a command. Add the path to PATH environment variable.

    0 讨论(0)
提交回复
热议问题