several methods of pass/export variable from top/parent make/makefile to sub/child make/makefile
1.
test_value=1234567
export test_value
some_target:
make -f sub_makefile.mak
2.
test_value = 1234567
some_target:
export test_value=$(test_value);
make -f sub_makefile.mak
———-this method equal to———-
#test_value = 1234567
some_target:
test_value = 1234567; export test_value;
make -f sub_makefile.mak
3.
some_target:
make -f sub_makefile.mak test_value = 1234567
——————————————————————
note:
in makefile:
“export test_value=1234567”
is equal to
“test_value=1234567
export test_value”
转载请注明:在路上 » several methods of pass/export variable from top/parent make/makefile to sub/child make/makefile