How can I insert a string before the file suffix in a makefile? -


i want copy file insert string before suffix of file

target = executable.exe version = 1.2.3  myrule:     cp $(target) somefunction($(target), $(version)) 

so on windows produces executable1.2.3.exe , on linux produce executable1.2.3 (with target not having .exe well)

do need create 2 rules, 1 windows removes extension , readds , 1 linux concats, or there better way?

you don't have specify .exe extension @ all. windows adds automatically when linking executable file.


if executable created, should trick :

$(cp) $(target) $(basename $(target))$(version)$(suffix $(target)) 

if $(target) has no period in it, $(suffix $(target)) empty string.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -