Changeset View
Changeset View
Standalone View
Standalone View
share/mk/sys.mk
Show First 20 Lines • Show All 340 Lines • ▼ Show 20 Lines | |||||
# the ports files are modernized, and a reasonable transition | # the ports files are modernized, and a reasonable transition | ||||
# period has passed, include it while we're in a ports tree here | # period has passed, include it while we're in a ports tree here | ||||
# to preserve historic behavior. | # to preserve historic behavior. | ||||
.if exists(${.CURDIR}/../../Mk/bsd.port.mk) | .if exists(${.CURDIR}/../../Mk/bsd.port.mk) | ||||
.include <bsd.cpu.mk> | .include <bsd.cpu.mk> | ||||
.endif | .endif | ||||
.endif # ! Posix | .endif # ! Posix | ||||
# Parse FreeBSD version from /sys/sys/param.h and creates OS_VERSION | |||||
# in the format used by clang's '-target' parameter (i.e. 13.0, 13.10) | |||||
OS_VERSION!=grep '\#define __FreeBSD_version' $${SRCTOP}/sys/sys/param.h |\ | |||||
bdragon: This grep doesn't seem to actually work for some reason. It isn't picking up SRCTOP... | |||||
Done Inline ActionsStrange, it works for me. I appended the following code BLA!=echo '$${SRCTOP}/sys/sys/param.h' .info BLA SRCTOP is ${BLA} and it gives me: # make make: "/root/src/freebsd/share/mk/sys.mk" line 358: BLA SRCTOP is /root/src/freebsd/sys/sys/param.h Explicit target required. Likely "buildworld" is wanted. See build(7). Also, changing /sys/sys/param.h doesn't change OS_VERSION value. If I change /root/src/freebsd//sys/sys/param.h it does change OS_VERSION I tried to reproduce using the shells "csh, bash and sh" and result is ok to me. alfredo: Strange, it works for me.
Does "make -v OS_VERSION" give "13.0" for you?
I appended the… | |||||
Not Done Inline Actionsof course now I'm having trouble reproducing this. I distinctly remember seeing lots of "grep: /sys/sys/param.h not found" but I'm not seeing it anymore. bdragon: of course now I'm having trouble reproducing this. I distinctly remember seeing lots of "grep… | |||||
Not Done Inline ActionsOne $ is what you want since SRCTOP is a makefile variable. .if !defined(OS_VERSION) OS_VERSION!=${SRCTOP}/sys/conf/newvers.sh -V REVISION .export OS_VERSION .endif imp: One $ is what you want since SRCTOP is a makefile variable.
However, I'm 100% sure this is the… | |||||
awk '{ major=int(substr($$3,1,length($$3)-5)); \ | |||||
minor=int(substr($$3,length($$3)-4,2)); \ | |||||
print major "." minor }' |
This grep doesn't seem to actually work for some reason. It isn't picking up SRCTOP...