🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Jens.Toerring Thu, 08 Nov 2001 12:05
Re: How to make a makefile terminate
#1
Author: Jens.Toerring
Date: Thu, 08 Nov 2001 12:05
49 lines
3079 bytes
In comp.unix.questions Kza Wah <kza@cyberinbox.com> wrote:
> Hi, I have a complicated series of steps involved in compiling a set
> of files, not all source code, some are custom files that get parsed
> by a preprocessor.

> Anyway, make is confusing me.  Lets assume, I have an .alpha file and
> I want to preprocess it into a .beta file.

> The first step is my custom proprocessor turning the .alpha into a
> .beta.  Each subsequent step depends on the .beta.

> When my preprocessor fails, make knows this and says:

> make: Fatal error: Command failed for target `rdfFullTest.beta'
> I would have expected make to stop there and give up, but it doesn't
> it goes on to the next step, which depends on the .beta.

> Is there a way to force make to quit? Like reading an exit code or
> something?

> By the way I am using sun workshop make, and its hard to find the
> answer to this simple question on the internet.

I have never worked with sun workshop make so I don't know if the following
will help you. But, usually, if you have a file A that depends on B, which
in turn depends on  file C you would have rules like the following in your
makefile:

A: B
    commands that creates A from B

B: C
    commands that creates B from C

This tells make when trying to create A to look for a method to create B
first, thus invoking the second rule. Now if the creation of B from C
fails make will stop because it can't create the file on which A depends.

I don't know if this answers your question, but without actually seeing your
makefile it's hard to figure out what's going wrong in your case.

                                         Regards, Jens
-- 
      _  _____  _____
     | ||_   _||_   _|        Jens.Toerring@physik.fu-berlin.de
  _  | |  | |    | |          AG Moebius, Institut fuer Molekuelphysik
 | |_| |  | |    | |          Fachbereich Physik, Freie Universitaet Berlin
  \___/ens|_|homs|_|oerring   Tel: ++49 (0)30 838 - 53394 / FAX: - 56046
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads