1

I have been trying all the answers that are posted in stack overflow previously. Nothing worked for me. Below is the make file:

export IFT_DIR=./ift
export OPF_DIR=./ift/LibOPF

all:    msp_bin

FLAGS= -O6 -Wall

$(IFT_DIR)/lib/libift.a:
$(MAKE) -C $(IFT_DIR) 

msp_bin: msp_bin.c $(IFT_DIR)/lib/libift.a
    gcc $(FLAGS) msp_bin.c -o msp_bin -I $(IFT_DIR)/include I$(IFT_DIR)/LibOPF/include -L $(IFT_DIR)/lib -lift -lm -lz
clean:
     del -f msp_bin *.a *~
     $(MAKE) clean -C $(IFT_DIR)

and I get the error saying "make: nothing can be done for all."

Cndu
  • 57
  • 8
  • 1
    Indentation is crucial, but nothing is indented in your post. Is that the same in your makefile or an error when posting it here? – Mat Nov 30 '19 at 04:19
  • I am not sure about your question. I am actually trying to code that I downloaded. I have makefile in the folder along with a msp_bin.c file and msp_bin file (it has no extension). The readme file says "just type make and it will compile and generate msp_bin". It also asks zlib1g. I have installed it. – Cndu Nov 30 '19 at 05:19
  • Are you sure the code isn't already built? Make avoids rebuilding files that are already built and emits a similar message when it finds it doesn't need to do anything – Alan Birtles Nov 30 '19 at 07:03
  • Consider the possibility that the software wasn't written for MS Windows and that you can't compile it there. An executable without a file extension ".exe" is such an indicator. The use of "del" instead of "rm" is a counterindicator. Anyhow, questions like that need a [mcve]. However, consider filing a bug report at the supplier of the code as well. As a new user here, also take the [tour] and read [ask]. – Ulrich Eckhardt Nov 30 '19 at 10:17
  • 1
    _nothing can be done_ is not an actual error message generated by `make`. Please cut and paste the command you invoked and the _exact_ error message you get when you run `make`. – MadScientist Nov 30 '19 at 15:09
  • Did you try `all:\n\tmake msp_bin` ? – Damien Nov 30 '19 at 18:53

1 Answers1

0

You are probably having a problem with the indentation. The line right after your rules need to have a Tab, or it won't work.

example:

msp_bin: msp_bin.c $(IFT_DIR)/lib/libift.a
gcc $(FLAGS) msp_bin.c -o msp_bin -I $(IFT_DIR)/include ...

shoutld be:

msp_bin: msp_bin.c $(IFT_DIR)/lib/libift.a
    gcc $(FLAGS) msp_bin.c -o msp_bin -I $(IFT_DIR)/include ...

Check out this answer too: make: Nothing to be done for `all'

lenz
  • 2,193
  • 17
  • 31
  • Sorry. You are right! I dint paste the code here in the proper way. I edited my question now ! – Cndu Nov 30 '19 at 12:39