Changeset View
Standalone View
Mk/Uses/u-boot.mk
- This file was added.
# $FreeBSD$ | |||||
# | |||||
# Common infrastructure for u-boot ports | |||||
# | |||||
# MAINTAINER: imp@bsdimp.com | |||||
.if !defined(_INCLUDE_USES_U_BOOT_MK) | |||||
_INCLUDE_USES_U_BOOT_MK= yes | |||||
jmcneill: incldue -> include | |||||
Not Done Inline ActionsOK. imp: OK. | |||||
_USES_POST+= u-boot | |||||
# Sanity checks | |||||
.if !defined(UBOOT_MODEL) | |||||
IGNORE+= "UBOOT_MODEL is not defined" | |||||
.endif | |||||
.if !defined(UBOOT_BOARD_CONFIG) | |||||
IGNORE+= "UBOOT_BOARD_CONFIG is not defined" | |||||
.endif | |||||
.if !defined(UBOOT_FAMILY) | |||||
IGNORE+= "UBOOT_FAMILY is not defined" | |||||
Not Done Inline ActionsI feel those should be prefixed, like UBOOT_MODEL, UBOOT_BOARD_CONFIG... mat: I feel those should be prefixed, like UBOOT_MODEL, UBOOT_BOARD_CONFIG... | |||||
Not Done Inline ActionsWhy? What benefit is there from the longer names. imp: Why? What benefit is there from the longer names. | |||||
Not Done Inline Actionsnamespace polution, all USES that use external variables have them. mat: namespace polution, all USES that use external variables have them. | |||||
Not Done Inline ActionsI'll consider this. imp: I'll consider this.
| |||||
.endif | |||||
# Defines for OMAP family | |||||
UBOOT_PLIST_OMAP=u-boot.img MLO | |||||
Not Done Inline ActionsWhere is this used? jmcneill: Where is this used? | |||||
Not Done Inline ActionsI'ts a typo for UBOOT_OMAP_VERSION. It works because the default version is the same and it picks that up. imp: I'ts a typo for UBOOT_OMAP_VERSION. It works because the default version is the same and it… | |||||
UBOOT_VERSION_OMAP=2016.05 | |||||
.if !defined(UBOOT_VERSION) && defined(UBOOT_VERSION_${UBOOT_FAMILY:tu}) | |||||
UBOOT_VERSION=${UBOOT_VERSION_${UBOOT_FAMILY:tu}} | |||||
.endif | |||||
UBOOT_VERSION?= 2016.05 | |||||
.if !defined(UBOOT_PLIST) && defined(UBOOT_PLIST_${UBOOT_FAMILY:tu}) | |||||
UBOOT_PLIST=${UBOOT_PLIST_${UBOOT_FAMILY:tu}} | |||||
.endif | |||||
UBOOT_PLIST?=u-boot.img | |||||
# More conventional stuff | |||||
PORTNAME= u-boot | |||||
PORTVERSION= ${UBOOT_VERSION} | |||||
Not Done Inline ActionsIt feels really strange having a USES that defines PORTNAME, PORTVERSION and CATEGORIES. mat: It feels really strange having a USES that defines PORTNAME, PORTVERSION and CATEGORIES. | |||||
Not Done Inline ActionsYes, it is a bit strange, but master port route simply didn't work. imp: Yes, it is a bit strange, but master port route simply didn't work.
| |||||
CATEGORIES= sysutils | |||||
PKGNAMESUFFIX?= -${UBOOT_MODEL} | |||||
USE_GITHUB= yes | |||||
GH_TUPLE= bsdimp:u-boot:ports-v${UBOOT_VERSION} | |||||
Not Done Inline ActionsTHIS SHOULD NOT BE SET. mat: THIS SHOULD NOT BE SET. | |||||
Not Done Inline ActionsWhy not? imp: Why not? | |||||
Not Done Inline ActionsAll variables that start with an _ are for internal, framework only, use, they should not be used outside. mat: All variables that start with an _ are for internal, framework only, use, they should not be… | |||||
Not Done Inline ActionsIt's broken without setting it. If I don't set it, the tar that's grabbed has no version it in: Attempting to fetch https://codeload.github.com/bsdimp/u-boot/tar.gz/ports-v2016.05?dummy=/u-boot-_GH0.tar.gz While setting it and DISTVERSIONFULL gives me: Attempting to fetch https://codeload.github.com/bsdimp/u-boot/tar.gz/ports-v2016.05?dummy=/bsdimp-u-boot-beaglebone-ports-v2016.05_GH0.tar.gz imp: It's broken without setting it. If I don't set it, the tar that's grabbed has no version it in… | |||||
# Need to set the following to get a good name for the distfile, am open to cleaner ways. | |||||
Not Done Inline ActionsThis is also very wrong. mat: This is also very wrong. | |||||
Not Done Inline ActionsWhy's that? imp: Why's that?
| |||||
Not Done Inline ActionsWell, mostly because it is a noop, it is defined as: DISTVERSIONFULL= ${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${DISTVERSIONSUFFIX} So setting it to something else will not do anything. mat: Well, mostly because it is a noop, it is defined as:
DISTVERSIONFULL=… | |||||
Not Done Inline ActionsAnd yet setting gives me the proper name. Setting it gives me bsdimp-u-boot-<boardname>-ports-v2016.05_GH0.tar.gz and not setting it gives me two dashes in a row. Hardly a nop. So vs Attempting to fetch https://codeload.github.com/bsdimp/u-boot/tar.gz/ports-v2016.05?dummy=/bsdimp-u-boot--ports-v2016.05_GH0.tar.gz Though to be honest, I suspect that I may need to grab a tag, not a branch here. But that's a minor issue. imp: And yet setting gives me the proper name.
Setting it gives me bsdimp-u-boot-<boardname>-ports… | |||||
_GITHUB_MUST_SET_DISTNAME=yes | |||||
DISTVERSIONFULL= ${UBOOT_MODEL} | |||||
matUnsubmitted Not Done Inline ActionsThis still will not do anything. mat: This still will not do anything. | |||||
matUnsubmitted Not Done Inline ActionsOk, ok, I get what the problem is. You can't set PORTVERSION in a USES, it is too late. This *really* should be a master/slave scheme. mat: Ok, ok, I get what the problem is.
You can't set PORTVERSION in a USES, it is too late.
I'm… | |||||
impAuthorUnsubmitted Not Done Inline ActionsMaster / slave doesn't work for this. It's more like when we used to build different parts of X11 that was in one big distribution. We didn't do master / slave for that. I couldn't get master / slave working because different revisions needed diferent patches (though maybe github solution would fix that). Other items just were a pain in the backside are easy here. This isn't quite like other things where we have 'variant' ports. Each port is its own thing and only kinda related to other ports of a similar name. That's not the master / slave data pattern. And the line still actually does something, verified by commenting it out and adding it back. Why can't I set PORTVERSION in a USES? Please help me understand. imp: Master / slave doesn't work for this. It's more like when we used to build different parts of… | |||||
COMMENT= Cross-build das u-boot for ${UBOOT_MODEL} | |||||
NO_ARCH= yes | |||||
UBOOT_ARCH?= arm | |||||
SSP_UNSAFE= yes | |||||
UBOOT_DIR= share/u-boot/${PORTNAME}${PKGNAMESUFFIX} | |||||
DATADIR= ${STAGEDIR}/${PREFIX}/${UBOOT_DIR} | |||||
MAKE_ARGS+= ARCH=${UBOOT_ARCH} CROSS_COMPILE=${UBOOT_ARCH}-none-eabi- | |||||
LICENSE= GPLv2 | |||||
# Each u-boot family has different files to include, bring them in. | |||||
.for i in ${UBOOT_PLIST} | |||||
PLIST_FILES+= ${UBOOT_DIR}/${i} | |||||
.endfor | |||||
PLIST_FILES+= ${UBOOT_DIR}/README | |||||
Not Done Inline ActionsFrom there it should be in the post section (see mate.mk for a simple example) bapt: From there it should be in the post section (see mate.mk for a simple example) | |||||
Not Done Inline ActionsOK. Will do. imp: OK. Will do. | |||||
.endif # _INCLUDE_USES_U_BOOT_MK | |||||
Not Done Inline Actions${SETENV} ${CONFIGURE_ENV} before ${MAKE_CMD} ? bapt: ${SETENV} ${CONFIGURE_ENV} before ${MAKE_CMD} ? | |||||
Not Done Inline ActionsI don't think it's needed, but sure, if that's convention. imp: I don't think it's needed, but sure, if that's convention. | |||||
Not Done Inline ActionsAh, it's needed if we do the split. imp: Ah, it's needed if we do the split.
| |||||
# End of optional part | |||||
.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_U_BOOT_POST_MK) | |||||
_INCLUDE_USES_U_BOOT_POST_MK= yes | |||||
.if !target(do-configure) | |||||
do-configure: | |||||
(cd ${WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${MAKE_CMD} ${UBOOT_BOARD_CONFIG}) | |||||
.endif | |||||
.if !target(do-install) | |||||
do-install: | |||||
${MKDIR} ${DATADIR} | |||||
.for i in ${UBOOT_PLIST} | |||||
${INSTALL_DATA} ${WRKSRC}/${i} ${DATADIR} | |||||
.endfor | |||||
${INSTALL_DATA} ${DESCR} ${DATADIR}/README | |||||
.endif | |||||
.endif # _INCLUDE_USES_U_BOOT_POST_MK | |||||
# End of use part |
incldue -> include