c++ - makefile setting different linker flags for different archtectures -



want 1 make file compile , link on windows (into mylib.dll) , @ least 2 linux architectures, i686 , armv61 (into mylib.so).

if 'set' linker flags manually, code compile / links ok.

but want set linker flags based upon arc values, see snippet.

<code> arch = "?" arch = $(shell arch) $(info arch  [$(arch)]) ld_flags = "?" ifeq  "$(arch)" "i686" ld_flags = -shared -lsdl endif ifeq  "$(arch)" "armv61" ld_flags = -shared -lsdl -l/usr/lib/arm-linux-gnueabihf  endif $(info ld_flags [$(ld_flags)]) </code> 

on i686 :

<code> arch  [i686] ld_flags [-shared -lsdl] make: nothing done 'all'. </code> 

on armv61 :

<code> arch  [armv6l] ld_flags ["?"] ... (error stuff!) </code> 

so arch set ok ld_flags not, i'm doing stupid ifeq etc.

any idea error is, how fix make file?

thanks.

you wrote 1 instead of l (armv6l vs armv61)


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -