xref: /DragonStub/Make.rules (revision 50b27a854cb20d1f25eec2f60acd2d29e162d201)
1530d68baSNigel Croxon#
2530d68baSNigel Croxon#  Copyright (C) 1999-2007 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
37e1efa4d7SCallum Farmer.SECONDARY:
38e1efa4d7SCallum Farmer
39530d68baSNigel Croxon%.efi: %.so
40b3e80c38SCallum Farmer	$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .rodata -j .rel \
41530d68baSNigel Croxon		    -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
42*50b27a85SCallum Farmer		    -j .areloc -j .reloc $(FORMAT) $*.so $@
43530d68baSNigel Croxon
4411a459baSNigel Croxon%.efi.debug: %.so
4511a459baSNigel Croxon	$(OBJCOPY) -j .debug_info -j .debug_abbrev -j .debug_aranges \
4611a459baSNigel Croxon		-j .debug_line -j .debug_str -j .debug_ranges \
4711a459baSNigel Croxon		-j .note.gnu.build-id \
4811a459baSNigel Croxon		$(FORMAT) $*.so $@
4911a459baSNigel Croxon
50530d68baSNigel Croxon%.so: %.o
51530d68baSNigel Croxon	$(LD) $(LDFLAGS) $^ -o $@ $(LOADLIBES)
52530d68baSNigel Croxon
53530d68baSNigel Croxon%.o: %.c
54530d68baSNigel Croxon	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
55530d68baSNigel Croxon
56de4e5e4eSNigel Croxon%.s: %.c
57530d68baSNigel Croxon	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -S $< -o $@
58530d68baSNigel Croxon
59de4e5e4eSNigel Croxon%.i: %.c
60de4e5e4eSNigel Croxon	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -E $< -o $@
61de4e5e4eSNigel Croxon
62de4e5e4eSNigel Croxon%.o: %.S
63de4e5e4eSNigel Croxon	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
64de4e5e4eSNigel Croxon
65de4e5e4eSNigel Croxon%.s: %.S
66530d68baSNigel Croxon	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -E $< -o $@
67