-.config: ./scripts/config/conf .config.in
- @[ -f .config ] || $(NO_TRACE_MAKE) menuconfig
- @$< -D .config Config.in &> /dev/null
+tmp/.config-%.in: tmp/.%info
+ ./scripts/metadata.pl $*_config < $< > $@ || rm -f $@
+
+.config: ./scripts/config/conf tmp/.config-target.in tmp/.config-package.in
+ if [ \! -f .config ]; then \
+ [ -e $(HOME)/.openwrt/defconfig ] && cp $(HOME)/.openwrt/defconfig .config; \
+ $(NO_TRACE_MAKE) menuconfig; \
+ fi
+ $< -D .config Config.in &> /dev/null