6363#
6464# Options can be forced by specifying "USE_xxx=1" or can be disabled by using
6565# "USE_xxx=" (empty string). The list of enabled and disabled options for a
66- # given TARGET is enumerated at the end of "make help".
66+ # given TARGET is enumerated at the end of "make help". Most of these options
67+ # support specific xxx_CFLAGS and/or xxx_LDFLAGS that can be individually
68+ # forced. The currently active ones for a given set of options are listed in
69+ # "make opts USE_xxx=1 ...".
6770#
6871# Variables useful for packagers :
6972# CC is set to "cc" by default and is used for compilation only.
875878 @echo " USE_LUA=1 - Support for dynamic processing using Lua"
876879 @echo
877880 @echo " Use 'make help' to print a full explanation of supported targets"
878- @echo " and features."
881+ @echo " and features, and 'make ... opts' to show the variables in use"
882+ @echo " for a given set of build options, in a reusable form."
879883 @echo
880884 @exit 1
881885else
@@ -1110,7 +1114,9 @@ update-version:
11101114 echo " $( SUBVERS) " > SUBVERS
11111115 echo " $( VERDATE) " > VERDATE
11121116
1113- # just display the build options
1117+ # just display the build options. The "USE_*" options and their respective
1118+ # settings are also listed if they're explicitly set on the command line, or if
1119+ # they are not empty. Implicit "USE_*" are not listed.
11141120opts:
11151121 @echo -n ' Using: '
11161122 @echo -n ' TARGET="$(strip $(TARGET))" '
@@ -1120,7 +1126,17 @@ opts:
11201126 @echo -n ' ARCH_FLAGS="$(strip $(ARCH_FLAGS))" '
11211127 @echo -n ' CPU_CFLAGS="$(strip $(CPU_CFLAGS))" '
11221128 @echo -n ' DEBUG_CFLAGS="$(strip $(DEBUG_CFLAGS))" '
1123- @echo " $( strip $( BUILD_OPTIONS) ) "
1129+ @# echo "$(strip $(BUILD_OPTIONS))"
1130+ @$( foreach opt,$( enabled_opts) ,\
1131+ $( if $( subst command line,,$( origin USE_$( opt) ) ) ,,\
1132+ echo -n ' USE_$(opt)=$(USE_$(opt)) ' ; ) \
1133+ $( if $( subst command line,,$( origin $( opt) _CFLAGS) ) ,\
1134+ $( if $( $( opt) _CFLAGS) ,echo -n ' $(opt)_CFLAGS="$($(opt)_CFLAGS)" ' ; ) ,\
1135+ echo -n ' $(opt)_CFLAGS="$($(opt)_CFLAGS)" ' ; ) \
1136+ $( if $( subst command line,,$( origin $( opt) _LDFLAGS) ) ,\
1137+ $( if $( $( opt) _LDFLAGS) ,echo -n ' $(opt)_LDFLAGS="$($(opt)_LDFLAGS)" ' ; ) ,\
1138+ echo -n ' $(opt)_LDFLAGS="$($(opt)_LDFLAGS)" ' ; ) )
1139+ @echo
11241140 @echo ' COPTS="$(strip $(COPTS))"'
11251141 @echo ' LDFLAGS="$(strip $(LDFLAGS))"'
11261142 @echo ' LDOPTS="$(strip $(LDOPTS))"'
0 commit comments