0ab87ea93ee42c1e4ae42e7c34f3992ebdacc7dd
[linux-flexiantxendom0-3.2.10.git] / usr / Makefile
1
2 obj-y := initramfs_data.o
3
4 host-progs  := gen_init_cpio
5
6 clean-files := initramfs_data.cpio.gz
7
8 $(obj)/initramfs_data.S: $(obj)/initramfs_data.cpio.gz
9         echo '.section ".init.ramfs", "a"' > $@
10         od -v -An -t x1 -w8 $^ | cut -c2- | sed -e s"/ /,0x/g" -e s"/^/.byte 0x"/ >> $@
11
12 # initramfs-y are the programs which will be copied into the CPIO
13 # archive. Currently, the filenames are hardcoded in gen_init_cpio,
14 # but we need the information for the build as well, so it's duplicated
15 # here.
16
17 # Commented out for now
18 # initramfs-y := $(obj)/root/hello
19
20 quiet_cmd_cpio = CPIO    $@
21       cmd_cpio = ./$< > $@
22
23 $(obj)/initramfs_data.cpio: $(obj)/gen_init_cpio $(initramfs-y) FORCE
24         $(call if_changed,cpio)
25
26 targets += initramfs_data.cpio
27
28 $(obj)/initramfs_data.cpio.gz: $(obj)/initramfs_data.cpio FORCE
29         $(call if_changed,gzip)
30
31 targets += initramfs_data.cpio.gz
32