Can't figure out how to read file from nmake

前端 未结 3 1279
傲寒
傲寒 2020-12-21 11:47

I am doing something like this:

all: 
    @SET /p filecontent= < somefile.txt
    @echo %filecontent%

However the filecontent

3条回答
  •  一个人的身影
    2020-12-21 12:06

    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]
    

提交回复
热议问题