~ubuntu-branches/ubuntu/hardy/klibc/hardy-updates

« back to all changes in this revision

Viewing changes to usr/Kbuild

  • Committer: Bazaar Package Importer
  • Author(s): Jeff Bailey
  • Date: 2006-01-04 20:24:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060104202452-ec4v3n829rymukuv
Tags: 1.1.15-0ubuntu1
* New upstream version.

* Patch to fix compilation on parisc64 kernels.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# kbuild file for usr/ - including initramfs image and klibc
 
3
#
 
4
 
 
5
# klibc definitions - to be moved to top-level Makefile later
 
6
export KLIBCSRC := $(srctree)/$(src)/klibc
 
7
export KLIBCINC := $(srctree)/$(src)/include
 
8
export KLIBCOBJ := $(objtree)/$(obj)/klibc
 
9
CONFIG_KLIBC := 1
 
10
 
 
11
# Klibc binaries
 
12
ifdef CONFIG_KLIBC
 
13
klibc := -f $(srctree)/scripts/Kbuild.klibc obj
 
14
 
 
15
.PHONY: klibcdirs
 
16
$(obj)/initramfs_list: klibcdirs
 
17
 
 
18
klibcdirs: FORCE
 
19
        $(Q)$(MAKE) $(klibc)=$(src)/klibc
 
20
        $(Q)$(MAKE) $(klibc)=$(src)/kinit
 
21
        $(Q)$(MAKE) $(klibc)=$(src)/utils
 
22
        $(Q)$(MAKE) $(klibc)=$(src)/dash
 
23
        $(Q)$(MAKE) $(klibc)=$(src)/gzip
 
24
endif
 
25
subdir- := klibc kinit utils dash gzip
 
26
 
 
27
 
 
28
# Generate builtin.o based on initramfs_data.o
 
29
obj-y        := initramfs_data.o
 
30
 
 
31
# initramfs_data.o contains the initramfs_data.cpio.gz image.
 
32
# The image is included using .incbin, a dependency which is not
 
33
# tracked automatically.
 
34
$(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio.gz FORCE
 
35
 
 
36
ifdef CONFIG_INITRAMFS_ROOT_UID
 
37
gen_initramfs_args += -u $(CONFIG_INITRAMFS_ROOT_UID)
 
38
endif
 
39
 
 
40
ifdef CONFIG_INITRAMFS_ROOT_GID
 
41
gen_initramfs_args += -g $(CONFIG_INITRAMFS_ROOT_GID)
 
42
endif
 
43
 
 
44
# The $(shell echo $(CONFIG_INITRAMFS_SOURCE)) is to remove the
 
45
# gratuitous begin and end quotes from the Kconfig string type.
 
46
# Internal, escaped quotes in the Kconfig string will loose the
 
47
# escape and become active quotes.
 
48
quotefixed_initramfs_source := $(shell echo $(CONFIG_INITRAMFS_SOURCE))
 
49
 
 
50
filechk_initramfs_list = $(CONFIG_SHELL) \
 
51
  $(srctree)/scripts/gen_initramfs_list.sh $(gen_initramfs_args) \
 
52
                                           $(quotefixed_initramfs_source)
 
53
 
 
54
$(obj)/initramfs_list: $(src)/Kbuild FORCE
 
55
        $(call filechk,initramfs_list)
 
56
 
 
57
quiet_cmd_cpio = CPIO    $@
 
58
      cmd_cpio = ./$< $(obj)/initramfs_list > $@
 
59
 
 
60
 
 
61
# Check if the INITRAMFS_SOURCE is a cpio archive
 
62
ifneq (,$(findstring .cpio,$(quotefixed_initramfs_source)))
 
63
 
 
64
# INITRAMFS_SOURCE has a cpio archive - verify that it's a single file
 
65
ifneq (1,$(words $(quotefixed_initramfs_source)))
 
66
$(error Only a single file may be specified in CONFIG_INITRAMFS_SOURCE (="$(quotefixed_initramfs_source)") when a cpio archive is directly specified.)
 
67
endif
 
68
# Now use the cpio archive directly
 
69
initramfs_data_cpio = $(quotefixed_initramfs_source)
 
70
targets += $(quotefixed_initramfs_source)
 
71
 
 
72
else
 
73
 
 
74
# INITRAMFS_SOURCE is not a cpio archive - create one
 
75
hostprogs-y  := gen_init_cpio
 
76
 
 
77
$(obj)/initramfs_data.cpio: $(obj)/gen_init_cpio \
 
78
                            $(obj)/initramfs_list FORCE
 
79
        $(call if_changed,cpio)
 
80
 
 
81
targets += initramfs_data.cpio
 
82
initramfs_data_cpio = $(obj)/initramfs_data.cpio
 
83
 
 
84
endif
 
85
 
 
86
$(obj)/initramfs_data.cpio.gz: $(initramfs_data_cpio) FORCE
 
87
        $(call if_changed,gzip)
 
88
 
 
89
targets += initramfs_data.cpio.gz
 
90
 
 
91
# Cleaning time
 
92
clean-files  := initramfs_data.cpio.gz initramfs_list