Changeset 8207


Ignore:
Timestamp:
2007-07-28T15:29:03+02:00 (11 years ago)
Author:
nbd
Message:

build system fixes, more cleanup

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r8206 r8207  
    11# Makefile for OpenWrt 
    22# 
    3 # Copyright (C) 2006 OpenWrt.org 
    4 # Copyright (C) 2006 by Felix Fietkau <openwrt@nbd.name> 
     3# Copyright (C) 2007 OpenWrt.org 
    54# 
    65# This is free software, licensed under the GNU General Public License v2. 
     
    109all: world 
    1110 
    12  
    1311TOPDIR:=${CURDIR} 
    1412LC_ALL:=C 
     
    1715export TOPDIR LC_ALL LANG IS_TTY 
    1816 
    19 include rules.mk 
    20  
    2117ifneq ($(OPENWRT_BUILD),1) 
    2218  export OPENWRT_BUILD:=1 
    23   include $(INCLUDE_DIR)/toplevel.mk 
     19  include $(TOPDIR)/include/toplevel.mk 
    2420else 
     21  include rules.mk 
    2522  include $(INCLUDE_DIR)/depends.mk 
    2623  include $(INCLUDE_DIR)/subdir.mk 
    2724  include tools/Makefile 
     25  include toolchain/Makefile 
    2826 
    2927clean: FORCE 
     
    3937        $(MAKE) -C $(patsubst %/$*,%,$@) $* 
    4038 
    41 world: .config $(tools/stamp) FORCE 
    42         $(MAKE) toolchain/install 
     39world: .config $(tools/stamp) $(toolchain/stamp) FORCE 
    4340        $(MAKE) target/compile 
    4441        $(MAKE) package/compile 
  • trunk/include/toplevel.mk

    r8206 r8207  
    1414SHELL:=/usr/bin/env bash 
    1515OPENWRTVERSION:=$(RELEASE) 
     16include $(TOPDIR)/include/verbose.mk 
    1617ifneq ($(VERSION),) 
    1718  OPENWRTVERSION:=$(VERSION) ($(OPENWRTVERSION)) 
     
    3435tmp/.packageinfo tmp/.targetinfo prepare-tmpinfo: 
    3536        @mkdir -p tmp/info 
    36         @$(NO_TRACE_MAKE) -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS="$(TOPDIR)/include/package*.mk" SCAN_DEPTH=4 SCAN_EXTRA="" 
    37         @$(NO_TRACE_MAKE) -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPS="profiles/*.mk $(TOPDIR)/include/kernel*.mk" SCAN_DEPTH=2 SCAN_EXTRA="" 
     37        @+$(NO_TRACE_MAKE) -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS="$(TOPDIR)/include/package*.mk" SCAN_DEPTH=4 SCAN_EXTRA="" 
     38        @+$(NO_TRACE_MAKE) -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPS="profiles/*.mk $(TOPDIR)/include/kernel*.mk" SCAN_DEPTH=2 SCAN_EXTRA="" 
    3839        @for type in package target; do \ 
    3940                f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \ 
     
    4243 
    4344.config: ./scripts/config/conf prepare-tmpinfo 
    44         if [ \! -f .config ]; then \ 
     45        @+if [ \! -f .config ]; then \ 
    4546                [ -e $(HOME)/.openwrt/defconfig ] && cp $(HOME)/.openwrt/defconfig .config; \ 
    46                 $(NO_TRACE_MAKE) menuconfig; \ 
     47                $(NO_TRACE_MAKE) menuconfig QUIET=0 OPENWRT_BUILD=; \ 
    4748        fi 
    4849        $< -D .config Config.in &> /dev/null 
    4950 
    5051scripts/config/mconf: 
    51         $(MAKE) -C scripts/config all 
     52        @+$(MAKE) -C scripts/config all 
    5253 
    5354scripts/config/conf: 
    54         $(MAKE) -C scripts/config conf 
     55        @+$(MAKE) -C scripts/config conf 
    5556 
    5657config: scripts/config/conf prepare-tmpinfo FORCE 
     
    8283        mkdir -p tmp 
    8384        rm -f tmp/.host.mk 
    84         $(NO_TRACE_MAKE) -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \ 
     85        @+$(NO_TRACE_MAKE) -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \ 
    8586                echo "Prerequisite check failed. Use FORCE=1 to override."; \ 
    8687                false; \ 
     
    8889        touch $@ 
    8990 
    90 tmp/.prereq-package: tmp/.packageinfo 
     91tmp/.prereq-package: tmp/.packageinfo .config 
    9192tmp/.prereq-target: tmp/.targetinfo .config 
    9293tmp/.prereq-package tmp/.prereq-target: include/prereq.mk  
    9394        mkdir -p tmp 
    9495        rm -f tmp/.host.mk 
    95         $(NO_TRACE_MAKE) -s -C $(patsubst tmp/.prereq-%,%,$@) prereq 2>/dev/null || { \ 
     96        @+$(NO_TRACE_MAKE) -s -C $(patsubst tmp/.prereq-%,%,$@) prereq 2>/dev/null || { \ 
    9697                echo "Prerequisite check failed. Use FORCE=1 to override."; \ 
    9798                false; \ 
     
    99100        touch $@ 
    100101 
    101 prereq: tmp/.prereq-build tmp/.prereq-package tmp/.prereq-target .config FORCE ; 
     102prereq: tmp/.prereq-build tmp/.prereq-package tmp/.prereq-target .config FORCE 
     103        @true 
    102104 
    103105download: .config FORCE 
     
    112114%:: 
    113115        @$(SUBMAKE) -s prereq QUIET=0 OPENWRT_BUILD= 
    114         @$(MAKE) $@  
     116        @+$(MAKE) $@  
    115117 
    116118help: 
  • trunk/toolchain/Makefile

    r7754 r8207  
    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 toolchain 
    88# 
    9 include $(TOPDIR)/rules.mk 
    109 
    11 TARGETS-y:=kernel-headers 
    12 TARGETS-$(CONFIG_GDB) += gdb 
     10# subdirectories to descend into 
     11toolchain/builddirs := kernel-headers $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_NATIVE_TOOLCHAIN),,binutils gcc uClibc) 
     12 
     13# builddir dependencies 
     14toolchain/uClibc/prepare:=toolchain/kernel-headers/prepare 
    1315ifeq ($(CONFIG_NATIVE_TOOLCHAIN),) 
    14   TARGETS-y+=binutils gcc uClibc 
     16  toolchain/binutils/prepare:=toolchain/uClibc/prepare 
     17  toolchain/gcc/prepare:=toolchain/binutils/install 
     18  toolchain/uClibc/compile:=toolchain/gcc/compile 
    1519endif 
     20toolchain/gcc/install:=toolchain/uClibc/install 
    1621 
    17 TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y)) 
    18 TARGETS_PREPARE:=$(patsubst %,%-prepare,$(TARGETS-y)) 
    19 TARGETS_COMPILE:=$(patsubst %,%-compile,$(TARGETS-y)) 
    20 TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y)) 
    21 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y)) 
    22 STAMP:=$(STAGING_DIR)/stampfiles/.toolchain_installed 
     22# prerequisites for the individual targets 
     23toolchain/ := .config $(tools/stamp) 
     24toolchain//prepare = $(STAGING_DIR)/include-host/.done 
     25toolchain//compile = $(1)/prepare 
     26toolchain//install = $(1)/compile 
    2327 
    24 all: install 
    25 download: $(TARGETS_DOWNLOAD) 
    26 compile: $(TARGETS_COMPILE) 
    27 install: $(STAMP)  
    28 clean: $(TARGETS_CLEAN) 
     28$(eval $(call stampfile,toolchain,toolchain)) 
     29$(eval $(call subdir,toolchain)) 
    2930 
    30 ifneq ($(shell $(SCRIPT_DIR)/timestamp.pl -p . $(STAMP)),$(STAMP)) 
    31   $(STAMP): $(TARGETS_INSTALL) 
    32 endif 
    33  
    34 uClibc-prepare: kernel-headers-prepare 
    35 ifeq ($(CONFIG_NATIVE_TOOLCHAIN),) 
    36   binutils-prepare: uClibc-prepare 
    37   gcc-prepare: binutils-install 
    38   uClibc-compile: gcc-compile 
    39 endif 
    40 gcc-install: uClibc-install 
    41  
    42 $(STAMP): 
    43         mkdir -p $(shell dirname $@) 
    44         touch $@ 
    45  
    46 $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME): 
    47         @mkdir -p $@ 
    48         @ln -sf ../lib $@/lib 
    49  
    50 $(TOOLCHAIN_BUILD_DIR): 
    51         @mkdir -p $@ 
    52  
    53 %-prereq %-download %-clean %-refresh %-update: FORCE 
    54         $(MAKE) -C $* $(patsubst $*-%,%,$@) 
    55  
    56 %-prepare: $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) $(TOOLCHAIN_BUILD_DIR)         
    57         $(MAKE) -C $* $(patsubst $*-%,%,$@) 
    58  
    59 %-compile: %-prepare FORCE 
    60         $(MAKE) -C $* $(patsubst $*-%,%,$@) 
    61          
    62 %-install: %-compile FORCE 
    63         $(MAKE) -C $* $(patsubst $*-%,%,$@) 
  • trunk/tools/Makefile

    r8202 r8207  
    88# 
    99 
    10 curdir:=$(patsubst %/Makefile,%,$(lastword $(MAKEFILE_LIST))) 
     10curdir:=tools 
    1111 
    1212# 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) 
     13tools/builddirs := sed sstrip ipkg-utils ext2fs squashfs mtd-utils lzma mkimage firmware-utils patch-cmdline $(if $(CONFIG_CCACHE),ccache) 
    1414 
    1515# builddir dependencies 
    16 $(curdir)/squashfs/compile := $(curdir)/lzma/install 
     16tools/squashfs/compile := tools/lzma/install 
    1717 
    1818# preparatory work 
    1919$(STAGING_DIR)/include-host/.done: 
    2020        @mkdir -p $$(dirname $@) 
    21         @cp $(curdir)/include/*.h $$(dirname $@)/ 
     21        @cp tools/include/*.h $$(dirname $@)/ 
    2222        @touch $@ 
    2323 
    2424# prerequisites for the individual targets 
    25 $(curdir)/ := .config 
    26 $(curdir)//prepare = $(STAGING_DIR)/include-host/.done 
    27 $(curdir)//compile = $(1)/prepare 
    28 $(curdir)//install = $(1)/compile 
     25tools/ := .config 
     26tools//prepare = $(STAGING_DIR)/include-host/.done 
     27tools//compile = $(1)/prepare 
     28tools//install = $(1)/compile 
    2929 
    30 $(eval $(call stampfile,$(curdir),tools)) 
    31 $(eval $(call subdir,$(curdir))) 
     30$(eval $(call stampfile,tools,tools)) 
     31$(eval $(call subdir,tools)) 
Note: See TracChangeset for help on using the changeset viewer.