commit 9dce97329bc680a1dc7d1560174024034664fc78 from: Benjamin Stürz date: Thu Nov 14 17:37:17 2024 UTC make: update TODO commit - 440a47ba473494ce5e7502a23bce7e6ed275d4ce commit + 9dce97329bc680a1dc7d1560174024034664fc78 blob - cee2108024a52034fa39f930cd96db0e6fcb714a (mode 644) blob + /dev/null --- make/TODO +++ /dev/null @@ -1,9 +0,0 @@ -- write a useful README about how this make differs from all the other makes -- options: -q, -k -- make this work: - === MyMakefile - CFLAGS = -ansi - .export CFLAGS - - === sub/MyMakefile - CFLAGS += -Wall blob - /dev/null blob + 1c2017221053a7bda8cbe2a6261835d02acdfa84 (mode 644) --- /dev/null +++ make/TODO.md @@ -0,0 +1,79 @@ +# Write a useful README about how this make differs from all the other makes +- Current situation of using make in big projects + +# Write a tutorial on how to correctly use this make + +# Options +-q check if anythings needs to be built +-k keep going, even after an error happened +-h print a generated help page + +# `+=` Operator +## MyMakefile +```make +CFLAGS = -ansi +.export CFLAGS +``` + +## sub/MyMakefile +``` +CFLAGS += -Wall +``` + +# Doc comments for help page +```make +## build the code base +all: a b + +## delete build artifacts +clean: + +## build component "a" +a: + +## build component "b" +b: +``` + +# Templates +## MyMakefile +```make +.template prog +PREFIX ?= /usr +SRC ?= ${NAME}.c + +all: ${NAME} + +clean: + rm -f ${NAME} *.o + +install: ${NAME} + mkdir -p ${DESTDIR}${PREFIX}/bin + cp -f ${NAME} ${DESTDIR}${PREFIX}/bin/ + +${NAME}: ${SRC} + ${CC} -o $@ ${SRC} +.endt +``` + +## cat/MyMakefile +```make +NAME = cat + +.inst prog +``` + +# Conditionals +```make +NOMAN = 1 + +.if ${NOMAN} == 1 +install-man: +.else +install-man: ${NAME}.1 + mkdir -p ${DESTDIR}${MANPREFIX}/man1 + cp -f ${NAME}.1 ${DESTDIR}${MANPREFIX}/man1/ +.endif +``` + +# Create a freestanding version, written in Rust, so that other projects can use this make