bugmake - Bugs: bug #57680, Feature request "import"

 
 

bug #57680: Feature request "import"

Submitter:  Yannick DAVELUY <ydaveluy>
Submitted:  Mon 27 Jan 2020 06:40:07 PM UTC
   
 
Severity:  3 - Normal Priority:  5 - Normal
Item Group:  Enhancement Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Component Version:  4.3
Operating System:  Any Fixed Release:  None
Triage Status:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Mon 27 Jan 2020 06:40:07 PM UTC, original submission:  

Hello,

I developed a new feature that import a makefile.


It is similar to include feature except that if the imported makefile is in a different directory all rules using relative path remains relative to the imported makefile and not the parent one.

To achieve this, make does a chdir in the imported makefile directory before reading it, prefix relative targets and prerequisites with the path of the imported makefile and does a chdir before executing commands.

With import feature it is possible to do things like this:

$ path/to/a.mk:

relative_target : relative_prerequisite /prerequisite
        cmd1

/target : relative_prerequisite /prerequisite
        cmd2

$ b.mk

import path/to/a.mk



> make -f b.mk


In this example make will create the following rules:

path/to/relative_target : path/to/relative_prerequisite /prerequisite
        cmd1

/target : path/to/relative_prerequisite /prerequisite
        cmd2

cmd1 and cmd2 are executed in path/to/ directory.

This feature is on my repo:
https://github.co ... ee/feature_import

Can you give me a feedback ?

I can write some unit test and improve the code if needed.

Yannick


Yannick DAVELUY <ydaveluy>

 

Attached Files

This item currently has no attached files.

(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

 

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

No changes have been made to this item

Back to the top

Powered by Savane 3.16-2753.
Corresponding source code