3 ms·
First of all, I would avoid wildcards in compilation rules, using $^ instead, so any leftovers wouldn't hurt. In the case of compilation tool being too stupid,
by dozzie 11y ago
First of all, I would avoid wildcards in compilation rules, using $^ instead,
so any leftovers wouldn't hurt. In the case of compilation tool being too
stupid, I would build a list of expected files out of known/present sources
($(wildcard ...), $(foreach ...), $(patsubst ...)), and then call `rm' before
calling the dumb tool:
rm -f $(filter-out $(EXPECTED),$(FOUND))
- Silhouette 11y agoI appreciate the reply, but unless I've completely missed your point somehow, you didn't actually answer my question there. What I'm looking for is something akin to watchify src/index.js -o dist/index.js -t ... or sass --watch src/index.scss:dist/index.css that handles new or removed files within the source tree gracefully, not just modified files that are already known when you run the command. Whether it's monitoring for changes like these examples, or hot reloading and browser sync'ing, or IDEs that rebuild incrementally in the background so they can give immediate feedback, modern tools that actively monitor for relevant changes and respond to them automatically are noticeably more efficient to work with than traditional tools that run once on demand. Make belongs to a time that has passed, and we could be more productive by retaining the concepts that are as relevant as ever but incorporating them into tools with the more dynamic behaviour that we enjoy in other tools today.