common/build-style/gnu-makefile.sh: define prefix, PREFIX for build

this allows removing the definition from templates, and avoids issues
where the prefix is used during build.
This commit is contained in:
classabbyamp 2022-08-22 00:40:54 -04:00
parent 2760187144
commit e14cf6cc7a
No known key found for this signature in database
GPG Key ID: 6BE0755918A4C7F5
1 changed files with 3 additions and 1 deletions

View File

@ -9,8 +9,10 @@ do_build() {
CC="$CC" CXX="$CXX" LD="$LD" AR="$AR" RANLIB="$RANLIB" \
CPP="$CPP" AS="$AS" OBJCOPY="$OBJCOPY" OBJDUMP="$OBJDUMP" \
CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \
PREFIX=/usr prefix=/usr \
${makejobs} ${make_build_args} ${make_build_target}
else
export PREFIX=/usr prefix=/usr
${make_cmd} ${makejobs} ${make_build_args} ${make_build_target}
fi
}
@ -37,5 +39,5 @@ do_install() {
: ${make_cmd:=make}
: ${make_install_target:=install}
${make_cmd} STRIP=true PREFIX=/usr DESTDIR=${DESTDIR} ${make_install_args} ${make_install_target}
${make_cmd} STRIP=true PREFIX=/usr prefix=/usr DESTDIR=${DESTDIR} ${make_install_args} ${make_install_target}
}