bugmake - Bugs: bug #35493, Provide access to existing...

 
 

bug #35493: Provide access to existing platform type data via a builtin variable

Submitter:  David Boyce <boyski>
Submitted:  Thu 09 Feb 2012 05:08:57 PM UTC
   
 
Severity:  3 - Normal Priority:  5 - Normal
Item Group:  Enhancement Status:  Fixed
Privacy:  Public Assigned to:  psmith
Open/Closed:  Closed Component Version:  4.0
Operating System:  Any Fixed Release:  4.0
Triage Status:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Sun 15 Sep 2013 12:22:50 AM UTC, comment #1: 

A new variable $(MAKE_HOST) is in the next release.  Thanks.

Paul D. Smith <psmith>
Group administrator
Thu 09 Feb 2012 05:08:57 PM UTC, original submission:  

There are thousands of makefiles containing logic like this

uname := $(shell uname -s) # or worse, "="

ifneq (,$(filter Linux,$(uname)))
  LINUX_HOST := 1
else ifneq (,$(filter CYGWIN%,$(uname)))
  CYGWIN_HOST := 1
else ...
endif

This is complicated, duplicative, hard to read, has portability issues due to relying on a Unix utility, etc. Meanwhile make already contains a variable "make_host" describing the platform it was built for, and a one-line patch can make it available within makefiles:

  define_variable_cname ("MAKE_HOST_TYPE", make_host, o_default, 0);

The attached patch also includes documentation.

David Boyce <boyski>

 

Attached Files

Attached Files
file #25038:  make_host.diff added by boyski (1.7KiB - application/octet-stream)

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by boyski (Submitted the item)
  •  

    Votes

    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.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

    History

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-09-15 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Operating SystemNone Any
        Fixed ReleaseNone 4.0
    2012-02-09 boyski Attached File- Added make_host.diff, #25038

    Back to the top

    Powered by Savane 3.16-2753.
    Corresponding source code