c++ - Microsoft nmake: Is it possible to define macros from shell command output? -
i trying save svn revision info macro while making code microsoft visual studio's nmake.
in gnu make, like:
svn_revision=r$(shell svnversion -n)
so example: svn_revision=r10001
is possible in microsoft nmake too?
thank in advance.
using techniques mentioned along recursive call make, can done way:
!ifndef make make=nmake !endif !ifndef svn_revision ! if [echo off && /f "usebackq" %i in (`svnrevision -n`) set svn_revision=%i && $(make) /$(makeflags) /nologo /f $(makedir)\makefile && exit /b ] == 0 ! message make completed ! else ! error error in nmake ! endif !else # $(svn_revision) contains string returned command `svnrevision -n` !message svn_revision $(svn_revision) # put parts of makefile depend on svn_revision here !endif # # valid makefile must have rules perform all: @echo;$(svn_revision)
Comments
Post a Comment