all: ${PROG}
# Special
-.PHONY: clean distclean check_config
+.PHONY: clean distclean check_config reconfigure
# Check configure output is valid
check_config:
|| echo "./configure output is old, please re-run"
@test $(CURDIR)/.config.mk -nt $(CURDIR)/configure
+# Recreate configuration
+reconfigure:
+ $(CURDIR)/configure $(CONFIGURE_ARGS)
+
# Binary
${PROG}: check_config $(OBJS) $(ALLDEPS)
$(CC) -o $@ $(OBJS) $(CFLAGS) $(LDFLAGS)
CONFIG_MK=${ROOTDIR}/.config.mk
cat > ${CONFIG_MK} <<EOF
# Automatically generated by configure - DO NOT EDIT!
+CONFIGURE_ARGS = ${BASH_ARGV[*]}
ROOTDIR ?= ${ROOTDIR}
BUILDDIR ?= ${ROOTDIR}/build.${PLATFORM}
OSENV ?= ${OSENV}