ct-ng.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Jun 11 21:47:19 2009 +0000 (2009-06-11)
branch1.4
changeset 1451 25d050084e98
parent 1144 e1bf6cd3a27c
child 1336 bc8b9381f637
permissions -rw-r--r--
populate: fix installing dynamic linker 'ld.so'

The dynamic linker, ld.so, needs the execute bit to be set.
Detect tht the library being installed is in fact ld.so and
install it with 0755 instead of 0644.

Fix detecting src == dst.

Use a simpler command to copy src -> dst.

Also change echo to printf, get rid of 'echo -n', which is
highly non-portable.


-------- diffstat follows --------
/trunk/scripts/populate.in | 76 43 33 0 +++++++++++++++++++++++++++++-----------------------
1 file changed, 43 insertions(+), 33 deletions(-)
(transplanted from d7ddcb75e0f703e2ba6d17169167356389224870)
yann@1141
     1
#!@@CT_make@@ -rf
yann@182
     2
# Makefile for crosstool-NG.
yann@182
     3
# Copyright 2006 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
yann@182
     4
yann@182
     5
# Don't print directory as we descend into them
yann@411
     6
# Don't use built-in rules, we know what we're doing
yann@289
     7
MAKEFLAGS += --no-print-directory --no-builtin-rules
yann@182
     8
yann@1155
     9
# Don't go parallel
yann@1155
    10
.NOTPARALLEL:
yann@411
    11
yann@1144
    12
# This is where ct-ng is:
yann@1144
    13
export CT_NG:=$(lastword $(MAKEFILE_LIST))
yann@1144
    14
# and this is where we're working in:
yann@1144
    15
export CT_TOP_DIR:=$(shell pwd)
yann@1144
    16
yann@1144
    17
# Paths and values set by ./configure
yann@372
    18
# Don't bother to change it other than with a new ./configure!
yann@182
    19
export CT_LIB_DIR:=@@CT_LIBDIR@@
yann@182
    20
export CT_DOC_DIR:=@@CT_DOCDIR@@
yann@182
    21
yann@197
    22
# This is crosstool-NG version string
yann@543
    23
export CT_VERSION:=@@CT_VERSION@@
yann@182
    24
yann@1155
    25
# Paths found by ./configure
yann@1155
    26
include $(CT_LIB_DIR)/paths.mk
yann@953
    27
yann@1155
    28
# Some distributions (eg. Ubuntu) thought it wise to point /bin/sh to
yann@1155
    29
# a truly POSIX-conforming shell, ash in this case. This is not so good
yann@1155
    30
# as we, smart (haha!) developers (as smart we ourselves think we are),
yann@1155
    31
# got used to bashisms, and are enclined to easiness... So force use of
yann@1155
    32
# bash.
yann@1155
    33
export SHELL=$(bash)
yann@1155
    34
yann@1155
    35
# Make the restart/stop steps availabe to scripts/crostool-NG.sh
yann@334
    36
export CT_STOP:=$(STOP)
yann@334
    37
export CT_RESTART:=$(RESTART)
yann@182
    38
yann@954
    39
SILENT=@
yann@954
    40
ECHO=echo
yann@954
    41
ifeq ($(strip $(origin V)),command line)
yann@940
    42
  ifeq ($(strip $(V)),0)
yann@940
    43
    SILENT=@
yann@940
    44
    ECHO=:
yann@940
    45
  else
yann@940
    46
    ifeq ($(strip $(V)),1)
yann@940
    47
      SILENT=
yann@940
    48
      ECHO=:
yann@953
    49
    else
yann@953
    50
      ifeq ($(strip $(V)),2)
yann@953
    51
        SILENT=
yann@953
    52
        ECHO=echo
yann@954
    53
      endif # V == 2
yann@954
    54
    endif # V== 1
yann@954
    55
  endif # V == 0
yann@954
    56
endif # origin V
yann@1008
    57
export V SILENT ECHO
yann@940
    58
yann@1101
    59
.FORCE: $(FORCE)
yann@182
    60
.PHONY: $(PHONY)
yann@182
    61
PHONY += all
yann@197
    62
all: help
yann@182
    63
yann@182
    64
# Help system
yann@229
    65
help:: help-head help-config help-samples help-build help-clean help-distrib help-env help-tail
yann@182
    66
yann@544
    67
help-head:: version
yann@544
    68
	@echo  'See below for a list of available actions, listed by category:'
yann@182
    69
yann@182
    70
help-config::
yann@182
    71
	@echo
