make: Nothing to be done for 'all'

Hi,

I am getting the error, "make: Nothing to be done for 'all'." when I execute the 'make' command.  I tried reinstalling the 'make' install from the 'setup.exe' but still getting this error.  I know I have a Makefile because I ran 'make' on the same file from another computer.  What could be causing the problem?
VWrestle97Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VWrestle97Author Commented:
Do I need automake?
0
Doc_McAlisterCommented:
When you use make you need to provide a target.  Like:

make clean

or

make Example

If you just type 'make' your system tries the default target, "all".  so typing 'make' is just like typing:

make all

So it goes to your makefile looking for the 'all' target.  And gives that error if it does not find one.
0
VWrestle97Author Commented:
Is the target the name of the Makefile or something in the Makefile such as, "all: $(PGM)".  Would you be able to identify the name of the target from the code below?
===============================
PGM = \
  create_bins_u create_bins_s \
  randy_create_bins_u randy_create_bins_s \

BF_3D_DOTO = \
  dtime.o cmdlineopts.o endian_utils.o main_beamforming_3d.o scan_params_file.o \
  complex_mult.o complex_sum.o complex_divide.o complex_sqrt.o \
  Readmode.o Propmode.o Covmat.o Read_fft_data.o Rotate.o

TILTCOR_V6_DOTO = \
  cmdlineopts.o tiltcor_v6.o scan_params_file.o

all: $(PGM)

CRYPTOBJECTS=encrypt.o
LIBNAME=$(TOMCRYPT)/libtomcrypt.a
EXTRALIBS=
CRYPT=encrypt

#makes the crypt program
crypt: $(CRYPTOBJECTS)
      $(CC) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(CRYPT) $(WARN)

create_tilt_heading.o: create_tilt_heading.c Makefile $(DOTH) $(DOTL)
      $(CC) -c $(CFLAGS) -o $@ $<

create_bins_u.o: create_bins_u.c Makefile $(DOTH) $(DOTL)
      $(CC) -c -USIGNED_DATA $(CFLAGS) -o $@ $<

create_bins_s.o: create_bins_s.c Makefile $(DOTH) $(DOTL)
      $(CC) -c -DSIGNED_DATA $(CFLAGS) -o $@ $<

randy_create_bins_u.o: randy_create_bins_u.c Makefile $(DOTH) $(DOTL)
      $(CC) -c -USIGNED_DATA $(CFLAGS) -o $@ $<
====================================
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

VWrestle97Author Commented:
(Scenario 1)
I did the same "make" command with no arguments for the same file but on a different computer before this one (#1) and it processed it just fine but this computer (#2) displays "make: Nothing to be done for 'all'".  Why?

(Scenario 2)
I then tried "make all" on both computers and both had the same reaction as stated in Scenario 1.

(Senario 3)
I then tried "make <MakeFileName>" and both computers displayed, "make: Nothing to be done for 'all'"

Why is Scenario 1 not consistent?
0
ozoCommented:
It means that everything that needs to be made for all: has already been made
0
Doc_McAlisterCommented:
All:

is the all target.  But you are assigning it to a variable $PGM.

That variable resolves to the following targets:

create_bins_u create_bins_s randy_create_bins_u randy_create_bins_s

And it makes each f them in order .. though the last was not in your sample.  If all files are up to date and noting needs to be done make will do nothing ... Thus not wasting processor time.  touch the source files to alter their modified date and run make again to see it do something.
0
VWrestle97Author Commented:
If I did "make -W all", wouldn't that force everything to be rebuilt?  It doesn't seem to work.
0
Doc_McAlisterCommented:
Actually slap me with a fish ... the targets $PGM resolve to are:

create_bins_u create_bins_s randy_create_bins_u randy_create_bins_s

But the targets in your file have .o's on the end.

create_bins_u is not create_bins_u.o on most systems.  You should be getting errors saying it doesn't know how to build "create_bins_u" etc unless there are valid targets for them elsewhere in the file,
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Doc_McAlisterCommented:
-W will do that but the usage is different.

-------Usage -------
       -W file,
          Pretend that the target file has just been      modified.   When  used
          with  the -n flag, this shows you what would happen if you were to
          modify that file.  Without -n, it is almost the same as running  a
          touch  command  on the given file before running make, except that
          the modification time is changed only in the imagination of  make.
--------------------------

also, it is standard to have a target called "clean" and "make clean" should delete all the compiled files so that the next make all rebuilds everything from scratch.  If you have a clean target you can do that.
0
VWrestle97Author Commented:
"If you have a clean target"... what exactly do you mean by that?
0
Doc_McAlisterCommented:

If I wanted to clean by removing all .exe and .o files my clean target might look like this:

clean :
<tab>rm -f *.o *.exe


Then whenever I ran make with the target clean by typing:

make clean

it would execute the rm statement.  So next time I run make it has to rebuild those objects.  It is good practice to include that target in your makefile when you write one ... but if you don't have one then you should not attempt to add one unless you know exactly what you want the clean to remove.
0
VWrestle97Author Commented:
Ok,  now I can see why Scenario 1 wasn't consistent; It's because it was never modified when I copied the files to that computer but the other computer had the modified files but didn't realize it until now.  Thanks for the hint.

So, after making my Makefile, do I need to do anything else before running "./ <executable>" or am I good to go because when I run it I get the error, "./<executable>: cannot execute binary file" ... why is that?
0
VWrestle97Author Commented:
what does this clean do?

clean:
      $(RM) *.[o]
0
Doc_McAlisterCommented:
Well ... you might need to chmod the binary.  Most systems are nice and automatically flag compiled files a executable, but some are not.  

ls -alF executable

that should give you file details.  part of it is wrx (read, write, execute) flags.  If there aren't any x's then the system doesn't consider it an executable and you need to

chmod 755 executable

to give yourself permission to execute it.

And that clean executes $(RM) *.[o] at the command line.  You'll  need to find where the RM variable is defined to tell what that is.  Anything in the form $(something) is a variable.  I bet it is something like:

RM = rm -f $(OBJECTDIR)

And that OBJECTDIR is defined somewhere else. and so on and so on.

Good luck and good night =)
0
VWrestle97Author Commented:
but is you use the

clean :
rm -f *.o *.exe

to delete object files, then should the make still be able to rebuild the executable?
0
Doc_McAlisterCommented:
Oh yeah ... the word executable in

chmod 755 executable

was meant to be the name of your file, should have put it in <>,  Same for the ls -alF statement.

And your compiler probably will set them executable automatically, but you said you copied it here and then the make didn't do anything.  So the binary here was not compiled here and thus not flagged by the compiler as executable.  And of course if the computer you copied from was a different architecture than the computer you copied too its binary is no good.  You need to compile one locally.

Make doesn't check that the files are "good" when it determines if it needs to do anything.  It just looks at file names and their modified stamps.  You could replace the final executable with a picture of your dog and as long as its name is the same and its newer than all its component files make will pat itself on the back for a job well done and tell you all's well.


Really going to bed this time =).  
0
Doc_McAlisterCommented:
but is you use the

clean :
<tab>rm -f *.o *.exe

to delete object files, then should the make still be able to rebuild the executable?
--------------

Yep.  As long as it has access to the source code.
0
VWrestle97Author Commented:
Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Software

From novice to tech pro — start learning today.