# $NetBSD$ # # For each commit in usr.bin/make, build 3 variants of make. .MAKE.MODE+= randomize-targets FILTER?= 202?.* V?= 0 CVS_LOG_FILE= ${SRC_DIR}/log CVS_TIMESTAMPS_FILE= ${SRC_DIR}/timestamps NB_SRC_DIR= usr.bin/make SRC_DIR= ${HOME}/proj/make-archive BIN_DIR= ${SRC_DIR}/bin VARIANTS= plain #debug coverage COPTS= -fcommon # before XXXX-XX-XX COPTS.plain= -O2 COPTS.debug= -O0 -ggdb COPTS.coverage= -O0 -ggdb --coverage LDADD.plain= # none LDADD.debug= # none LDADD.coverage= --coverage RUN= ${RUN.${V}} RUN.0= @set -eu; RUN.1= set -eu; RUN.2= set -eux; MAKE_FLAGS.0= -s -j8 MAKE_FLAGS.1= -s -j1 MAKE_FLAGS.2= # none N= ${.newline}${:U } # tab SKIP_TIMESTAMPS+= 2020.01.19.19.42.32 # register_t SKIP_TIMESTAMPS+= 2020.01.19.19.49.36 # filemon_ktrace.c SKIP_TIMESTAMPS+= 2020.01.19.19.49.37 # register_t SKIP_TIMESTAMPS+= 2020.01.19.19.50.54 # VAR_GLOBAL SKIP_TIMESTAMPS+= 2020.08.21.02.20.47 # Lst_Init SKIP_TIMESTAMPS+= 2020.08.28.04.48.56 # Lst_Find SKIP_TIMESTAMPS+= 2020.08.30.11.12.05 # Lst_FindDatum SKIP_TIMESTAMPS+= 2020.09.12.15.03.39 # CompatRunCommand SKIP_TIMESTAMPS+= 2020.10.23.18.36.09 # OP_NOP SKIP_TIMESTAMPS+= 2020.10.25.21.51.48 # GNode_Path SKIP_TIMESTAMPS+= 2020.11.06.20.59.52 # typo: h SKIP_TIMESTAMPS+= 2020.11.28.19.20.03 # GNodeList SKIP_TIMESTAMPS+= 2021.02.04.21.33.13 # VAR_GLOBAL SKIP_TIMESTAMPS+= 2022.09.24.10.26.31 all: .PHONY cvs-timestamps cvs-log: .PHONY ${CVS_LOG_FILE} cvs-timestamps: .PHONY ${CVS_TIMESTAMPS_FILE} fetch-all: .PHONY ${CVS_LOG_FILE}: ${RUN} mkdir -p ${.TARGET:H} ${RUN} cvs -d cvs.NetBSD.org/cvsroot rlog src/${NB_SRC_DIR} > ${.TARGET}.tmp ${RUN} cvs2cl --stdin -r --rcs /cvsroot/src/usr.bin/make <${.TARGET}.tmp ${RUN} mv ${.TARGET}.tmp ${.TARGET} ${CVS_TIMESTAMPS_FILE}: ${CVS_LOG_FILE} ${RUN} awk '/^date:/ && $$4 == "+0000;" { \ gsub("-", ".", $$2); \ gsub(":", ".", $$3); \ print($$2 "." $$3); \ }' < ${.ALLSRC} | sort -r -u > ${.TARGET}.tmp ${RUN} mv -f ${.TARGET}.tmp ${.TARGET} .if exists(${CVS_TIMESTAMPS_FILE}) . for ts in ${:!cat ${CVS_TIMESTAMPS_FILE}!:M${FILTER}:${SKIP_TIMESTAMPS:S,^,N,:ts:}} .PHONY: ${ts} fetch-${ts} diff-${ts} SUBDIR.${ts}= ${ts:C,^(....)\.(..)\.(..)\.(..)\.(..)\.(..)$,\1/\2-\3/\4-\5-\6,} BASE_DIR.${ts}= ${SRC_DIR}/${SUBDIR.${ts}} DISTFILES_DIR.${ts}= ${BASE_DIR.${ts}}/distfiles FETCH_COOKIE.${ts}= ${BASE_DIR.${ts}}/fetch_done all: ${ts} fetch-all: fetch-${ts} fetch-${ts}: .PHONY ${FETCH_COOKIE.${ts}} ${FETCH_COOKIE.${ts}}: @echo '=> Fetching ${ts}' ${RUN} $N$\ dir=${DISTFILES_DIR.${ts}}; $N$\ rm -rf "$$dir"; $N$\ mkdir -p "$$dir/CVS"; $N$\ cd "$$dir"; $N$\ echo 'src/${NB_SRC_DIR}' > "CVS/Repository"; $N$\ echo 'cvs.NetBSD.org:/cvsroot' > "CVS/Root"; $N$\ echo '' > "CVS/Entries"; $N$\ cvs -Q update -D${ts} -C ${RUN} > ${.TARGET} . for variant in ${VARIANTS} . for build in ${ts}-${variant} ${ts}: .PHONY install-${build} BUILD_DIR.${build}= ${BASE_DIR.${ts}}/${variant} EXTRACT_COOKIE.${build}=${BASE_DIR.${ts}}/${variant}-extract_done PATCH_COOKIE.${build}= ${BASE_DIR.${ts}}/${variant}-patch_done BUILD_COOKIE.${build}= ${BASE_DIR.${ts}}/${variant}-build_done INSTALL_COOKIE.${build}=${BASE_DIR.${ts}}/${variant}-install_done SRC_PROGRAM.${build}= ${BUILD_DIR.${build}}/make BIN_PROGRAM.${build}= ${BIN_DIR}/make-${build} MAKE_ENV.${build}= COPTS=${COPTS}\ ${COPTS.${build}:Q}\ ${COPTS.${variant}:Q} MAKE_ENV.${build}+= LDADD=${LDADD.${variant}:Q} MAKE_ENV.${build}+= _MKMSG=: MAKE_ENV.${build}+= NETBSDSRCDIR=${HOME}/proj/src MAKE_ENV.${build}+= NOGCCERROR=yes .if exists(${BIN_PROGRAM.${build}}) .MADE: ${ts} .endif ${EXTRACT_COOKIE.${build}}: ${FETCH_COOKIE.${ts}} ${RUN} rm -rf ${BUILD_DIR.${build}} ${RUN} cp -R ${DISTFILES_DIR.${ts}} ${BUILD_DIR.${build}} ${RUN} > ${.TARGET} ${PATCH_COOKIE.${build}}: ${EXTRACT_COOKIE.${build}} .if ${ts:M199*} ${RUN} cd ${BUILD_DIR.${build}} && sed -i 's,varargs,stdarg,' main.c parse.c .endif ${RUN} > ${.TARGET} ${BUILD_COOKIE.${build}}: ${PATCH_COOKIE.${build}} @echo '=> Building ${build}' ${RUN} $N$\ dir=${BUILD_DIR.${build}}; $N$\ cd "$$dir"; $N$\ make ${MAKE_FLAGS.$V} cleandir > /dev/null; $N$\ ${MAKE_ENV.${build}} make ${MAKE_FLAGS.$V} all ${RUN} > ${.TARGET} install-${build}: ${BIN_PROGRAM.${build}} ${BIN_PROGRAM.${build}}: ${BUILD_COOKIE.${build}} @echo '=> Installing ${build}' ${RUN} install -m 555 ${SRC_PROGRAM.${build}} ${.TARGET} . endfor . endfor . endfor . for ts in ${:!cat timestamps!} diff-${ts}: .PHONY cvs -d cvs.NetBSD.org:/cvsroot rdiff -D${ts:C [0-5][0-9]$ 00 } -D${ts} src/usr.bin/make . endfor .endif refresh: .PHONY ${RUN} rm -f log timestamp ChangeLog ${RUN} make ${RUN} make show-missing: .PHONY .if exists(${CVS_TIMESTAMPS_FILE}) . for ts in ${:!cat ${CVS_TIMESTAMPS_FILE}!:M${FILTER}:${SKIP_TIMESTAMPS:S,^,N,:ts:}} . for variant in ${VARIANTS} . for build in ${ts}-${variant} . if !exists(${BIN_DIR}/make-${build}) ${RUN} echo ${build:Q} . endif . endfor . endfor . endfor .endif