Monday, 15 February 2010

Passing parameters from Python to a makefile -



Passing parameters from Python to a makefile -

as have complicated makefile setup i'm using python intermediate step in series of makefiles give setup - top level makefile identifies libraries need built , calls python script each one. python processing on options , calls library makefile.

in top level this:

$(libs_all): $(python) config/buildtools.py $(makefile) bacon=yes eggs=yes muesli=no

then python script buildtools.py phone call gmake makefile:

call([path_to_gmake, makefile, argv[1], argv[2], argv[3], argv[4]])

this paraphrased little idea. phone call gmake , pass through arguments passed in top level. above, each argv listed explicitly works wonderfully, piece argv[1:] not work. called gmake behaves received no arguments. ideas?

that's because if piece argv create nested list. should do:

call([path_to_gmake, makefile]+argv[1:5])

python makefile

No comments:

Post a Comment