New Makefile Output & Debugging
See original GitHub issueFirst, thanks a ton for the new 0.51.0 Makefile support! This is going to save a bunch of time on Rails & Lambda build times since we typically have to build CSS/JS assets using non-deployment gems. Hence having full control allows our CI/CD (GitHub Actions) to cache different dev/deploy gem vendor directories.
That said, I am new to Makefiles and found their adoption to be a little difficult. I found myself wanting to echo
parts of the build but nothing was showing during sam build
. Is there something this library can do (or myself) when using a Makefile to see what is happing in my own files?
I also realize this just might be having to learn make. But thought I would ask first. Thanks again!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Debugging Makefiles - O'Reilly
The first test I perform on a new makefile target is to invoke make with the --just- print (-n) option. This causes make...
Read more >Debugging Makefiles - The Turing Way
Finally, you can also debug the Makefile by running Make with the debug flag: make -d . This will print all the rules...
Read more >Tool for debugging makefiles - Stack Overflow
The debugging information says which files are being considered for remaking, which file-times are being compared and with what results, which files actually ......
Read more >Debugging Makefiles (1) - Reliable Embedded Systems
The simplest way to find out the value of a macro in a Makefile is to use the $(warning...) function. When GNU Make...
Read more >New Makefile Output & Debugging #2006 - aws/aws-sam-cli
When creating your Makefile it will be easier to initially run make directly while you get things setup. That way you can echo...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
As @smacintyre pointed out, yeah the intention behind the usage of the makefile was so that users can use it to adjust everything as required, before being picked up by sam build.
However, that being said. Streaming the output of triggering the make - build target, seems reasonable.
When creating your Makefile it will be easier to initially run make directly while you get things setup. That way you can echo things and see what is going on. Also, keep in mind that make is going to be called for each function with
Metadata: makefile
set.You can run the build for a function by running following. Where
FUNCTION
is the logical name of your function andPATH
is where you want the files to be deposited for your testing… Then you can see the full output of your function including any echos. By default commands are executed with/bin/sh
.Make is very flexible and worth learning. A quick tutorial is at http://makefiletutorial.com/ . Also check out the GNU Make Standard Library. Once you have it setup you shouldn’t have to modify to much.