Contents of /trunk/mkinitrd-magellan/Makefile
Parent Directory | Revision Log
Revision 1137 -
(show annotations)
(download)
Thu Aug 19 10:12:53 2010 UTC (14 years, 2 months ago) by niro
File size: 2018 byte(s)
Thu Aug 19 10:12:53 2010 UTC (14 years, 2 months ago) by niro
File size: 2018 byte(s)
-added upstream mdev patch
1 | VERSION=$(shell cat VERSION) |
2 | |
3 | ARCH := $(patsubst i%86,i386,$(shell uname -m)) |
4 | ARCH := $(patsubst sparc%,sparc,$(ARCH)) |
5 | |
6 | SUBDIRS = grubby livecd isolinux |
7 | |
8 | #ifeq ($(ARCH),sparc) |
9 | #SUBDIRS += loadinitrd |
10 | #endif |
11 | |
12 | #ifeq ($(ARCH),i386) |
13 | #SUBDIRS += loadinitrd |
14 | #endif |
15 | |
16 | OPTCFLAGS = $(CFLAGS) |
17 | LINUX_SOURCES=/usr/src/linux |
18 | |
19 | mandir = usr/share/man |
20 | docdir = usr/share/doc/mkinitrd-$(VERSION) |
21 | |
22 | all: |
23 | for n in $(SUBDIRS); do make -C $$n; done |
24 | # use linux sources from default path, not the installed kernel |
25 | ln -snf $(LINUX_SOURCES) klibc/linux |
26 | make -C klibc |
27 | # force chmod +x for scripts in busybox |
28 | chmod +x busybox/scripts/*.sh |
29 | make -C busybox defconfig |
30 | make -C busybox |
31 | sed 's:%VERSIONTAG%:$(VERSION):' < mkinitrd.in > mkinitrd |
32 | |
33 | test: all |
34 | for i in grubby busybox klibc; do make -C $$i test; done |
35 | |
36 | install: |
37 | for n in $(SUBDIRS); do make -C $$n install DESTDIR=$(DESTDIR); done |
38 | for i in etc/conf.d sbin usr/sbin $(mandir)/man8 $(docdir)/busybox $(docdir)/klibc; do \ |
39 | if [ ! -d $(DESTDIR)/$$i ]; then \ |
40 | mkdir -p $(DESTDIR)/$$i; \ |
41 | fi; \ |
42 | done |
43 | install -m755 mkinitrd $(DESTDIR)/sbin/mkinitrd |
44 | install -m755 installkernel $(DESTDIR)/sbin/installkernel |
45 | chmod 755 $(DESTDIR)/sbin/mkinitrd |
46 | install -m644 mkinitrd.8 $(DESTDIR)/$(mandir)/man8/mkinitrd.8 |
47 | install -m644 mkinitrd.confd $(DESTDIR)/etc/conf.d/mkinitrd |
48 | install -m755 busybox/busybox $(DESTDIR)/usr/sbin/busybox.mkinitrd |
49 | cat busybox/LICENSE | gzip -9 > $(DESTDIR)/$(docdir)/busybox/LICENSE.gz |
50 | cat busybox/README | gzip -9 > $(DESTDIR)/$(docdir)/busybox/README.gz |
51 | cat busybox/TODO | gzip -9 > $(DESTDIR)/$(docdir)/busybox/TODO.gz |
52 | install -m755 klibc/usr/kinit/run-init/static/run-init $(DESTDIR)/usr/sbin/run-init.mkinitrd |
53 | cat klibc/usr/klibc/README | gzip -9 > $(DESTDIR)/$(docdir)/klibc/README.gz |
54 | cat klibc/usr/klibc/LICENSE | gzip -9 > $(DESTDIR)/$(docdir)/klibc/LICENSE.gz |
55 | |
56 | clean: |
57 | for n in $(SUBDIRS) busybox klibc isolinux; do make -C $$n clean; done |
58 | rm -f mkinitrd |
59 | rm -f klibc/linux |
60 | |
61 | mrproper: clean |
62 | make -C busybox mrproper |
63 | make -C klibc mrproper |