yann@197
    72
	@echo  'Configuration actions:'
yann@182
    73
yann@182
    74
help-samples::
yann@182
    75
	@echo
yann@1024
    76
	@echo  'Preconfigured toolchains (#: force number of // jobs):'
yann@182
    77
yann@182
    78
help-build::
yann@182
    79
	@echo
yann@333
    80
	@echo  'Build actions (#: force number of // jobs):'
yann@182
    81
yann@229
    82
help-clean::
yann@229
    83
	@echo
yann@229
    84
	@echo  'Clean actions:'
yann@229
    85
yann@182
    86
help-distrib::
yann@182
    87
	@echo
yann@197
    88
	@echo  'Distribution actions:'
yann@182
    89
yann@182
    90
help-env::
yann@182
    91
	@echo
yann@182
    92
	@echo  'Environement variables (see @@CT_DOCDIR@@/overview.txt):'
yann@182
    93
yann@182
    94
help-tail::
yann@182
    95
	@echo
yann@932
    96
	@echo  'Use action "config" or "menuconfig" to configure crosstool-NG'
yann@932
    97
	@echo  'Use action "build" to build your toolchain'
yann@932
    98
	@echo  'Use action "version" to see the version'
yann@185
    99
	@echo  'See "man 1 ct-ng" for some help as well'
yann@182
   100
yann@182
   101
help-build::
yann@1024
   102
	@echo  '  build[.#]          - Build the currently configured toolchain'
yann@229
   103
yann@229
   104
help-clean::
yann@333
   105
	@echo  '  clean              - Remove generated files'
yann@333
   106
	@echo  '  distclean          - Remove generated files, configuration and build directories'
yann@182
   107
yann@945
   108
include $(CT_LIB_DIR)/config/config.mk
yann@261
   109
include $(CT_LIB_DIR)/kconfig/kconfig.mk
yann@333
   110
include $(CT_LIB_DIR)/steps.mk
yann@261
   111
include $(CT_LIB_DIR)/samples/samples.mk
yann@1101
   112
include $(CT_LIB_DIR)/scripts/scripts.mk
yann@182
   113
yann@182
   114
help-distrib::
yann@333
   115
	@echo  '  tarball            - Build a tarball of the configured toolchain'
yann@182
   116
yann@182
   117
help-env::
yann@182
   118
yann@940
   119
# End help system
yann@940
   120
yann@182
   121
.config:
yann@943
   122
	@echo ' There is no existing .config file!'
yann@182
   123
	@false
yann@182
   124
yann@182
   125
# Actual build
yann@372
   126
build: .config
yann@1143
   127
	$(SILENT)$(CT_LIB_DIR)/scripts/crosstool-NG.sh
yann@182
   128
yann@372
   129
build.%:
yann@1155
   130
	$(SILENT)$(MAKE) -rf $(CT_NG) $(shell echo "$(@)" |$(sed) -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;')
yann@333
   131
yann@182
   132
PHONY += tarball
yann@214
   133
#tarball:
yann@214
   134
#	@$(CT_LIB_DIR)/scripts/tarball.sh
yann@182
   135
tarball:
yann@940
   136
	@echo 'Tarball creation disabled for now... Sorry.'
yann@214
   137
	@true
yann@182
   138
yann@268
   139
PHONY += version
yann@268
   140
version:
yann@273
   141
	@echo 'This is crosstool-NG version $(CT_VERSION)'
yann@675
   142
	@echo
yann@675
   143
	@echo 'Copyright (C) 2008  Yann E. MORIN <yann.morin.1998@anciens.enib.fr>'
yann@675
   144
	@echo 'This is free software; see the source for copying conditions.'
yann@675
   145
	@echo 'There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A'
yann@675
   146
	@echo 'PARTICULAR PURPOSE.'
yann@931
   147
	@echo
yann@268
   148
yann@182
   149
PHONY += clean
yann@182
   150
clean::
yann@953
   151
	@$(ECHO) "  CLEAN log"
yann@953
   152
	$(SILENT)rm -f log.* .config.* ..config*
yann@182
   153
yann@182
   154
PHONY += distclean
yann@182
   155
distclean:: clean
yann@953
   156
	@$(ECHO) "  CLEAN .config"
yann@953
   157
	$(SILENT)rm -f .config .config.* ..config*
yann@940
   158
	@$(ECHO) "  CLEAN targets"
yann@940
   159
	$(SILENT)chmod -R u+w targets >/dev/null 2>&1 || true
yann@940
   160
	$(SILENT)rm -rf targets