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