Skip to main content
added 43 characters in body
Source Link
Pavel P
  • 17.3k
  • 11
  • 91
  • 143

cat doesn't exist on Windows. Solution for those who care that make file works onfor Linux and Windows as well:

cat := $(if $(filter $(OS),Windows_NT),type,cat) variable := $(shell $(cat) filename) 

Explanation: Seems like On Windows there is always OS environment variable defined to be equal to 'Windows_NT'. This way, for Windows typetype command is used, for non-Windows cat is used.

Solution for those who care that make file works on Windows as well:

cat := $(if $(filter $(OS),Windows_NT),type,cat) variable := $(shell $(cat) filename) 

Explanation: Seems like On Windows there is always OS environment variable defined to be equal to 'Windows_NT'. This way, for Windows type command is used.

cat doesn't exist on Windows. Solution that works for Linux and Windows:

cat := $(if $(filter $(OS),Windows_NT),type,cat) variable := $(shell $(cat) filename) 

Explanation: Seems like On Windows there is always OS environment variable defined to be equal to 'Windows_NT'. This way, for Windows type command is used, for non-Windows cat is used.

Source Link
Pavel P
  • 17.3k
  • 11
  • 91
  • 143

Solution for those who care that make file works on Windows as well:

cat := $(if $(filter $(OS),Windows_NT),type,cat) variable := $(shell $(cat) filename) 

Explanation: Seems like On Windows there is always OS environment variable defined to be equal to 'Windows_NT'. This way, for Windows type command is used.