🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: unix.questions
Article #1

Re: How to make a makefile terminate

#1
From: 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
Technical Details
Message-ID: <9sdse7$1304p0$1@fu-berlin.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.unix.programmer.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!crowley.physik.fu-berlin.DE!not-for-mail
References: <8dc10b0e.0111072336.32886696@posting.google.com>

Show Full Headers
Complete Article Headers
Message-ID: <9sdse7$1304p0$1@fu-berlin.de>
Subject: Re: How to make a makefile terminate
Date: Thu, 08 Nov 2001 12:05:27 +0000
From: Jens.Toerring@physik.fu-berlin.de
References: <8dc10b0e.0111072336.32886696@posting.google.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.unix.programmer.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!crowley.physik.fu-berlin.DE!not-for-mail
Newsgroups: comp.unix.programmer,unix.questions
Followup-To: comp.unix.programmer,comp.unix.questions
Organization: Freie Universitaet Berlin
Lines: 48
Sender: <jens@crowley.physik.fu-berlin.de>
NNTP-Posting-Host: crowley.physik.fu-berlin.de (160.45.33.110)
X-Trace: fu-berlin.de 1005221127 36705056 160.45.33.110 (16 17 19)
X-Orig-Path: not-for-mail
User-Agent: tin/pre-1.4-980618 (UNIX) (Linux/2.2.15 (i686))