Ship with Makefile.simple & custom/Makefile.simple

This commit is contained in:
Landon Curt Noll
2021-12-08 14:55:23 -08:00
parent 265713778f
commit e5c8f00adc
8 changed files with 7958 additions and 24 deletions

View File

@@ -4469,21 +4469,42 @@ custom/Makefile: ${MAKE_FILE} custom/Makefile.head custom/Makefile.tail
-e 's;via$$;via ${MAKE} -f ${MAKE_FILE} $@;' >> $@
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
Makefile.simple: ${MAKE_FILE} custom/Makefile.simple
Makefile.simple: Makefile Makefile.ship custom/Makefile.simple
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
${Q} ${RM} -f $@
${Q} if [ -f $@.bak ]; then \
echo "$@.bak exists, remove or move it"; \
exit 1; \
else \
${TRUE}; \
fi
-${Q} if [ -f $@ ]; then \
${MV} -f $@ $@.bak; \
fi
${Q} ${AWK} '/^#if 0/{skp=1} {if(!skp){print $$0}} /^#endif/{skp=0}' \
${MAKE_FILE} | \
Makefile.ship | \
${SED} -e 's/cd custom; $${MAKE} -f Makefile/&.simple/' \
-e 's;^# SRC:.*;# SRC: non-GNU Makefile via;' \
-e 's;via$$;via ${MAKE} -f ${MAKE_FILE} $@;' > $@
-e 's;via$$;via ${MAKE} -f $@ $@;' > $@
${Q} echo >> $@
${Q} echo 'Makefile.simple:' >> $@
${Q} echo ' $${Q} if [ ! -f Makefile.simple ]; then '"\\" >> $@
${Q} echo ' $${CP} -f $${MAKE_FILE} $$@; fi' >> $@
${Q} echo ' $${CP} -f $$@ $$@; fi' >> $@
-${Q} if [ -s $@.bak ]; then \
if ${CMP} -s $@.bak $@; then \
echo 'top level $@ was already up to date'; \
echo 'restoring original $@'; \
${MV} -f $@.bak $@; \
else \
echo 'old $@ is now $@.bak'; \
echo 'updated top level $@ formed'; \
echo 'try: diff -u $@.bak $@'; \
fi; \
else \
echo 'new top level $@ formed'; \
fi
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
custom/Makefile.simple: custom/Makefile
custom/Makefile.simple: Makefile Makefile.ship custom/Makefile
${Q} cd custom; ${MAKE} -f Makefile ${CUSTOM_PASSDOWN} Makefile.simple
#endif /* end of skip for non-Gnu makefiles */
@@ -5035,7 +5056,6 @@ clobber: clean
${RM} -f no_implicit.arg
${RM} -f no_implicit.c no_implicit.o no_implicit${EXT}
#if 0 /* start of skip for non-Gnu makefiles */
${RM} -f Makefile.simple
${RM} -f custom/Makefile
-${MAKE} -f ${MAKE_FILE} custom/Makefile
#endif /* end of skip for non-Gnu makefiles */