To illustrate the process of debugging a makefile, the following command was executed:
omake -ndf demo -p -#1 CV=
This is the content of makefile demo:
# List of modules, and target name.
#
TARGET = project.exe
OBJS = a.obj b.obj
# The default target in the makefile
#
$(TARGET) : $(OBJS)
# Additional dependency informationyou think they should
#
b.obj : $(TARGET,B).h
PATH.h = .;C:\SRC\H
For the purposes of this example, an empty make.ini file was created. Here is the output, with annotations in italics.
First, the initialization file make.ini is read:
*** Read make.ini *** |
(Start reading the make.ini file) |
*** Done make.ini *** |
(Done reading the make.ini file) |
Next, the makefile demo is read:
*** Read demo *** |
(Start reading the demo file) |
+ |
("+" if more than one blank or comment line was skipped) |
3: TARGET = project.exe |
("num: " identifies current line number) |
4: OBJS = a.obj b.obj |
|
Following output by the -#1 option, -p prints out information internal to omake, including facts about macros, targets, search directories, and inference rules. The output begins with this line:
*** Begin print out *** |
(Starts the -p printout) |
The first block of output is the macro definitions including the names and values of macros and the location they were defined. The location is any of the following:
built in | Defined by omake, but changeable by you |
predefined | Defined by omake, but cannot be changed by you |
command line | Defined by you on the omake command line |
file:number | Defined by you in makefile file on line number |
For brevity, most omake state macros have been omitted from this list:
The search directories output lists both the extension-specific and nonspecific search directories. The extension-specific directories are listed first:
*** Search directories ***
for .h : .\ C:\SRC\H\
all other files : .\
A .PATH macro is not defined, so all other files are searched for only in the current directory.
Following the search directories are all automatic response file definitions. Each line of output of this section appears in exactly the form needed as if it were input to omake.
*** Automatic responses ***
.RESPONSE.WCC386: env=WCC386 pre=-u in=1024 wcc386
.RESPONSE.LINT: suf=.lnt out=76 in=1024 lint
.RESPONSE.STD: pre=@ suf=.rsp out=76 in=1024 wpp386 cl386 cl lib32 lib link32
Following the automatic response definitions is the list of inference rules:
*** Inference rules ***
* Suffix rules *
%.obj : %.c
defined in: internal
$(CC) $(CFLAGS) -c $(.SOURCE)
%.obj : %.cpp
defined in: internal
$(CPP) $(CPPFLAGS) -c $(.SOURCE)
%.obj : %.asm
defined in: internal
$(AS) $(AFLAGS) $(.SOURCE);
%.obj : %.for
defined in: internal
$(FC) $(.SOURCE) $(FFLAGS)
%.res : %.rc
defined in: internal
$(RC) $(RFLAGS) -r $(.SOURCE);
%.exe : %.obj
defined in: internal
%do %.exe
* Meta rules *
%.lib :
defined in: internal
%if ! %null(.NEWSOURCES)
%if %exists(${.TARGET})
$(IMPLIB) -OUT:$(.TARGET) $(LIBFLAGS) $(.NEWSOURCES) $(.TARGET)
%else
$(IMPLIB) -OUT:$(.TARGET) $(LIBFLAGS) $(NEWSOURCES)
%endif
%endif
%.exe :
defined in: internal
$(LINK) -OUT:$(.TARGET) $(LINKFLAGS) $(.SOURCES) $(LINKLIBS)
The *Suffix rules*
are rules that can be of the form .fromExt.toExt. The *Meta rules*
are all other inference rules.
A list of the targets follows the inference rules. The default target is listed first.
*** Targets and commands *** | |
>>> default target <<< |
(The first target in the makefile) |
project.exe : a.obj b.obj |
(project.exe depends on a.obj & b.obj) |
b.obj : project.h |
(b.obj depends on project.h) |
Finally, after all -p output has appeared, you see this message:
*** Done print out ***
Feedback on the documentation in this site? We welcome any comments!
Copyright © 2001 by Rational Software Corporation. All rights reserved. |