Imported Debian patch 3.6-2
[debian/elilo] / Makefile
1 #
2 #  Copyright (C) 2001-2003 Hewlett-Packard Co.
3 #       Contributed by Stephane Eranian <eranian@hpl.hp.com>
4 #
5 # This file is part of ELILO, the LINUX EFI boot loader.
6 #
7 #  ELILO is free software; you can redistribute it and/or modify
8 #  it under the terms of the GNU General Public License as published by
9 #  the Free Software Foundation; either version 2, or (at your option)
10 #  any later version.
11 #
12 #  ELILO is distributed in the hope that it will be useful,
13 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #  GNU General Public License for more details.
16 #
17 #  You should have received a copy of the GNU General Public License
18 #  along with ELILO; see the file COPYING.  If not, write to the Free
19 #  Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 #  02111-1307, USA.
21 #
22 # Please check out the elilo.txt for complete documentation on how
23 # to use this program.
24 #
25
26 include Make.defaults
27 TOPDIR=.
28
29
30 CRTOBJS       = $(EFICRT0)/crt0-efi-$(ARCH).o
31 LDSCRIPT      = $(EFICRT0)/elf_$(ARCH)_efi.lds
32
33 LDFLAGS      += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS)
34 LOADLIBES     = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
35 FORMAT        = efi-app-$(ARCH)
36
37 FILESYSTEM    =
38
39 ifeq ($(CONFIG_localfs),y)
40 FILESYSTEMS += glue_localfs.o
41 endif
42
43 ifeq ($(CONFIG_ext2fs),y)
44 FILESYSTEMS += glue_ext2fs.o
45 endif
46
47 ifeq ($(CONFIG_netfs),y)
48 FILESYSTEMS += glue_netfs.o
49 endif
50
51 SUBDIRS = fs choosers devschemes tools
52
53 ifeq ($(ARCH),ia64)
54 SUBDIRS += ia64
55 endif
56
57 ifeq ($(ARCH),ia32)
58 SUBDIRS += ia32
59 endif
60
61 FILES = elilo.o getopt.o strops.o loader.o \
62         fileops.o util.o vars.o alloc.o chooser.o  \
63         config.o initrd.o alternate.o bootparams.o \
64         gunzip.o fs/fs.o \
65         choosers/choosers.o \
66         devschemes/devschemes.o \
67         $(ARCH)/sysdeps.o \
68         $(FILESYSTEMS)
69
70 TARGETS = elilo.efi
71
72 all: check_gcc $(SUBDIRS) $(TARGETS)
73
74 elilo.efi: elilo.so
75
76 elilo.so: $(FILES)
77
78 elilo.o : elilo.c
79
80 fileops.o : Make.defaults
81 chooser.o : Make.defaults
82
83 $(SUBDIRS): dummy
84         $(MAKE) -C $@
85
86 dummy:
87
88 clean:
89         @set -e ; for d in $(SUBDIRS) ; do $(MAKE) -C $$d $@ ; done
90         rm -f $(TARGETS) *~ *.so $(FILES)
91
92 .PRECIOUS: elilo.so
93
94 #
95 # on both platforms you must use gcc 3.0 or higher 
96 #
97 check_gcc:
98 ifeq ($(GCC_VERSION),2)
99         @echo "you need to use a version of gcc >= 3.0, you are using `$(CC) --version`"
100         @exit 1
101 endif
102
103 include Make.rules