I have a command that works one way in OSX/Unix and another in Debian/Linux. I want to create a make file for my application but need to detect the OS and issue the command accordingly. How would I go about doing this?
You could use uname to do this. In your Makefile, you could write something like:
OS := $(shell uname)
ifeq $(OS) Darwin
# Run MacOS commands
else
# check for Linux and run other commands
endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With