10

I have created make file named Makefile in my linux ec2 server.

all: a b

a: daemon.cpp dictionary_exclude.cpp
        g++ -o a daemon.cpp dictionary_exclude.cpp -lpthread -std=c++0x -L.

b: user_main.cpp client.cpp
        g++ -o b user_main.cpp client.cpp

I could run each of this independently successfull.

But when I execute

make
make -f Makefile

It says make : -bash: make: command not found

Any idea? I can see manually for make is available through man make

Barmar
  • 741,623
  • 53
  • 500
  • 612
user3245689
  • 149
  • 1
  • 1
  • 11
  • 1
    see http://stackoverflow.com/questions/9544200/how-can-i-use-install-make-on-the-amazon-linux-ami-for-ec2 – Jayesh Bhoi Feb 11 '14 at 12:31
  • 1
    `man make` will give you some documentation about the `make` command. you can install the documentation without installing `make` itself, so `man make` is *not* a good test to check whether a program is installed. – umläute Feb 11 '14 at 13:43

4 Answers4

18

Please execute following command to install make in your system

sudo yum install build-essential
Rahul R Dhobi
  • 5,668
  • 1
  • 29
  • 38
  • 7
    `build-essential` is for `apt-get`, the `"Development Tools"` package is the equivalent under `yum` – buley Sep 30 '14 at 05:37
7

In CentOS or Red Hat, try this:

yum groupinstall "Development Tools"
Jon Senchyna
  • 7,867
  • 2
  • 26
  • 46
tonysok
  • 627
  • 1
  • 7
  • 13
1

It might be that you have not installed binutils http://en.wikipedia.org/wiki/GNU_Binutils or you have not set your PATH variable to the correct location of bin utils.

Pradheep
  • 3,553
  • 1
  • 27
  • 35
0

sudo apt-get install build-essential on Ubuntu 16 worked for me

techkuz
  • 3,608
  • 5
  • 34
  • 62