cygwin_path = c:\cygwin\bin
echo = $(cygwin_path)\echo.exe
grep = $(cygwin_path)\grep.exe
#testpath = ..\..\rel\test\path
#testpath = rel\test\path
#testpath = \abs\test\path
testpath = c:\abs\test\path
!if ([ $(echo) '$(testpath)' | $(grep) -q -E '^^(\w:)?\\\\' ] == 0)
type = abs
!else
type = rel
!endif
test:
@$(echo) "testpath = $(testpath)"
@$(echo) "type = $(type)"
Probably there are other solutions, but this is the first I came up with. Another solution would be to use gnu make :-) .
No comments:
Post a Comment