Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
pkkim
on Aug 18, 2017
|
parent
|
context
|
favorite
| on:
Afraid of Makefiles? Don't be
One important tip is that the commands under a target each run sequentially, but in separate shells. So if you went to set env vars, cd, activate a Python virtualenv, etc to affect the next command, you need to make them a single command, like:
target: cd ./dir; ./script.sh
vortico
on Aug 18, 2017
|
next
[–]
cd dir && \ ./script.sh && \ ./otherstuff.sh
handles errors, in case `dir` doesn't exist for example.
cmm
on Aug 18, 2017
|
prev
[–]
There's .ONESHELL for that (as long as we are talking about GNU Make)
Consider applying for YC's Fall 2026 batch!
Applications
are open till July 27.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: