Changeset 2678

Show
Ignore:
Timestamp:
05/29/07 16:04:00 (1 year ago)
Author:
tg
Message:

the treebreaker ☺

overhaul the fetch'n'checksum system to be more bsd-like
• make fetch, make checksum supported
• future expansion possibilities already prepared:

– more distfiles than just one
– check sizes of downloaded files (size matters!!!!!111)
– more hashes than just MD5
– recursive fetch/checksum targets
– PERMIT_{SOURCES,DISTFILES}=Yes/«reason» – licence issues

• download.pl dies

quirks:
• GNU make only has a poor excuse for a .for loop
• some things (esp. toolchain and target/linux) now have

a ${WRKDIR} where they didn't have it before

• ${WRKDIR}/.checksum_done – no comment… it was necessary

because otherwise everything will get rebuilt every time
(did I mention that GNU make sucks?)

• I had troubles tracking the dependency problems down

because GNU make, unlike BSD make, doesn't have good debugging

• DISTFILES -> FULLDISTFILES
• DL_DIR -> DISTDIR
• PKG_SOURCE -> DISTFILES
• PKG_SOURCE_URL -> MASTER_SITES
• no @SF and @GNU any more, use BSD network.template syntax

(feel free to add more master sites)

• GNU make doesn't really strip whitespaces from variables…

(did I mention how much better BSD make is?)

• echo 'LOCAL_DISTFILES=/path/to/distfiles' >>${TOPDIR}/prefs.mk

will save the need to download 'em, Closes: #102

• MASTER_SITES now *must* have the trailing slashes (there may be

a few that don't and a few with double ones, please fix them)

I've tested that a normal build (unchanged .config from the default) works
on GNU/Linux. There's definitively room for improvement, but most of that
will come with the NFO system only. Fixes appreciated.

This work sponsored by AurISP, part of the NFO conversion project ☻

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freewrt/mk/build.mk

    r2658 r2678  
    4141.PHONY: all world clean cleandir distclean image_clean 
    4242 
    43 world: $(DL_DIR) $(BUILD_DIR) $(PACKAGE_DIR) ${TOPDIR}/.cfg/FWRT_HAVE_DOT_CONFIG 
     43world: $(DISTDIR) $(BUILD_DIR) $(PACKAGE_DIR) ${TOPDIR}/.cfg/FWRT_HAVE_DOT_CONFIG 
    4444        BASH='${BASH}' ${MBSH} ${TOPDIR}/scripts/scan-pkgs.sh 
    4545ifeq ($(strip ${FWRT_PACKAGE_BASE_FILES}),m) 
     
    5454            ${MBSH} ${TOPDIR}/scripts/ipkg-make-index.sh . >Packages 
    5555 
    56 $(DL_DIR): 
    57         mkdir -p $(DL_DIR) 
     56$(DISTDIR): 
     57        mkdir -p $(DISTDIR) 
    5858 
    5959$(BUILD_DIR): 
     
    104104        @$(TRACE) distclean 
    105105        $(MAKE) -C $(CONFIG) clean 
    106         rm -rf $(BUILD_DIR) $(BIN_DIR) $(DL_DIR) ${TOPDIR}/.cfg 
     106        rm -rf $(BUILD_DIR) $(BIN_DIR) $(DISTDIR) ${TOPDIR}/.cfg 
    107107        rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_PARENT) 
    108108        rm -f .config* .tmpconfig.h ${TOPDIR}/package/*/info.mk 
  • trunk/freewrt/mk/buildhlp.mk

    r2596 r2678  
    55# or at http://www.freewrt.org/licence for details. 
    66 
    7 ifneq ($(strip ${PKG_SOURCE_URL}),) 
    8 ifeq ($(strip ${PKG_SOURCE}),) 
    9 PKG_SOURCE:=          ${PKG_NAME}-${PKG_VERSION}.tar.gz 
     7ifneq ($(strip ${MASTER_SITES}),) 
     8ifeq ($(strip ${DISTFILES}),) 
     9DISTFILES:=           ${PKG_NAME}-${PKG_VERSION}.tar.gz 
    1010endif 
    11 endif 
    12 ifneq ($(strip ${PKG_SOURCE}),) 
    13 DISTFILES?=             ${DL_DIR}/${PKG_SOURCE} 
     11else 
     12$(warning empty MASTER_SITES) 
    1413endif 
    1514 
     
    2524WRKINST?=               ${WRKDIR}/fake-${ARCH}/root 
    2625 
    27 ifneq ($(strip ${PKG_SOURCE_URL}),) 
    28 $(DL_DIR)/$(PKG_SOURCE): 
    29         @$(CMD_TRACE) "downloading... " 
    30         mkdir -p ${DL_DIR} 
    31         perl ${SCRIPT_DIR}/download.pl ${DL_DIR} ${PKG_SOURCE} \ 
    32             ${PKG_MD5SUM} ${PKG_SOURCE_URL} ${MAKE_TRACE} 
    33 endif 
    34  
    3526post-extract: 
    3627 
    37 # no, this is not a failure 
    38 checksum: 
    39         @echo "There is currently no way to checksum the" >&2 
    40         @echo "distfiles downloaded in FreeWRT. Sorry." >&2 
     28ifneq ($(strip ${DISTFILES}),) 
     29include ${TOPDIR}/mk/fetch.mk 
    4130 
    42 ifneq ($(strip ${DISTFILES})$(strip ${PKG_SOURCE}),) 
    43 fetch: ${DISTFILES} 
    44 refetch: 
    45         -rm -f ${DISTFILES} 
    46         ${MAKE} fetch 
    47  
    48 # should depend on checksum later 
    49 ${WRKDIST}/.extract_done: ${DISTFILES} 
     31${WRKDIST}/.extract_done: ${WRKDIR}/.checksum_done 
    5032        rm -rf ${WRKDIST} ${WRKSRC} ${WRKBUILD} 
    5133        ${EXTRACT_CMD} 
     
    6547        touch $@ 
    6648 
    67 fetch refetch do-extract: 
     49fetch refetch checksum do-extract: 
    6850 
    6951__use_generic_patch_target:=42 
  • trunk/freewrt/mk/kernel-build.mk

    r2596 r2678  
    55# or at http://www.freewrt.org/licence for details. 
    66 
    7 LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.bz2 
    8 LINUX_SITE=http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \ 
    9            http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \ 
    10            http://www.kernel.org/pub/linux/kernel/v$(KERNEL) \ 
    11            http://www.de.kernel.org/pub/linux/kernel/v$(KERNEL) 
     7DISTFILES:=     linux-$(LINUX_VERSION).tar.bz2 
     8MASTER_SITES=   http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL)/ \ 
     9                http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL)/ \ 
     10                http://www.kernel.org/pub/linux/kernel/v$(KERNEL)/ \ 
     11                http://www.de.kernel.org/pub/linux/kernel/v$(KERNEL)/ 
     12PKG_MD5SUM:=    ${LINUX_KERNEL_MD5SUM} 
     13 
     14include ${TOPDIR}/mk/fetch.mk 
    1215 
    1316KERNEL_IDIR:=$(LINUX_BUILD_DIR)/kernel-ipkg 
    1417 
    15 $(DL_DIR)/$(LINUX_SOURCE): 
    16         -mkdir -p $(DL_DIR) 
    17         $(TRACE) target/linux/$(BOARD)-$(KERNEL)-kernel-download 
    18         perl $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_SOURCE) $(LINUX_KERNEL_MD5SUM) $(LINUX_SITE) $(MAKE_TRACE) 
    19  
    20 $(LINUX_BUILD_DIR