Changeset 8201


Ignore:
Timestamp:
2007-07-28T04:44:55+02:00 (11 years ago)
Author:
nbd
Message:

initial attempt at cleaning up subdirectory handling. tools/Makefile is now being included instead of recursively called

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r8003 r8201  
    2424export IS_TTY=$(shell tty -s && echo 1 || echo 0) 
    2525 
    26 include $(TOPDIR)/include/verbose.mk 
     26include ./rules.mk  
     27include $(INCLUDE_DIR)/depends.mk 
     28include $(INCLUDE_DIR)/subdir.mk 
     29include tools/Makefile 
    2730 
    2831OPENWRTVERSION:=$(RELEASE) 
     
    101104package/% target/%: tmp/.packageinfo 
    102105toolchain/% package/% target/%: tmp/.targetinfo 
    103 package/% target/% tools/% toolchain/%: FORCE 
     106package/% target/% toolchain/%: FORCE 
    104107        $(MAKE) -C $(patsubst %/$*,%,$@) $* 
    105108 
     
    131134        $(MAKE) target/download 
    132135 
    133 world: .config FORCE 
    134         $(MAKE) tools/install 
     136world: .config $(tools/stamp) FORCE 
    135137        $(MAKE) toolchain/install 
    136138        $(MAKE) target/compile 
     
    163165 
    164166.SILENT: clean dirclean distclean symlinkclean config-clean download world help tmp/.packageinfo tmp/.targetinfo tmpinfo-clean tmp/.config-package.in tmp/.config-target.in .config scripts/config/mconf scripts/config/conf menuconfig tmp/.prereq-build tmp/.prereq-package tmp/.prereq-target 
    165 FORCE: ; 
    166 .PHONY: FORCE help 
     167.PHONY: help 
  • trunk/tools/Makefile

    r7820 r8201  
    11#  
    2 # Copyright (C) 2006 OpenWrt.org 
     2# Copyright (C) 2007 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    77# Main makefile for the host tools 
    88# 
    9 include $(TOPDIR)/rules.mk 
    10 TARGETS-y:=sed sstrip ipkg-utils ext2fs squashfs mtd-utils lzma mkimage firmware-utils patch-cmdline 
    11 TARGETS-$(CONFIG_CCACHE) += ccache 
    129 
    13 TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y)) 
    14 TARGETS_PREPARE:=$(patsubst %,%-prepare,$(TARGETS-y)) 
    15 TARGETS_COMPILE:=$(patsubst %,%-compile,$(TARGETS-y)) 
    16 TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y)) 
    17 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y)) 
    18 STAMP:=$(STAGING_DIR)/stampfiles/.tools_installed 
     10curdir:=$(patsubst %/Makefile,%,$(lastword $(MAKEFILE_LIST))) 
    1911 
    20 all: install 
    21 download: $(TARGETS_DOWNLOAD) 
    22 compile: $(TARGETS_COMPILE) 
    23 install: $(STAMP) 
    24 clean: $(TARGETS_CLEAN) 
     12# subdirectories to descend into 
     13$(curdir)/builddirs := sed sstrip ipkg-utils ext2fs squashfs mtd-utils lzma mkimage firmware-utils patch-cmdline $(if $(CONFIG_CCACHE),ccache) 
    2514 
    26 squashfs-compile: lzma-install 
     15# builddir dependencies 
     16$(curdir)/squashfs/compile := $(curdir)/lzma/install 
    2717 
    28 ifneq ($(shell $(SCRIPT_DIR)/timestamp.pl -p . $(STAMP)),$(STAMP)) 
    29   $(STAMP): $(TARGETS_INSTALL) 
    30 endif 
     18# preparatory work 
     19$(STAGING_DIR)/include-host/.done: 
     20        @mkdir -p $$(dirname $@) 
     21        @cp $(curdir)/include/*.h $$(dirname $@)/ 
     22        @touch $@ 
    3123 
    32 $(STAMP): $(TOPDIR)/.config 
    33         mkdir -p $(shell dirname $@) 
    34         touch $@ 
    35  
    36 TOOL_HOST_INCLUDES:=$(patsubst ./include/%.h,$(STAGING_DIR)/include-host/%.h,$(wildcard ./include/*.h)) 
    37 $(TOOL_HOST_INCLUDES): $(STAGING_DIR)/include-host/%.h: ./include/%.h 
    38         @mkdir -p $(STAGING_DIR)/include-host 
    39         $(CP) $< $@ 
    40  
    41 $(TOOL_BUILD_DIR): 
    42         @mkdir -p $@ 
    43  
    44 %-prereq %-download %-clean %-refresh %-update: FORCE 
    45         $(MAKE) -C $* $(patsubst $*-%,%,$@) 
    46  
    47 %-prepare: $(TOOL_HOST_INCLUDES) $(TOOL_BUILD_DIR) FORCE 
    48         $(MAKE) -C $* $(patsubst $*-%,%,$@) 
    49  
    50 %-compile: %-prepare FORCE 
    51         $(MAKE) -C $* $(patsubst $*-%,%,$@) 
    52          
    53 %-install: %-compile FORCE 
    54         $(MAKE) -C $* $(patsubst $*-%,%,$@) 
    55  
    56 ifeq ($(MAKECMDGOALS),install-targets) 
    57 MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL) 
    58 else 
    59 .NOTPARALLEL: 
    60 endif 
     24# prerequisites for the individual targets 
     25$(curdir)/ := .config 
     26$(curdir)//prepare := $(STAGING_DIR)/include-host/.done 
     27$(eval $(call stampfile,$(curdir),tools)) 
     28$(eval $(call subdir,$(curdir))) 
Note: See TracChangeset for help on using the changeset viewer.