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 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

Add a New Comment Rich Markup
   

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>

 

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

Attach Files:
   
   
Comment:
   

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    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.

     

    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.13-4448.
    Corresponding source code