I've come across this question whenever I want a make command to display a file that resulted from following a particular recipe using the operating system's default application for opening that type of file.
For example... I work primarily in Linux. I can generate and view documentation of my code with make docs
where I have put the following in my Makefile:
docs:
cd ${DIR_WORKING}/doc/; doxygen Doxyfile
xdg-open ${DIR_WORKING}/doc/html/index.html &
I want to use make docs
in Windows and have the same effect. I could alternatively use a user-assigned variable like a $(OPEN)
in place of xdg-open
. Is there a way to open a file using the default program in Windows and Linux without requiring the user to modify the Makefile? I've never used Autoconf for my codes and hope there is a solution that doesn't depend on going in that direction.