xref: /DragonStub/lib/Makefile (revision ce7098fb52e5fd4d16038964d029eb759f28eaaf)
1530d68baSNigel Croxon#
2530d68baSNigel Croxon#  Copyright (C) 1999-2001 Hewlett-Packard Co.
3530d68baSNigel Croxon#	Contributed by David Mosberger <davidm@hpl.hp.com>
4530d68baSNigel Croxon#	Contributed by Stephane Eranian <eranian@hpl.hp.com>
5530d68baSNigel Croxon#
6530d68baSNigel Croxon#    All rights reserved.
7530d68baSNigel Croxon#
8530d68baSNigel Croxon#    Redistribution and use in source and binary forms, with or without
9530d68baSNigel Croxon#    modification, are permitted provided that the following conditions
10530d68baSNigel Croxon#    are met:
11530d68baSNigel Croxon#
12530d68baSNigel Croxon#    * Redistributions of source code must retain the above copyright
13530d68baSNigel Croxon#      notice, this list of conditions and the following disclaimer.
14530d68baSNigel Croxon#    * Redistributions in binary form must reproduce the above
15530d68baSNigel Croxon#      copyright notice, this list of conditions and the following
16530d68baSNigel Croxon#      disclaimer in the documentation and/or other materials
17530d68baSNigel Croxon#      provided with the distribution.
18530d68baSNigel Croxon#    * Neither the name of Hewlett-Packard Co. nor the names of its
19530d68baSNigel Croxon#      contributors may be used to endorse or promote products derived
20530d68baSNigel Croxon#      from this software without specific prior written permission.
21530d68baSNigel Croxon#
22530d68baSNigel Croxon#    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23530d68baSNigel Croxon#    CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24530d68baSNigel Croxon#    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25530d68baSNigel Croxon#    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26530d68baSNigel Croxon#    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
27530d68baSNigel Croxon#    BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
28530d68baSNigel Croxon#    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29530d68baSNigel Croxon#    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30530d68baSNigel Croxon#    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31530d68baSNigel Croxon#    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
32530d68baSNigel Croxon#    TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
33530d68baSNigel Croxon#    THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34530d68baSNigel Croxon#    SUCH DAMAGE.
35530d68baSNigel Croxon#
36530d68baSNigel Croxon
37530d68baSNigel CroxonSRCDIR = .
38530d68baSNigel Croxon
39530d68baSNigel CroxonVPATH = $(SRCDIR)
40530d68baSNigel Croxon
41530d68baSNigel Croxoninclude $(SRCDIR)/../Make.defaults
42530d68baSNigel Croxon
43530d68baSNigel CroxonTOPDIR = $(SRCDIR)/..
44530d68baSNigel Croxon
45530d68baSNigel CroxonCDIR = $(TOPDIR)/..
46530d68baSNigel CroxonFILES = boxdraw smbios console crc data debug dpath  \
47530d68baSNigel Croxon        error event guid hand hw init lock   \
48530d68baSNigel Croxon        misc print sread str cmdline \
49530d68baSNigel Croxon	runtime/rtlock runtime/efirtlib runtime/rtstr runtime/vm runtime/rtdata  \
50530d68baSNigel Croxon	$(ARCH)/initplat $(ARCH)/math
51530d68baSNigel Croxon
52530d68baSNigel Croxonifeq ($(ARCH),ia64)
53530d68baSNigel CroxonFILES += $(ARCH)/salpal $(ARCH)/palproc
54530d68baSNigel Croxonendif
55530d68baSNigel Croxon
56530d68baSNigel Croxonifeq ($(ARCH),x86_64)
57530d68baSNigel CroxonFILES += $(ARCH)/callwrap $(ARCH)/efi_stub
58530d68baSNigel Croxonendif
59530d68baSNigel Croxon
60530d68baSNigel Croxonifeq ($(ARCH),arm)
61530d68baSNigel CroxonFILES += $(ARCH)/lib1funcs $(ARCH)/div64
62530d68baSNigel Croxonendif
63530d68baSNigel Croxon
64530d68baSNigel CroxonOBJS  = $(FILES:%=%.o)
65530d68baSNigel Croxon
66530d68baSNigel CroxonSUBDIRS = ia32 x86_64 ia64 runtime
67530d68baSNigel Croxon
68*ce7098fbSNigel CroxonLIBDIRINSTALL = $(INSTALLROOT)$(LIBDIR)
69530d68baSNigel Croxon
70530d68baSNigel Croxonall: libsubdirs libefi.a
71530d68baSNigel Croxon
72530d68baSNigel Croxon.PHONY: libsubdirs
73530d68baSNigel Croxonlibsubdirs:
74530d68baSNigel Croxon	for sdir in $(SUBDIRS); do mkdir -p $$sdir; done
75530d68baSNigel Croxon
76530d68baSNigel Croxonlibefi.a: $(patsubst %,libefi.a(%),$(OBJS))
77530d68baSNigel Croxon
78530d68baSNigel Croxonclean:
79530d68baSNigel Croxon	rm -f libefi.a *~ $(OBJS) */*.o
80530d68baSNigel Croxon
81530d68baSNigel Croxon$(LIBDIRINSTALL):
82530d68baSNigel Croxon	mkdir -p $@
83530d68baSNigel Croxon
84530d68baSNigel Croxon$(LIBDIRINSTALL)/libefi.a: libefi.a | $(LIBDIRINSTALL)
85530d68baSNigel Croxon	$(INSTALL) -m 644 $< $(dir $@)
86530d68baSNigel Croxon
87530d68baSNigel Croxoninstall: $(LIBDIRINSTALL)/libefi.a
88530d68baSNigel Croxon
89530d68baSNigel Croxoninclude $(SRCDIR)/../Make.rules
90530d68baSNigel Croxon
91530d68baSNigel Croxon.PHONY: libsubdirs
92