This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Makefile help!

I have a directory full of C files, of which everyone needs compiled.

I then need to add all the resultant OBJ files to LIB file.

Is there an easy way to do this with a MAKEFILE using MS NMAKE.

The problem I am having is specifting wildcards....

TIA

Gary

Parents
  • To build the object files you can use an inference rule, as in the following makefile snippet:

    # Source directory
    S = .
    
    # Output directory
    O = ./objs
    
    # Inference rule
    {$S}.c{$(O)}.obj:
       C51 %s $(C51_OPTS) OBJECT($(O)/%|fF.obj)
    

    I don't know any shortcut for linking all of the resultant object files, though.

    Shane.

Reply
  • To build the object files you can use an inference rule, as in the following makefile snippet:

    # Source directory
    S = .
    
    # Output directory
    O = ./objs
    
    # Inference rule
    {$S}.c{$(O)}.obj:
       C51 %s $(C51_OPTS) OBJECT($(O)/%|fF.obj)
    

    I don't know any shortcut for linking all of the resultant object files, though.

    Shane.

Children
No data