don't double patch!
[debian/elilo] / debian / patches / cross-build.diff
1 diff --git a/Makefile b/Makefile
2 index f0efebd..9d82cbf 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -25,15 +25,19 @@
6  # to use this program.
7  #
8  
9 -include Make.defaults
10 -TOPDIR=.
11 +SRCDIR = .
12 +
13 +VPATH = $(SRCDIR)
14 +
15 +include $(SRCDIR)/Make.defaults
16 +TOPDIR = $(SRCDIR)
17  
18  
19  CRTOBJS       = $(EFICRT0)/crt0-efi-$(ARCH).o
20  LDSCRIPT      = $(EFICRT0)/elf_$(ARCH)_efi.lds
21  
22  LDFLAGS             += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS)
23 -LOADLIBES     = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
24 +LOADLIBES     = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
25  FORMAT        = efi-app-$(ARCH)
26  
27  FILESYSTEM    =
28 @@ -87,7 +91,8 @@ fileops.o : Make.defaults
29  chooser.o : Make.defaults
30  
31  $(SUBDIRS): dummy
32 -       $(MAKE) -C $@
33 +       mkdir -p $@
34 +       $(MAKE) -C $@ -f $(SRCDIR)/../$@/Makefile SRCDIR=$(SRCDIR)/../$@ ARCH=$(ARCH)
35  
36  dummy:
37  
38 @@ -106,4 +111,4 @@ ifeq ($(GCC_VERSION),2)
39         @exit 1
40  endif
41  
42 -include Make.rules
43 +include $(SRCDIR)/Make.rules
44 diff --git a/choosers/Makefile b/choosers/Makefile
45 index 9915f48..85d31c7 100644
46 --- a/choosers/Makefile
47 +++ b/choosers/Makefile
48 @@ -23,10 +23,15 @@
49  # to use this program.
50  #
51  
52 -include ../Make.defaults
53 -include ../Make.rules
54 +SRCDIR = .
55 +
56 +VPATH = $(SRCDIR)
57 +
58 +include $(SRCDIR)/../Make.defaults
59 +include $(SRCDIR)/../Make.rules
60 +
61 +TOPDIR=$(SRCDIR)/..
62  
63 -TOPDIR=$(CDIR)/..
64  
65  FILES=
66  
67 @@ -47,7 +52,8 @@ $(TARGET): $(TOPDIR)/Make.defaults $(FILES)
68                 echo "You need to define at least one chooser in Make.defaults"; \
69                 exit 1; \
70         fi
71 -       $(LD) -o $@ -r $(FILES)
72 +       $(LD) $(LD3264) -o $@ -r $(FILES)
73 +
74  
75  clean:
76         $(RM) -f $(TARGET) $(FILES)
77 diff --git a/devschemes/Makefile b/devschemes/Makefile
78 index 6ac05af..5328cb1 100644
79 --- a/devschemes/Makefile
80 +++ b/devschemes/Makefile
81 @@ -23,10 +23,15 @@
82  # to use this program.
83  #
84  
85 -include ../Make.defaults
86 -include ../Make.rules
87 +SRCDIR = .
88 +
89 +VPATH = $(SRCDIR)
90 +
91 +include $(SRCDIR)/../Make.defaults
92 +include $(SRCDIR)/../Make.rules
93 +
94 +TOPDIR=$(SRCDIR)/..
95  
96 -TOPDIR=$(CDIR)/..
97  
98  FILES=simple.o
99  
100 @@ -40,7 +45,7 @@ all: $(TARGET)
101  #      without doing make clean.
102  #
103  $(TARGET): $(FILES)
104 -       $(LD) -r -o $@ $(FILES)
105 +       $(LD) $(LD3264) -r -o $@ $(FILES)
106  
107  clean:
108         $(RM) -f $(TARGET) $(FILES)
109 diff --git a/fs/Makefile b/fs/Makefile
110 index 8e422b2..0bb303f 100644
111 --- a/fs/Makefile
112 +++ b/fs/Makefile
113 @@ -23,10 +23,15 @@
114  # to use this program.
115  #
116  
117 -include ../Make.defaults
118 -include ../Make.rules
119 +SRCDIR = .
120 +
121 +VPATH = $(SRCDIR)
122 +
123 +include $(SRCDIR)/../Make.defaults
124 +include $(SRCDIR)/../Make.rules
125 +
126 +TOPDIR=$(SRCDIR)/..
127  
128 -TOPDIR=$(CDIR)/..
129  
130  FILES=
131  ifeq ($(CONFIG_localfs),y)
132 @@ -59,7 +64,7 @@ $(TARGET): $(TOPDIR)/Make.defaults $(FILES)
133                 echo "You need to define at least one filesystem in Make.defaults"; \
134                 exit 1; \
135         fi
136 -       $(LD) -r -o $@ $(FILES)
137 +       $(LD) $(LD3264) -r -o $@ $(FILES)
138  
139  clean:
140         $(RM) -f $(TARGET) $(FILES)
141 diff --git a/ia32/Makefile b/ia32/Makefile
142 index 353ae67..c5f421b 100644
143 --- a/ia32/Makefile
144 +++ b/ia32/Makefile
145 @@ -23,10 +23,15 @@
146  # to use this program.
147  #
148  
149 -include ../Make.defaults
150 -include ../Make.rules
151 +SRCDIR = .
152 +
153 +VPATH = $(SRCDIR)
154 +
155 +include $(SRCDIR)/../Make.defaults
156 +include $(SRCDIR)/../Make.rules
157 +
158 +TOPDIR=$(SRCDIR)/..
159  
160 -TOPDIR=$(CDIR)/..
161  
162  FILES=system.o config.o bzimage.o plain_loader.o gzip_loader.o gzip.o
163  
164 @@ -37,13 +42,13 @@ all: $(TARGET)
165  system.o: rmswitch.h
166  
167  rmswitch.h: bin_to_h.c rmswitch.S
168 -       $(CC) -o bin_to_h bin_to_h.c
169 -       $(AS) -o rmswitch.o rmswitch.S
170 +       $(CC) -o bin_to_h $(SRCDIR)/bin_to_h.c
171 +       $(AS) -o rmswitch.o $(SRCDIR)/rmswitch.S
172         $(LD) -Ttext 0x0 -s --oformat binary -o rmswitch rmswitch.o
173         ./bin_to_h <rmswitch >rmswitch.h
174  
175  $(TARGET): $(FILES)
176 -       $(LD) -r -o $@ $(FILES)
177 +       $(LD) $(LD3264) -r -o $@ $(FILES)
178  
179  clean:
180         $(RM) -f $(TARGET) $(FILES)
181 diff --git a/ia64/Makefile b/ia64/Makefile
182 index a243d0f..bee0a2b 100644
183 --- a/ia64/Makefile
184 +++ b/ia64/Makefile
185 @@ -23,10 +23,15 @@
186  # to use this program.
187  #
188  
189 -include ../Make.defaults
190 -include ../Make.rules
191 +SRCDIR = .
192 +
193 +VPATH = $(SRCDIR)
194 +
195 +include $(SRCDIR)/../Make.defaults
196 +include $(SRCDIR)/../Make.rules
197 +
198 +TOPDIR=$(SRCDIR)/..
199  
200 -TOPDIR=$(CDIR)/..
201  
202  FILES=system.o config.o fpswa.o plain_loader.o gzip_loader.o \
203        gzip.o memset.o memcpy.o setjmp.o longjmp.o
204 diff --git a/tools/Makefile b/tools/Makefile
205 index 8858224..97083d7 100644
206 --- a/tools/Makefile
207 +++ b/tools/Makefile
208 @@ -23,10 +23,15 @@
209  # to use this program.
210  #
211  
212 -include ../Make.defaults
213 -include ../Make.rules
214 +SRCDIR = .
215 +
216 +VPATH = $(SRCDIR)
217 +
218 +include $(SRCDIR)/../Make.defaults
219 +include $(SRCDIR)/../Make.rules
220 +
221 +TOPDIR=$(SRCDIR)/..
222  
223 -TOPDIR=$(CDIR)/..
224  
225  FILES=eliloalt.o
226  TARGET=eliloalt
227 diff --git a/x86_64/Makefile b/x86_64/Makefile
228 index 4af4b8d..7ade312 100644
229 --- a/x86_64/Makefile
230 +++ b/x86_64/Makefile
231 @@ -23,10 +23,15 @@
232  # to use this program.
233  #
234  
235 -include ../Make.defaults
236 -include ../Make.rules
237 +SRCDIR = .
238 +
239 +VPATH = $(SRCDIR)
240 +
241 +include $(SRCDIR)/../Make.defaults
242 +include $(SRCDIR)/../Make.rules
243 +
244 +TOPDIR=$(SRCDIR)/..
245  
246 -TOPDIR=$(CDIR)/..
247  
248  FILES=system.o config.o bzimage.o plain_loader.o gzip_loader.o gzip.o
249  #FILES=system.o config.o plain_loader.o
250 @@ -38,13 +43,13 @@ all: $(TARGET)
251  system.o: rmswitch.h
252  
253  rmswitch.h: bin_to_h.c rmswitch.S
254 -       $(CC) -o bin_to_h bin_to_h.c
255 -       $(AS) -o rmswitch.o rmswitch.S
256 +       $(CC) -o bin_to_h $(SRCDIR)/bin_to_h.c
257 +       $(AS) -o rmswitch.o $(SRCDIR)/rmswitch.S
258         $(LD) -Ttext 0x0 -s --oformat binary -o rmswitch rmswitch.o
259         ./bin_to_h <rmswitch >rmswitch.h
260  
261  $(TARGET): $(FILES)
262 -       $(LD) -r -o $@ $(FILES)
263 +       $(LD) $(LD3264) -r -o $@ $(FILES)
264  
265  clean:
266         $(RM) -f $(TARGET) $(FILES)