I am doing something like this:
all:
@SET /p filecontent= < somefile.txt
@echo %filecontent%
However the filecontent
variable does not seem to hold the contents of the file somefile.txt
.
Simply ensure somefile.txt
is in acceptable nmake syntax, and then !include
it. Thus:
c:>type somefile.txt
PASSWORD=secret
c:>type makefile
!INCLUDE somefile.txt
!MESSAGE Password is [$(PASSWORD)]
c:>nmake -nologo
Password is [secret]