{"action":"closed","number":337,"pull_request":{"url":"https://api.github.com/repos/sudar/Arduino-Makefile/pulls/337","id":32183215,"node_id":"MDExOlB1bGxSZXF1ZXN0MzIxODMyMTU=","html_url":"https://github.com/sudar/Arduino-Makefile/pull/337","diff_url":"https://github.com/sudar/Arduino-Makefile/pull/337.diff","patch_url":"https://github.com/sudar/Arduino-Makefile/pull/337.patch","issue_url":"https://api.github.com/repos/sudar/Arduino-Makefile/issues/337","number":337,"state":"closed","locked":false,"title":"Replaced sub-make with function calls","user":{"login":"michaelbaisch","id":1899691,"node_id":"MDQ6VXNlcjE4OTk2OTE=","avatar_url":"https://avatars1.githubusercontent.com/u/1899691?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelbaisch","html_url":"https://github.com/michaelbaisch","followers_url":"https://api.github.com/users/michaelbaisch/followers","following_url":"https://api.github.com/users/michaelbaisch/following{/other_user}","gists_url":"https://api.github.com/users/michaelbaisch/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelbaisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelbaisch/subscriptions","organizations_url":"https://api.github.com/users/michaelbaisch/orgs","repos_url":"https://api.github.com/users/michaelbaisch/repos","events_url":"https://api.github.com/users/michaelbaisch/events{/privacy}","received_events_url":"https://api.github.com/users/michaelbaisch/received_events","type":"User","site_admin":false},"body":"By not using sub-make but function calls one is able to use this as a global makefile.\n\nLet's say you want to use this makefile in a script or app and don't want to have a makefile in every project folder.\nThis could be done like this:\n\n```\n# Set environment variables\n$ cd ~/my-arduino-project\n$ make -f ~/Arduino-makefile/Arduino.mk\n```\n\nBut using `upload` isn't working because it's using sub-make:\n\n```\n$ make -f ~/Arduino-makefile/Arduino.mk upload\nmake[1]: *** No rule to make target `reset'.  Stop.\nmake: *** [upload] Error 2\n```\n\nIs the use of sub-make appropriate here? Because no separate makefile is used.\n\nhttps://www.gnu.org/software/make/manual/html_node/Recursion.html\n\n> This technique is useful when you want separate makefiles for various subsystems that compose a larger system. For example, suppose you have a subdirectory ‘subdir’ which has its own makefile, and you would like the containing directory’s makefile to run make on the subdirectory.\n> \n> subsystem:\n> &nbsp;&nbsp;&nbsp;&nbsp;cd subdir && $(MAKE)\n\nThe problem is that the -f flag isn't passed down, which makes sense if you use sub-make for separate makefiles.\n\nhttps://www.gnu.org/software/make/manual/html_node/Options_002fRecursion.html\n\n> The options ‘-C’, ‘-f’, ‘-o’, and ‘-W’ are not put into MAKEFLAGS; these options are not passed down.\n\nMy suggestion is to use functions instead of sub-make.\nI'm aware that this is a specific problem and maybe there is a cleaner solution.\n","created_at":"2015-03-29T15:29:35Z","updated_at":"2018-09-30T15:14:10Z","closed_at":"2018-09-30T15:14:10Z","merged_at":null,"merge_commit_sha":"b25ae8c2f2980f3548ba91810da20f44596f387c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":433254,"node_id":"MDU6TGFiZWw0MzMyNTQ=","url":"https://api.github.com/repos/sudar/Arduino-Makefile/labels/wontfix","name":"wontfix","color":"ffffff","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/sudar/Arduino-Makefile/pulls/337/commits","review_comments_url":"https://api.github.com/repos/sudar/Arduino-Makefile/pulls/337/comments","review_comment_url":"https://api.github.com/repos/sudar/Arduino-Makefile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sudar/Arduino-Makefile/issues/337/comments","statuses_url":"https://api.github.com/repos/sudar/Arduino-Makefile/statuses/f98369a503f84952ff3780e99d831865b2e71976","head":{"label":"michaelbaisch:replace-sub-make","ref":"replace-sub-make","sha":"f98369a503f84952ff3780e99d831865b2e71976","user":{"login":"michaelbaisch","id":1899691,"node_id":"MDQ6VXNlcjE4OTk2OTE=","avatar_url":"https://avatars1.githubusercontent.com/u/1899691?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelbaisch","html_url":"https://github.com/michaelbaisch","followers_url":"https://api.github.com/users/michaelbaisch/followers","following_url":"https://api.github.com/users/michaelbaisch/following{/other_user}","gists_url":"https://api.github.com/users/michaelbaisch/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelbaisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelbaisch/subscriptions","organizations_url":"https://api.github.com/users/michaelbaisch/orgs","repos_url":"https://api.github.com/users/michaelbaisch/repos","events_url":"https://api.github.com/users/michaelbaisch/events{/privacy}","received_events_url":"https://api.github.com/users/michaelbaisch/received_events","type":"User","site_admin":false},"repo":{"id":33070456,"node_id":"MDEwOlJlcG9zaXRvcnkzMzA3MDQ1Ng==","name":"Arduino-Makefile","full_name":"michaelbaisch/Arduino-Makefile","private":false,"owner":{"login":"michaelbaisch","id":1899691,"node_id":"MDQ6VXNlcjE4OTk2OTE=","avatar_url":"https://avatars1.githubusercontent.com/u/1899691?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelbaisch","html_url":"https://github.com/michaelbaisch","followers_url":"https://api.github.com/users/michaelbaisch/followers","following_url":"https://api.github.com/users/michaelbaisch/following{/other_user}","gists_url":"https://api.github.com/users/michaelbaisch/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelbaisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelbaisch/subscriptions","organizations_url":"https://api.github.com/users/michaelbaisch/orgs","repos_url":"https://api.github.com/users/michaelbaisch/repos","events_url":"https://api.github.com/users/michaelbaisch/events{/privacy}","received_events_url":"https://api.github.com/users/michaelbaisch/received_events","type":"User","site_admin":false},"html_url":"https://github.com/michaelbaisch/Arduino-Makefile","description":"Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.","fork":true,"url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile","forks_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/forks","keys_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/teams","hooks_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/hooks","issue_events_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/issues/events{/number}","events_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/events","assignees_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/assignees{/user}","branches_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/branches{/branch}","tags_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/tags","blobs_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/git/refs{/sha}","trees_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/statuses/{sha}","languages_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/languages","stargazers_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/stargazers","contributors_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/contributors","subscribers_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/subscribers","subscription_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/subscription","commits_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/commits{/sha}","git_commits_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/git/commits{/sha}","comments_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/comments{/number}","issue_comment_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/issues/comments{/number}","contents_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/contents/{+path}","compare_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/merges","archive_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/downloads","issues_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/issues{/number}","pulls_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/pulls{/number}","milestones_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/milestones{/number}","notifications_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/labels{/name}","releases_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/releases{/id}","deployments_url":"https://api.github.com/repos/michaelbaisch/Arduino-Makefile/deployments","created_at":"2015-03-29T11:23:51Z","updated_at":"2015-03-29T11:23:51Z","pushed_at":"2015-03-29T15:02:25Z","git_url":"git://github.com/michaelbaisch/Arduino-Makefile.git","ssh_url":"git@github.com:michaelbaisch/Arduino-Makefile.git","clone_url":"https://github.com/michaelbaisch/Arduino-Makefile.git","svn_url":"https://github.com/michaelbaisch/Arduino-Makefile","homepage":"http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile","size":1487,"stargazers_count":0,"watchers_count":0,"language":"Makefile","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sudar:master","ref":"master","sha":"467b677d8bdebd864548e3fa216222996d8edcca","user":{"login":"sudar","id":103148,"node_id":"MDQ6VXNlcjEwMzE0OA==","avatar_url":"https://avatars1.githubusercontent.com/u/103148?v=4","gravatar_id":"","url":"https://api.github.com/users/sudar","html_url":"https://github.com/sudar","followers_url":"https://api.github.com/users/sudar/followers","following_url":"https://api.github.com/users/sudar/following{/other_user}","gists_url":"https://api.github.com/users/sudar/gists{/gist_id}","starred_url":"https://api.github.com/users/sudar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudar/subscriptions","organizations_url":"https://api.github.com/users/sudar/orgs","repos_url":"https://api.github.com/users/sudar/repos","events_url":"https://api.github.com/users/sudar/events{/privacy}","received_events_url":"https://api.github.com/users/sudar/received_events","type":"User","site_admin":false},"repo":{"id":3570431,"node_id":"MDEwOlJlcG9zaXRvcnkzNTcwNDMx","name":"Arduino-Makefile","full_name":"sudar/Arduino-Makefile","private":false,"owner":{"login":"sudar","id":103148,"node_id":"MDQ6VXNlcjEwMzE0OA==","avatar_url":"https://avatars1.githubusercontent.com/u/103148?v=4","gravatar_id":"","url":"https://api.github.com/users/sudar","html_url":"https://github.com/sudar","followers_url":"https://api.github.com/users/sudar/followers","following_url":"https://api.github.com/users/sudar/following{/other_user}","gists_url":"https://api.github.com/users/sudar/gists{/gist_id}","starred_url":"https://api.github.com/users/sudar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudar/subscriptions","organizations_url":"https://api.github.com/users/sudar/orgs","repos_url":"https://api.github.com/users/sudar/repos","events_url":"https://api.github.com/users/sudar/events{/privacy}","received_events_url":"https://api.github.com/users/sudar/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sudar/Arduino-Makefile","description":"Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.","fork":false,"url":"https://api.github.com/repos/sudar/Arduino-Makefile","forks_url":"https://api.github.com/repos/sudar/Arduino-Makefile/forks","keys_url":"https://api.github.com/repos/sudar/Arduino-Makefile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sudar/Arduino-Makefile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sudar/Arduino-Makefile/teams","hooks_url":"https://api.github.com/repos/sudar/Arduino-Makefile/hooks","issue_events_url":"https://api.github.com/repos/sudar/Arduino-Makefile/issues/events{/number}","events_url":"https://api.github.com/repos/sudar/Arduino-Makefile/events","assignees_url":"https://api.github.com/repos/sudar/Arduino-Makefile/assignees{/user}","branches_url":"https://api.github.com/repos/sudar/Arduino-Makefile/branches{/branch}","tags_url":"https://api.github.com/repos/sudar/Arduino-Makefile/tags","blobs_url":"https://api.github.com/repos/sudar/Arduino-Makefile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sudar/Arduino-Makefile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sudar/Arduino-Makefile/git/refs{/sha}","trees_url":"https://api.github.com/repos/sudar/Arduino-Makefile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sudar/Arduino-Makefile/statuses/{sha}","languages_url":"https://api.github.com/repos/sudar/Arduino-Makefile/languages","stargazers_url":"https://api.github.com/repos/sudar/Arduino-Makefile/stargazers","contributors_url":"https://api.github.com/repos/sudar/Arduino-Makefile/contributors","subscribers_url":"https://api.github.com/repos/sudar/Arduino-Makefile/subscribers","subscription_url":"https://api.github.com/repos/sudar/Arduino-Makefile/subscription","commits_url":"https://api.github.com/repos/sudar/Arduino-Makefile/commits{/sha}","git_commits_url":"https://api.github.com/repos/sudar/Arduino-Makefile/git/commits{/sha}","comments_url":"https://api.github.com/repos/sudar/Arduino-Makefile/comments{/number}","issue_comment_url":"https://api.github.com/repos/sudar/Arduino-Makefile/issues/comments{/number}","contents_url":"https://api.github.com/repos/sudar/Arduino-Makefile/contents/{+path}","compare_url":"https://api.github.com/repos/sudar/Arduino-Makefile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sudar/Arduino-Makefile/merges","archive_url":"https://api.github.com/repos/sudar/Arduino-Makefile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sudar/Arduino-Makefile/downloads","issues_url":"https://api.github.com/repos/sudar/Arduino-Makefile/issues{/number}","pulls_url":"https://api.github.com/repos/sudar/Arduino-Makefile/pulls{/number}","milestones_url":"https://api.github.com/repos/sudar/Arduino-Makefile/milestones{/number}","notifications_url":"https://api.github.com/repos/sudar/Arduino-Makefile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sudar/Arduino-Makefile/labels{/name}","releases_url":"https://api.github.com/repos/sudar/Arduino-Makefile/releases{/id}","deployments_url":"https://api.github.com/repos/sudar/Arduino-Makefile/deployments","created_at":"2012-02-28T11:29:46Z","updated_at":"2018-09-30T14:43:34Z","pushed_at":"2018-09-30T14:43:30Z","git_url":"git://github.com/sudar/Arduino-Makefile.git","ssh_url":"git@github.com:sudar/Arduino-Makefile.git","clone_url":"https://github.com/sudar/Arduino-Makefile.git","svn_url":"https://github.com/sudar/Arduino-Makefile","homepage":"http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile","size":1658,"stargazers_count":1466,"watchers_count":1466,"language":"Makefile","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":365,"mirror_url":null,"archived":false,"open_issues_count":67,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":365,"open_issues":67,"watchers":1466,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sudar/Arduino-Makefile/pulls/337"},"html":{"href":"https://github.com/sudar/Arduino-Makefile/pull/337"},"issue":{"href":"https://api.github.com/repos/sudar/Arduino-Makefile/issues/337"},"comments":{"href":"https://api.github.com/repos/sudar/Arduino-Makefile/issues/337/comments"},"review_comments":{"href":"https://api.github.com/repos/sudar/Arduino-Makefile/pulls/337/comments"},"review_comment":{"href":"https://api.github.com/repos/sudar/Arduino-Makefile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sudar/Arduino-Makefile/pulls/337/commits"},"statuses":{"href":"https://api.github.com/repos/sudar/Arduino-Makefile/statuses/f98369a503f84952ff3780e99d831865b2e71976"}},"author_association":"NONE","merged":false,"mergeable":false,"rebaseable":false,"mergeable_state":"dirty","merged_by":null,"comments":5,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":22,"deletions":14,"changed_files":1}}
{"actor":{"display_login":"sudar"}}