Earthly ➤ https://earthly.dev/youtube
In this video I'm going to show you how variables work in make files. It might seem like a simple topic, but actually, its a bit complex. Make files can get a little bit wild, and follow along with me today, and you'll be the expert at make files in no time.
Whether you're new to Makefiles or looking to level up your skills, this comprehensive video has you covered. We provide a detailed overview of Make's powerful variables, including recursive assignment, simple variables, appending, conditionals, and environment variables. Learn how wildcard functions and automatic variables like $@ can simplify workflows and enhance portability. We also showcase techniques for command chaining, static analysis, and debugging to help you write robust, production-ready Makefiles. Throughout the video, we share Makefile best practices and gotchas when it comes to variable scoping and workflows. You'll walk away with a handy cheat sheet summarizing Make's variable functionality so you can start applying your new Makefile mastery. If you're struggling with messy Make-based builds, Earthly's intuitive syntax provides a cleaner alternative. We demonstrate how Earthly eliminates Makefile madness by encapsulating dependencies and enabling portable, repeatable builds. Whether you're looking to improve existing Makefiles or considering a new approach, this video will equip you with essential knowledge to skillfully manage complexity.
Timeline
00:00 - Intro
00:09 - Assignment
04:03 - Recursive Assignment
04:58 - Appending
06:08 - Conditional Assignment
06:42 - Target Specific Assignment
07:34 - Environment Vars
08:10 - Special Variables
08:55 - Wild Cards
11:02 - Flags
12:39 - Earthly
14:23 - Cheat Sheet