Magellan Linux

Contents of /trunk/mkinitrd-magellan/isolinux/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1135 - (show annotations) (download)
Thu Aug 19 10:02:12 2010 UTC (14 years, 2 months ago) by niro
File size: 2771 byte(s)
-fixed 'make install' target
1 ## -----------------------------------------------------------------------
2 ##
3 ## Copyright 1998-2009 H. Peter Anvin - All Rights Reserved
4 ## Copyright 2009 Intel Corporation; author: H. Peter Anvin
5 ##
6 ## This program is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9 ## Boston MA 02111-1307, USA; either version 2 of the License, or
10 ## (at your option) any later version; incorporated herein by reference.
11 ##
12 ## -----------------------------------------------------------------------
13
14 #
15 # Makefile for the SYSLINUX core
16 #
17
18 # No builtin rules
19 MAKEFLAGS += -r
20 MAKE += -r
21
22 topdir = .
23 include $(topdir)/MCONFIG.embedded
24 -include $(topdir)/version.mk
25
26 OPTFLAGS =
27 INCLUDES =
28
29 # The targets to build in this directory...
30 BTARGET = kwdhash.gen isolinux.bin
31
32 # All primary source files for the main syslinux files
33 NASMSRC = $(wildcard *.asm)
34 NASMHDR = $(wildcard *.inc)
35 CSRC = $(wildcard *.c)
36 CHDR = $(wildcard *.h)
37 OTHERSRC = keywords
38 ALLSRC = $(NASMSRC) $(NASMHDR) $(CSRC) $(CHDR) $(OTHERSRC)
39
40 MKINITRD_VERSION = $(shell cat ../VERSION)
41
42 DOCS = COPYING NEWS README TODO BUGS VERSION isolinux.txt
43
44 LIBDIR = /usr/lib/mkinitrd
45 DOCDIR = /usr/share/doc/mkinitrd-$(MKINITRD_VERSION)/isolinux
46
47 # The DATE is set on the make command line when building binaries for
48 # official release. Otherwise, substitute a hex string that is pretty much
49 # guaranteed to be unique to be unique from build to build.
50 ifndef HEXDATE
51 HEXDATE := $(shell $(PERL) now.pl $(SRCS))
52 endif
53 ifndef DATE
54 DATE := $(shell sh gen-id.sh $(VERSION) $(HEXDATE))
55 endif
56
57 all: $(BTARGET)
58
59 kwdhash.gen: keywords genhash.pl
60 $(PERL) genhash.pl < keywords > kwdhash.gen
61
62 .PRECIOUS: %.elf
63
64 # Standard rule for {isolinux,isolinux-debug}.bin
65 iso%.bin: iso%.elf checksumiso.pl
66 $(OBJCOPY) -O binary $< $@
67 $(PERL) checksumiso.pl $@
68
69 %.o: %.asm kwdhash.gen version.gen
70 ( $(NASM) -M -DDEPEND $(NINCLUDE) -o $@ $< ; echo '' ) > .$@.d; true
71 $(NASM) $(NASMOPT) -f elf -g -F stabs -DDATE_STR="'$(DATE)'" \
72 -DHEXDATE="$(HEXDATE)" \
73 -l $(@:.o=.lsr) -o $@ $<
74
75 %.elf: %.o syslinux.ld
76 $(LD) $(LDFLAGS) -T syslinux.ld -M -o $@ $< > $(@:.elf=.map)
77 $(OBJDUMP) -h $@ > $(@:.elf=.sec)
78 $(PERL) lstadjust.pl $(@:.elf=.lsr) $(@:.elf=.sec) $(@:.elf=.lst)
79
80 install:
81 mkdir -p $(DESTDIR)/$(LIBDIR)
82 mkdir -p $(DESTDIR)/$(DOCDIR)
83 install -m755 -c isolinux.bin $(DESTDIR)/$(LIBDIR)
84 for n in $(DOCS); do install -m644 $$n $(DESTDIR)/$(DOCDIR); done
85
86 tidy dist:
87 rm -f codepage.cp *.o *.elf stupid.* patch.offset .depend .*.d
88 rm -f *.lsr *.lst *.map *.sec
89 rm -f $(OBSOLETE)
90 rm -f $(BTARGET) *.bin *_bin.c
91
92 clean: tidy
93
94 # Include dependencies file
95 -include .*.d