Skip to content

use MAKEFILE_LIST to get the name of the top make file#130

Closed
cantora wants to merge 1 commit into
sudar:masterfrom
cantora:flexible-makefile-name
Closed

use MAKEFILE_LIST to get the name of the top make file#130
cantora wants to merge 1 commit into
sudar:masterfrom
cantora:flexible-makefile-name

Conversation

@cantora
Copy link
Copy Markdown
Contributor

@cantora cantora commented Nov 22, 2013

While using Arduino-Makefile, I had some trouble getting it to work because my make file was called 'makefile'. This commit uses MAKEFILE_LIST to get the name of the top make file so it will work with any capitalization.

this way we dont assume the make file is 'Makefile' so it will
work if named 'makefile'
@sej7278
Copy link
Copy Markdown
Collaborator

sej7278 commented Nov 22, 2013

not sure this is worth the effort - its pretty standard to have all makefiles called "Makefile"

@cantora
Copy link
Copy Markdown
Contributor Author

cantora commented Nov 22, 2013

No big deal if you don't want this, just throwing it out there.

I haven't made a habit of keeping track of how often I see 'makefile' vs 'Makefile' in projects, but the gnu make docs list 'makefile' as valid: http://www.gnu.org/software/make/manual/html_node/Makefile-Names.html

Not sure if there is a more canonical source for "standardness" regarding make files.

@sudar
Copy link
Copy Markdown
Owner

sudar commented Nov 24, 2013

@sej7278 I agree that it is pretty standard to call makefiles as "Makefile", but since this pull request is going to be backward compatible and also removes a hardcoded value, I am thinking of merging it.

But before that, I want to fully understand your concern as well. Any specific reason why you don't want this to be merged.

@matthijskooijman
Copy link
Copy Markdown
Contributor

It's not entirely uncommon to add postfixes to the Makefile names, e.,g Makefile.uno could be an example in this context (and then run with make -f Makefile.uno). In any case, it seems a good idea to support as many (potential) usecases as possible and have as few hardcoded assumptions as possible :-)

Regarding the actual pull request: Does it make sense to take just the first word out of MAKEFILE_LIST? Why not just take all? As an added bonus, your sketches will be recompiled when you pull a new version of Arduino-Makefile, which seems like a good idea to me?

@sej7278
Copy link
Copy Markdown
Collaborator

sej7278 commented Nov 24, 2013

nothing really against it, just didn't see the point, i was a little concerned about firstword as matt says, and also case-insensitive filesystems like on windows

@sudar
Copy link
Copy Markdown
Owner

sudar commented Nov 24, 2013

@sej7278 @matthijskooijman I agree that just using firstword might not be a good idea and we can take in all.

Let me test it in a couple of scenarios to see whether including all will have any issues or not.

@sudar sudar closed this in 24128a1 Dec 5, 2013
@sudar
Copy link
Copy Markdown
Owner

sudar commented Dec 5, 2013

Just merged it.

I also edited the commit so that we use all of MAKEFILE_LIST as suggested by @matthijskooijman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants