Changeset 339

Show
Ignore:
Timestamp:
07/22/06 04:08:05 (2 years ago)
Author:
tg
Message:

sanitise the way tools which must be in lbin/ (currently,
sed and pax/cpio/tar, but there will be more...) are handled:
make prereq invokes a special recursive target install-lbin
which copies them from the staging dir into lbin if they exist
there (i.e. are already installed), or removes the install stamp
otherwise. the tools' install-lbin target does however duplicate
a little code, this could be done better but it works OK like this

also, add a missing include to brcm-utils and fix pax' clean target

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freewrt/Makefile

    r241 r339  
    142142        @env NO_ERROR=${NO_ERROR} bash scripts/scan-tools.sh 
    143143        @ln -s $$(lbin/which ${CC}) lbin/gcc 
     144        @${GMAKE_INV} tools/install-lbin 
    144145        @echo '===> Prerequisites checked successfully.' 
    145146        @touch $@ 
  • trunk/freewrt/tools/Makefile

    r338 r339  
    1 # $Id
     1# $FreeWRT
    22 
    33include $(TOPDIR)/rules.mk 
     
    1010 
    1111TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS)) 
     12TARGETS_INSTALL_LBIN:=$(patsubst %,%-install-lbin,$(TARGETS)) 
    1213TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS)) 
    1314 
    1415all: install 
    15 install: check-lbin $(TARGETS_INSTALL) 
     16install: $(TARGETS_INSTALL) 
     17install-lbin: $(TARGETS_INSTALL_LBIN) 
    1618clean: $(TARGETS_CLEAN) 
    17  
    18 check-lbin: 
    19         @[ -e ${TOPDIR}/lbin/sed ] || \ 
    20             rm -f $(TOOLS_STAMP_DIR)/.tools_sed-install 
    21         @[ -e ${TOPDIR}/lbin/pax ] || \ 
    22             rm -f $(TOOLS_STAMP_DIR)/.tools_paxmirabilis-install 
    2319 
    2420$(STAGING_DIR): 
     
    5955        @touch $(TOOLS_STAMP_DIR)/.tools_$@ 
    6056 
     57%-install-lbin: 
     58        $(TRACE) tools/$(patsubst %-install-lbin,%,$@)/install-lbin; \ 
     59        $(MAKE) -C $(patsubst %-install-lbin,%,$@) install-lbin \ 
     60            $(MAKE_TRACE) 
     61 
    6162%-clean: 
    6263        $(TRACE) tools/$(patsubst %-clean,%,$@)/clean 
  • trunk/freewrt/tools/brcm-utils/Makefile

    r201 r339  
    11include $(TOPDIR)/rules.mk 
     2include ../rules.mk 
    23 
    34TARGETS := addpattern trx motorola-bin dgfirmware 
  • trunk/freewrt/tools/paxmirabilis/Makefile

    r251 r339  
     1# $FreeWRT$ 
     2 
    13include $(TOPDIR)/rules.mk 
    24 
     
    3840 
    3941install: compile 
    40         -rm -f ${TOPDIR}/lbin/{pax,cpio,tar} 
    41         install -c -s -m 555 ${WRKBUILD}/pax ${TOPDIR}/lbin/pax 
     42        mkdir -p $(STAGING_DIR)/bin 
     43        -rm -f $(STAGING_DIR)/bin/{pax,cpio,tar} ${TOPDIR}/lbin/{pax,cpio,tar} 
     44        install -c -s -m 555 ${WRKBUILD}/pax $(STAGING_DIR)/bin/pax 
     45        cd ${STAGING_DIR}/bin && ln pax cpio && ln pax tar 
     46        cp $(STAGING_DIR)/bin/pax ${TOPDIR}/lbin/pax 
    4247        cd ${TOPDIR}/lbin && ln pax cpio && ln pax tar 
     48 
     49install-lbin: 
     50        rm -f ${TOPDIR}/lbin/{pax,cpio,tar} 
     51        if [ -e $(STAGING_DIR)/bin/pax ]; then \ 
     52                cp $(STAGING_DIR)/bin/pax ${TOPDIR}/lbin/pax; \ 
     53                cd ${TOPDIR}/lbin && ln pax cpio && ln pax tar; \ 
     54        else \ 
     55                rm -f $(TOOLS_STAMP_DIR)/.tools_paxmirabilis-install; \ 
     56        fi 
    4357 
    4458package: 
    4559 
    4660clean: 
    47         rm -rf src ${TOPDIR}/lbin/{pax,cpio,tar} 
     61        rm -rf ${WRKBUILD} 
     62        rm -f $(STAGING_DIR)/bin/{pax,cpio,tar} ${TOPDIR}/lbin/{pax,cpio,tar} 
    4863 
    4964${WRKBUILD}: 
  • trunk/freewrt/tools/rules.mk

    r316 r339  
    1616            ${PKG_MD5SUM} ${PKG_SOURCE_URL} 
    1717endif 
     18 
     19install-lbin: 
  • trunk/freewrt/tools/sed/Makefile

    r338 r339  
    66PKG_MD5SUM:=            928f0e06422f414091917401f1a834d0 
    77PKG_SOURCE_URL:=        ftp://ftp.gnu.org/gnu/sed 
    8 PKG_BINARY:=            sed/sed 
    9 PKG_TARGET_BINARY:=     bin/sed 
    108 
    119include $(TOPDIR)/rules.mk 
     
    2725        touch $@ 
    2826 
    29 $(WRKBUILD)/$(PKG_BINARY): $(WRKBUILD)/.configured 
     27$(WRKBUILD)/sed/sed: $(WRKBUILD)/.configured 
    3028        $(MAKE) -C $(WRKBUILD) 
    3129 
    32 # This stuff is needed to work around GNU make deficiencies 
    33 build-sed-host-binary: $(WRKBUILD)/$(PKG_BINARY) 
    34         @if [ -L $(STAGING_DIR)/$(PKG_TARGET_BINARY) ] ; then \ 
    35                 rm -f $(STAGING_DIR)/$(PKG_TARGET_BINARY); fi; 
    36         @if [ ! -f $(STAGING_DIR)/$(PKG_TARGET_BINARY) -o $(STAGING_DIR)/$(PKG_TARGET_BINARY) \ 
    37         -ot $(WRKBUILD)/$(PKG_BINARY) ] ; then \ 
    38             set -x; \ 
    39             mkdir -p $(STAGING_DIR)/bin; \ 
    40             $(MAKE) DESTDIR=$(STAGING_DIR) -C $(WRKBUILD) install; \ 
    41             mv $(STAGING_DIR)/usr/bin/sed $(STAGING_DIR)/bin/; \ 
    42             rm -rf $(STAGING_DIR)/share/locale $(STAGING_DIR)/usr/info \ 
    43                     $(STAGING_DIR)/usr/man $(STAGING_DIR)/usr/share/doc; fi 
     30source:  
     31prepare: $(WRKBUILD)/.unpacked 
    4432 
    45 install-lbin: ${WRKBUILD}/${PKG_BINARY} 
    46         install -c -s -m 555 ${WRKBUILD}/${PKG_BINARY} ${TOPDIR}/lbin/sed 
     33compile: $(WRKBUILD)/sed/sed 
    4734 
    48 source:  
    49 prepare:  
    50 compile:  
    51 install: build-sed-host-binary install-lbin 
     35install: compile 
     36        mkdir -p $(STAGING_DIR)/bin 
     37        rm -f $(STAGING_DIR)/bin/sed ${TOPDIR}/lbin/sed 
     38        install -c -s -m 555 ${WRKBUILD}/sed/sed $(STAGING_DIR)/bin/sed 
     39        cp $(STAGING_DIR)/bin/sed ${TOPDIR}/lbin/sed 
     40 
     41install-lbin: 
     42        rm -f ${TOPDIR}/lbin/sed 
     43        if [ -e $(STAGING_DIR)/bin/sed ]; then \ 
     44                cp $(STAGING_DIR)/bin/sed ${TOPDIR}/lbin/sed; \ 
     45        else \ 
     46                rm -f $(TOOLS_STAMP_DIR)/.tools_sed-install; \ 
     47        fi 
     48 
    5249clean:  
    5350        rm -rf $(WRKBUILD) 
    54         rm -f $(STAGING_DIR)/$(PKG_TARGET_BINARY) 
     51        rm -f $(STAGING_DIR)/bin/sed ${TOPDIR}/lbin/sed