make: *** No rule to make target 'all'. Stop - gcc

I'm working a class assignment from machine learning course. We are given a hmm.tar file which contains c++ implementation of hidden markov models.
In the read me file the following was given.
To compile and test the program,
1) extract the code:
tar -xf hmm.tar
2) compile the programs:
make all
at the second step the output from the terminal is make: *** No rule to make target 'all'. Stop
I'm using windows10 OS and running cygwin terminal.
Please help me to sort this problem out. Here's the
Makefile

I'm guessing the tar file has files inside a subdirectory. You probably just need to make sure you're in the directory that has the Makefile, and then run make:
tar -xf hmm.tar
cd __somewhere_
make all
to help you know where the Makefile is, you could use:
tar tf hmm.tar | grep -i makefile

Since cygwin returns make: *** No rule to make target 'all'. Stop, it seems that make is installed correctly.
As such, it has to be two other things:
Either the make file inside the.tar is missing, or
there are syntactical errors present in the make file

Related

How does make command doesnot search for Makefile in the same directory first?

I am using the command make for compiling source codes. However, the command always issue this error
Makefile:10: Makefile_compiler_HOSTNAME: No such file or directory
make: *** No rule to make target `Makefile_compiler_HOSTNAME'. Stop.
where HOSTNAME is the hostname of my computer. It seems like make is defaulted to search for the file Makefile_compiler_HOSTNAME before the file Makefile.
Is there any way to set the default behaviour of make back?

How to run Makefile in mac

I want to create a fat library in mac. So I foll this. I copied the content of makefile into an edit text and renamed it to Makefile.mak. I opened the terminal in where the makefile is located and types "make" in the terminal and hit enter. I am getting an error that "Makefile is not found". What would be the reason for this? Where I made a mistake?
Please help me.
Thanks
Your makefile is incorrectly named. You need to rename your Makefile.mak back to 'makefile'; that's what the make command is looking for.
make looks for files with name GNUmakefile, makefile or Makefile. If you change your file's name to one of these, you can run it without a problem. If you still want to use that name, you must run the make with -f flag. Running command should be like this:
$make -f <file_name>
In your case:
$make -f Makefile.mak

MinGW make: copy: command not found

I'm trying to compile hp2xx on Windows 10 using MinGW. My makefile is a straight copy of the dosdjgpp.mak file from the makes directory. I have c:\MinGW\bin and C:\MinGW\msys\1.0\bin in the path.
The make operation fails at the first copy. The makefile line it is failing on is
pbuf.o: picbuf.o
copy picbuf.o pbuf.o
and the error is
copy picbuf.o pbuf.o
make: copy: Command not found
make: *** [pbuf.o] Error 127
From the same command prompt I can use copy OK, so why can't make find it?
I believe that mingw/bin contains the linux style copy command cp so try
pbuf.o: picbuf.o
cp picbuf.o pbuf.o
You may want to add the windows copy path if not already included

Build gcc on linux script

Good day, i write script for building gcc on linux, my code is:
#!/bin/bash
export INSTALLATION_GCC=/opt
cd $INSTALLATION_GCC
tar xjvf gcc-4.7.0.tar.bz2
export srcdir="$INSTALLATION_GCC/gcc-4.7.0"
export objdir="$INSTALLATION_GCC/gcc-bin"
export insdir="$INSTALLATION_GCC/usr/local"
mkdir -p $srcdir
mkdir -p $objdir
mkdir -p $insdir
cd $objdir
$srcdir/configure --prefix=$insdir
make bootstrap
make install
but when i run this script i get errors:
No such file or directoryopt
tar (child): gcc-4.7.0.tar.bz2\r: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
/configure: No such file or directory
'. Stop. No rule to make target `bootstrap
'. Stop. No rule to make target `install
Why cd not work successful, if i execute my script (if i input this command in interactive mode all ok)?After building and installing gcc why my version of gcc not changing, how can i replace old version gcc properly?
I think my comment about a backspace being part of the directory name is relevant:
"There is something strange here, the error message No such file or directoryopt is missing a space and a /. It looks to me like your code did not generate this error message, are you sure that $INSTALLATION_GCC is /opt with the leading /? It almost appears that the first character of $INSTALLATION_GCC is a backspace."
I also spied gcc-4.7.0.tar.bz2\r in one of the error messages. A \r would give these effects. The most common unwanted source of \r (carriage-return) is Windows. Are you using something like Notepad on Windows to edit your scripts? If Windows is involved, convert your script using dos2unix.

Create a makefile for multiple OSes, this make (ext?) doesn't work?

I have a working makefile that builds with mingw32. Now i renamed that makefile to Makefile.w32 (source -> http://pastie.org/319964)
Now i have a Makefile with the following. The problem is, it does not build my source
all:
make mingw32
clean:
#echo "causes an infinite loop -> make mingw32 clean"
mingw32:
#echo "yeahhhhhhhhh"
make Makefile.w32
mingw32-clean:
#echo "mingw clean"
make Makefile.w32 clean
result:
> "make"
make mingw32
make[1]: Entering directory `/c/nightly/test'
yeahhhhhhhhh
make Makefile.w32
make[2]: Entering directory `/c/nightly/test'
make[2]: Nothing to be done for `Makefile.w32'.
make[2]: Leaving directory `/c/nightly/test'
make[1]: Leaving directory `/c/nightly/test'
It seems to me it doesn't like Makefile.w32 extension. I dont understand why it isn't building. It;s obviously getting to my "make Makefile.w32" line.
"make Makefile.w32" is looking for a target named Makefile.w32, not a make file by that name. To run make and tell it to read the make file "Makefile.w32", use the -f switch:
make -f Makefile.w32
Edit: Incidentally, why do you launch a separate instance of make in the "all" target, if all you want is for "all" to depend on the "mingw32" target in the same make file? It'd be better, IMHO, to declare it as a dependent target instead:
all: mingw32
Likewise with "clean" and "mingw32-clean":
clean: mingw32-clean
You can use cmake to generate makefiles. It should work on most platforms.

Resources