From 8d50421afe51abbc28166f78d133b69d49ffd5ba Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 9 Jun 2018 13:39:18 +0800 Subject: [PATCH] mk/crunchgen: Do not hard code the path to the source directories Introduce the variable CRUNCH_PATH_${D} to specify the path to the base source directory ${D}. Update the description and initrd makefiles accordingly. --- initrd/bin/Makefile | 2 ++ initrd/sbin.libcrypto/Makefile | 3 +++ initrd/sbin/Makefile | 2 ++ share/mk/bsd.crunchgen.mk | 5 +++-- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/initrd/bin/Makefile b/initrd/bin/Makefile index 59821370c8..5aca8d6f4a 100644 --- a/initrd/bin/Makefile +++ b/initrd/bin/Makefile @@ -11,6 +11,7 @@ SCRIPTS=dowpa # /usr/include/paths.h as well! You were warned! # CRUNCH_SRCDIRS+= bin +CRUNCH_PATH_bin= ${.CURDIR}/../.. CRUNCH_PROGS_bin= \ cat \ chmod \ @@ -50,6 +51,7 @@ CRUNCH_ALIAS_rm= unlink CRUNCH_SRCDIRS+= usr.bin +CRUNCH_PATH_usr.bin= ${.CURDIR}/../.. CRUNCH_PROGS_usr.bin= du less undo ssh fetch CRUNCH_ALIAS_less= more CRUNCH_ALIAS_ssh= scp diff --git a/initrd/sbin.libcrypto/Makefile b/initrd/sbin.libcrypto/Makefile index bc97af94f0..35f97d798d 100644 --- a/initrd/sbin.libcrypto/Makefile +++ b/initrd/sbin.libcrypto/Makefile @@ -4,6 +4,7 @@ PROG= rescue.libcrypto CRUNCH_SRCDIRS+= sbin +CRUNCH_PATH_sbin= ${.CURDIR}/../.. CRUNCH_PROGS_sbin= tcplay \ md5 \ hammer \ @@ -12,12 +13,14 @@ CRUNCH_PROGS_sbin= tcplay \ ping6 CRUNCH_SRCDIRS+= gnu/sbin +CRUNCH_PATH_gnu/sbin= ${.CURDIR}/../.. CRUNCH_PROGS_gnu/sbin= cryptsetup CRUNCH_LIBS+= -ldm -lprop -ldmsg -lutil -lhammer -lpthread -lm CRUNCH_ALIAS_md5= rmd160 CRUNCH_SRCDIRS+= usr.sbin/802_11 +CRUNCH_PATH_usr.sbin/802_11= ${.CURDIR}/../.. CRUNCH_PROGS_usr.sbin/802_11= wpa_supplicant CRUNCH_LIBS+= -lpcap -lprivate_ssl -lmd -lprivate_crypto CRUNCH_LIBS+= ${PRIVATELIB_LDFLAGS} diff --git a/initrd/sbin/Makefile b/initrd/sbin/Makefile index d0adfa39cd..e7065e5c9a 100644 --- a/initrd/sbin/Makefile +++ b/initrd/sbin/Makefile @@ -6,6 +6,7 @@ PROG= rescue.sbin SCRIPTS= ${.CURDIR}/../../sbin/dhclient/dhclient-script CRUNCH_SRCDIRS+= sbin +CRUNCH_PATH_sbin= ${.CURDIR}/../.. CRUNCH_PROGS_sbin= \ camcontrol \ ccdconfig \ @@ -65,6 +66,7 @@ CRUNCH_LIBS+= -lbsdxml CRUNCH_LIBS+= ${PRIVATELIB_LDFLAGS} CRUNCH_SRCDIRS+= usr.sbin +CRUNCH_PATH_usr.sbin= ${.CURDIR}/../.. CRUNCH_PROGS_usr.sbin= boot0cfg chroot .include diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index a31d143ea7..3249163323 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -4,7 +4,8 @@ # Make variables used to generate the crunchgen(1) config file: # # CRUNCH_SRCDIRS Directories to search for included programs -# CRUNCH_PROGS Programs to be included +# CRUNCH_PATH_${D} Path to the source directory ${D} +# CRUNCH_PROGS_${D} Programs to be included inside directory ${D} # CRUNCH_LIBS Libraries to be statically linked with # CRUNCH_SHLIBS Libraries to be dynamically linked with # CRUNCH_BUILDOPTS Build options to be added for every program @@ -40,7 +41,7 @@ CLEANFILES+= ${CONF} *.o *.lo *.c *.mk *.cache *.a *.h # Set a default SRCDIR for each for simpler handling below. .for D in ${CRUNCH_SRCDIRS} .for P in ${CRUNCH_PROGS_${D}} -CRUNCH_SRCDIR_${P}?= ${.CURDIR}/../../${D}/${P} +CRUNCH_SRCDIR_${P}?= ${CRUNCH_PATH_${D}}/${D}/${P} .endfor .endfor -- 2.41.0