patchmake - Patches: patch #7, Feature addition: Change a global...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #7: Feature addition: Change a global variable from a function

Submitter:  Jason Wessel <jwessel>
Submitted:  Thu 03 May 2001 05:49:41 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Fixed Release:  None

Wed 04 Jun 2003 06:40:58 PM UTC, comment #1: 

This capability now exists in the standard GNU make using the $(eval ...) function, available starting in GNU make 3.80.  So, I'm closing this but let me know if you don't think it should be closed.

Paul D. Smith <psmith>
Group administrator
Thu 03 May 2001 05:49:41 PM UTC, original submission:  

This patch to 3.79.1 that facilitates changing a
variable from a function.

The name of the function is "globalvar"

The following variable assignments are therefore the same:
  a_variable := "message"
  $(globalvar a_variable,"message")

The use this was needed this for was to collect objects
from the command part of a rule ie
.PHONY : BATCH1
complist1: 1.o 2.o BATCH1

1.c: foo.h bar.h
2.c: bar.h

1.o: 1.c
    $(globalvar targlist1,${targlist1} $<)
2.o: 2.c
    $(globalvar targlist1,${targlist1} $<)

BATCH1:
    @if [ "${targlist1}" = "" ] ; then\
       echo "Targets up to date.";\
    else\
       echo **building**: Batched ${targlist1};\
       gcc -c ${targlist1};\
    fi


Sure there are ways to build a compile list using the
shell function to output to a local file list
but this leaves garbage intermediate files
plus it is not efficient.


Jason Wessel <jwessel>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #4033:  patch_item_7.patch added by jwessel (3KiB - text/plain - patch item 7)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2003-06-04 psmith patch_status_id1
    Assigned toNone None
    Closed on- -

Back to the top

Powered by Savane 3.13-aa77.
Corresponding source code