Magellan Linux

Contents of /trunk/mkinitrd-magellan/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1131 - (show annotations) (download)
Thu Aug 19 08:26:49 2010 UTC (14 years, 2 months ago) by niro
File size: 1943 byte(s)
-dropped nash - not needed anymore
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 make -C busybox defconfig
28 make -C busybox
29 sed 's:%VERSIONTAG%:$(VERSION):' < mkinitrd.in > mkinitrd
30
31 test: all
32 for i in grubby busybox klibc; do make -C $$i test; done
33
34 install:
35 for n in $(SUBDIRS); do make -C $$n install DESTDIR=$(DESTDIR); done
36 for i in etc/conf.d sbin usr/sbin $(mandir)/man8 $(docdir)/busybox $(docdir)/klibc; do \
37 if [ ! -d $(DESTDIR)/$$i ]; then \
38 mkdir -p $(DESTDIR)/$$i; \
39 fi; \
40 done
41 install -m755 mkinitrd $(DESTDIR)/sbin/mkinitrd
42 install -m755 installkernel $(DESTDIR)/sbin/installkernel
43 chmod 755 $(DESTDIR)/sbin/mkinitrd
44 install -m644 mkinitrd.8 $(DESTDIR)/$(mandir)/man8/mkinitrd.8
45 install -m644 mkinitrd.confd $(DESTDIR)/etc/conf.d/mkinitrd
46 install -m755 busybox/busybox $(DESTDIR)/usr/sbin/busybox.mkinitrd
47 cat busybox/LICENSE | gzip -9 > $(DESTDIR)/$(docdir)/busybox/LICENSE.gz
48 cat busybox/README | gzip -9 > $(DESTDIR)/$(docdir)/busybox/README.gz
49 cat busybox/TODO | gzip -9 > $(DESTDIR)/$(docdir)/busybox/TODO.gz
50 install -m755 klibc/usr/kinit/run-init/static/run-init $(DESTDIR)/usr/sbin/run-init.mkinitrd
51 cat klibc/usr/klibc/README | gzip -9 > $(DESTDIR)/$(docdir)/klibc/README.gz
52 cat klibc/usr/klibc/LICENSE | gzip -9 > $(DESTDIR)/$(docdir)/klibc/LICENSE.gz
53
54 clean:
55 for n in $(SUBDIRS) busybox klibc isolinux; do make -C $$n clean; done
56 rm -f mkinitrd
57 rm klibc/linux
58
59 mrproper: clean
60 make -C busybox mrproper
61 make -C klibc mrproper