move some rules into 1337.mk
A number of rules have been moved from entry `Makefile`s into the `1337.mk` include file to make it easier for these common rules to be updated or modified globally (by modifying the `1337.mk` include file). The entry level `Makefile`s are now similar in form to the /Makefile.example](https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example) file from the other repo. The following make rules were moved into the `1337.mk` include file: - `make indent.c` - `make install` - `make diff_orig_prog` - `make diff_prog_orig` - `make diff_alt_prog` - `make diff_prog_alt` This simplifies the entry level `Makefile`s so that they mostly reflect the specifics of the particular entry. Mentioned in FAQ 4.2, that the make diff rules are in the `1337.mk` include file. Fixed invalid TAB character in `faq.md`. Removed `make clean` directives that removed `indent.c`. This file is now removed via `make indent_clean`, a clean rule that also removes `indent.c`. Removed `make clobber` directives that removed sandwich, This file is now removed via `make indent_clobber`, a clean rule that also removes `sandwich`. Added `make indent_clean` and `make indent_clobber` rules into the top level `Makefile` and the year level `YYYY/Makefile`. Performed `make quick_www` to accomplish the above and to test under macOS.
This commit is contained in:
1 parent
06ae40f99c
commit
96e0f2b966
353 files changed
+2088
-25506
No files matched your search
+1
-77
@@ -127,10 +127,7 @@ ALT_TARGET=
|
||||
all: data ${TARGET}
|
||||
@${TRUE}
|
||||
|
||||
.PHONY: all alt data everything diff_orig_prog diff_prog_orig \
|
||||
diff_alt_prog diff_prog_alt diff_orig_alt diff_alt_orig \
|
||||
clean clobber install love haste waste maker easter_egg \
|
||||
sandwich supernova deep_magic magic charon pluto
|
||||
.PHONY: all alt data everything clean clobber
|
||||
|
||||
${PROG}: ${PROG}.c
|
||||
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
||||
@@ -151,89 +148,16 @@ everything: all alt
|
||||
@${TRUE}
|
||||
|
||||
|
||||
#####################
|
||||
# make a difference #
|
||||
#####################
|
||||
#
|
||||
# diff orig source and source
|
||||
#
|
||||
diff_orig_prog: ${PROG}.orig.c ${PROG}.c
|
||||
@-${DIFF} -u ${PROG}.orig.c ${PROG}.c
|
||||
|
||||
# diff source and orig source
|
||||
#
|
||||
diff_prog_orig: ${PROG}.c ${PROG}.orig.c
|
||||
@-${DIFF} -u ${PROG}.c ${PROG}.orig.c
|
||||
|
||||
# diff alt source and source
|
||||
#
|
||||
diff_alt_prog: ${PROG}.c
|
||||
@-if [[ -e ${PROG}.alt.c ]]; then \
|
||||
${DIFF} -u ${PROG}.alt.c ${PROG}.c; \
|
||||
fi
|
||||
|
||||
# diff source and alt source
|
||||
#
|
||||
diff_prog_alt: ${PROG}.c
|
||||
@-if [[ -e ${PROG}.alt.c ]]; then \
|
||||
${DIFF} -u ${PROG}.c ${PROG}.alt.c; \
|
||||
fi
|
||||
|
||||
# diff orig and alt
|
||||
#
|
||||
diff_orig_alt: ${PROG}.orig.c
|
||||
@-if [[ -e ${PROG}.alt.c ]]; then \
|
||||
${DIFF} -u ${PROG}.orig.c ${PROG}.alt.c; \
|
||||
fi
|
||||
|
||||
# diff alt and orig
|
||||
diff_alt_orig:
|
||||
@-if [[ -e ${PROG}.alt.c ]]; then \
|
||||
${DIFF} -u ${PROG}.alt.c ${PROG}.orig.c; \
|
||||
fi
|
||||
|
||||
|
||||
###############
|
||||
# utility rules
|
||||
###############
|
||||
#
|
||||
clean:
|
||||
${RM} -f ${OBJ} ${ALT_OBJ}
|
||||
@-if [ -f indent.c ]; then \
|
||||
echo ${RM} -f indent.c; \
|
||||
${RM} -f indent.c; \
|
||||
fi
|
||||
|
||||
clobber: clean
|
||||
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||
${RM} -rf *.dSYM
|
||||
@-if [ -e sandwich ]; then \
|
||||
${RM} -f sandwich; \
|
||||
echo 'ate sandwich'; \
|
||||
fi
|
||||
|
||||
install:
|
||||
@echo "Dr. Spock says that is not logical!"
|
||||
@${TRUE}
|
||||
|
||||
# you may be able to misunderstand the source by reading indent.c
|
||||
#
|
||||
indent.c: ${PROG}.c
|
||||
@if which "${GINDENT}" >/dev/null 2>&1; then \
|
||||
echo ${RM} -f $@; \
|
||||
${RM} -f $@; \
|
||||
echo "${GINDENT} < $< > $@"; \
|
||||
${GINDENT} < $< > $@; \
|
||||
elif which "${INDENT}" >/dev/null 2>&1; then \
|
||||
echo ${RM} -f $@; \
|
||||
${RM} -f $@; \
|
||||
echo "${INDENT} < $< > $@"; \
|
||||
${INDENT} < $< > $@; \
|
||||
else \
|
||||
echo "no indent tool found, ident $< yourself, sorry"; \
|
||||
echo "exit 17"; \
|
||||
exit 17; \
|
||||
fi
|
||||
|
||||
|
||||
######################################
|
||||
|
||||
Reference in new issue
Block a user