help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make doesn't bail on compile errors


From: Michael L Brown
Subject: Re: Make doesn't bail on compile errors
Date: Mon, 26 Mar 2007 16:13:03 -0500

Sorry about the previous incomplete posting.  Hit send by mistake.

"Philip Guenther" <address@hidden> wrote on 03/23/2007 05:08:46 PM:

> On 3/23/07, Michael L Brown <address@hidden> wrote:
> > "Philip Guenther" <address@hidden> wrote on 03/23/2007 04:02:42 
PM:
> ...
> > > A correct makefile.  The makefile which is continuing instead of
> > > stopping has an incorrectly written set of commands that execute
> > > multiple recursive makes without checking all their exit statuses.
> >
> > The makefile has to do the checking and stop?  Oh how horrible.
> 
> GNU make checks the status of each separate command.  The issue only
> arises when "a command" actually consists of a series of shell
> commands using shell functionality such as ';' or 'for' loops.  So, if
> you write:
> 
> target:
>         command1
>         command2
> 
> then make will notice when 'command1' fails and stop the build.  If
> you instead write:
> 
> target:
>         command1; command2
> 
> then the failure of command1 will only be known to the shell and the
> semicolon effectively tells it to ignore the failure, so make will not
> stop when command1 fails.  Note that it *would* work correctly if you
> wrote:

Yep, we were doing just as you described  I was able to knock it down so
that the two items before the actual make were not necessary.

Didn't help.

A side note before I go and describe the Makefile layout... When the
linking is done, the failure that occurs in there does cause the whole
process to fail.

OK, here is the basic layout...

The process starts by the main script going into the main development
directory and running a script called buildpinn.  In it is the following
line:

        make || exit 1

The Makefile that it calls contains the following relevant definitions:

        DIRS =  \
                general \
                pinnacle \
                GeoPlugins

        include $(MAKEDIR)/Makedir.common

The Makedir.common contains the following relevant definitions:

        basic ::
                $(MAKE) $(DIRS)

        $(DIRS) ::
                $(MAKE) -C $@ $(TARGET)

In the pinnacle directory, the Makefile contains:
 
        DIRS =  \
                AAPMFormat \
                main \
                models

        primary :: basic

        include $(MAKEDIR)/Makedir.common

The output error produced:

make[1]: Entering directory `/home/current/work_8.0e_DEV/Pinnacle_DEV025'
make -C pinnacle
make[2]: Entering directory 
`/home/current/work_8.0e_DEV/Pinnacle_DEV025/pinnacle'
make -C main
make[4]: Entering directory 
`/home/current/work_8.0e_DEV/Pinnacle_DEV025/pinnacle/main'
make -C main
make[4]: Entering directory 
`/home/current/work_8.0e_DEV/Pinnacle_DEV025/pinnacle/main'

This is where ObjPinnacle.c is compiled and fails (on purpose)

making main as ../../lib/-sparc/libmain.a
make[5]: Entering directory 
`/home/current/work_8.0e_DEV/Pinnacle_DEV025/pinnacle/main'
make[5]: *** [../../lib/-sparc/libmain.a(ObjPinnacle.o)] Error 1
make[5]: Leaving directory 
`/home/current/work_8.0e_DEV/Pinnacle_DEV025/pinnacle/main'
make[4]: Leaving directory 
`/home/current/work_8.0e_DEV/Pinnacle_DEV025/pinnacle/main'
make -C models
make[4]: Entering directory 
`/home/current/work_8.0e_DEV/Pinnacle_DEV025/pinnacle/models'

Of course a lot of what is done and listed in the MAKELOG is missing.
I just showed the places where it gets into the subdirectories.

Any clues as to why this isn't getting trapped?

MB
 --
Mike Brown (address@hidden)
            Lotus Bloats: Michael L Brown/MSN/MS/PHILIPS
Philips Medical, Fitchburg, WI
Desk: 608-288-6969  Fax: 608-298-2101
PMS direct: 164-6969
You design it, I'll build it!






reply via email to

[Prev in Thread] Current Thread [Next in Thread]