3 ms·
Unfortunately make's behaviour around dynamically setting variables/environment variables is insane and quickly leads you towards hairy eval commands with extre
by ris 2y ago
Unfortunately make's behaviour around dynamically setting variables/environment variables is insane and quickly leads you towards hairy eval commands with extremely tricky quoting & escaping.
- john-tells-all 2y agoI suggest using := as in `APP_URL := http://localhost http://localhost` vs raw "=". The colon-equals format means "set value now", so it's easier to understand. I've never used eval. Make's use of Bash can lead to hairy quoting/escaping. I use Make as a "dumb high-level runner" and put any sort of intelligence, like conditionals or loops or networking, in lower-level scripts or programs. Make is an orchestrator.