🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42450

Gnu make MACROS and shell return values?

#42450
From: Jon N. Steiger
Date: Sat, 02 Dec 1995 00:00
35 lines
1701 bytes

    Hi...

   I apologize if this is not the right newsgroup to post this to... If it
isn't, could someone please let me know where I should?  

  Could someone tell me how I can execute a (unix) program or sh script and 
have the stdout of that program go into a variable (macro?) in GNU make?

   I have a man page for a make (not gnu) which says you can do this
like:

  MACRO:sh =command

  But gnu make thinks sh is a dependency.  Is there any way to do this?

For example, if you wanted to get the current working directory and save
it in the variable 'CURR_DIR', this other make could do it like:

   CURR_DIR:sh =pwd

   How can I do this with my GNU 3.62 make?  (Or is this even possible?)


   Thanks *very* much in advance!


                                              -Jon-

 .-------------------------------------------------------------------------.
 | Jon Steiger == DoD# 1038 == USUA# A46209 == NMA# 117376 == KotWitDoDFAQ |
 |   stei0302@cs.fredonia.edu  &&  http://www.cs.fredonia.edu/~stei0302/   |
 |   '96 Dakota SLT V-8, '91 FZR600R    /* Just another mangy hacker */    |
 `-------------------------------------------------------------------------'
Technical Details
Message-ID: <DIyCrA.GKn@cs.fredonia.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,59958804fa82f56a,start
X-Google-Attributes: gid11318c,public
From: stei0302@cs.fredonia.edu (Jon N. Steiger)
Subject: Gnu make MACROS and shell return values?
Date: 1995/12/02
Message-ID: <DIyCrA.GKn@cs.fredonia.edu>
X-Deja-AN: 120710893
x-nntp-posting-host: mary.cs.fredonia.edu
sender: news@cs.fredonia.edu (Jin Mazumdar)
organization: Math / CS, State Univ. of NY college at Fredonia
newsgroups: gnu.gcc.help