New Language: Ada
[platform/upstream/gcc.git] / gcc / ada / Make-lang.in
1 # Top level makefile fragment for GNU Ada (GNAT).
2 #   Copyright (C) 1994, 1995, 1996, 1997, 1997, 1999, 2000, 2001
3 #   Free Software Foundation, Inc.
4
5 #This file is part of GNU CC.
6
7 #GNU CC 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 #GNU CC 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 GNU CC; see the file COPYING.  If not, write to
19 #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 # This file provides the language dependent support in the main Makefile.
22 # Each language makefile fragment must provide the following targets:
23 #
24 # foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
25 # foo.info, foo.dvi,
26 # foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
27 # foo.uninstall, foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
28 # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
29 #
30 # where `foo' is the name of the language.
31 #
32 # It should also provide rules for:
33 #
34 # - making any compiler driver (eg: g++)
35 # - the compiler proper (eg: cc1plus)
36 # - define the names for selecting the language in LANGUAGES.
37 # tool definitions
38 CHMOD = chmod
39 CHMOD_AX_FLAGS = a+x
40 MV = mv
41 MKDIR = mkdir -p
42 RM = rm -f
43 RMDIR = rm -rf
44 # default extensions
45 shext  =
46 \f
47 # Extra flags to pass to recursive makes.
48 BOOT_ADAFLAGS= $(ADAFLAGS)
49 ADAFLAGS= -gnatpg -gnata
50 GNATLIBFLAGS= -gnatpg
51 GNATLIBCFLAGS= -g -O2
52 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
53 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
54 THREAD_KIND=native
55 GNATBIND = gnatbind
56 ADA_FLAGS_TO_PASS = \
57         "ADA_FOR_BUILD=$(ADA_FOR_BUILD)" \
58         "ADA_INCLUDE_DIR=$(ADA_INCLUDE_DIR)" \
59         "ADA_RTL_OBJ_DIR=$(ADA_RTL_OBJ_DIR)" \
60         "ADAFLAGS=$(ADAFLAGS)" \
61         "ADA_FOR_TARGET=$(ADA_FOR_TARGET)" \
62         "INSTALL_DATA=$(INSTALL_DATA)" \
63         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
64
65 # Define the names for selecting Ada in LANGUAGES.
66 Ada ada: gnat1$(exeext) gnatbind$(exeext)
67
68 # Tell GNU Make to ignore these, if they exist.
69 .PHONY: Ada ada
70
71 # There are too many Ada sources to check against here.  Let's
72 # always force the recursive make.
73 gnat1$(exeext): prefix.o $(LIBDEPS) $(BACKEND) force
74         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
75                 ../gnat1$(exeext)
76
77 gnatbind$(exeext): force
78         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
79                 ../gnatbind$(exeext)
80
81 gnatmake$(exeext): force
82         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
83                 ../gnatmake$(exeext)
84
85 gnatbl$(exeext): force
86         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
87                 ../gnatbl$(exeext)
88
89 gnatchop$(exeext): force
90         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
91                 ../gnatchop$(exeext)
92
93 gnatcmd$(exeext): force
94         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
95                 ../gnatcmd$(exeext)
96
97 gnatlink$(exeext): force
98         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
99                 ../gnatlink$(exeext)
100
101 gnatkr$(exeext): force
102         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
103                 ../gnatkr$(exeext)
104
105 gnatls$(exeext): force
106         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
107                 ../gnatls$(exeext)
108
109 gnatmem$(exeext): force
110         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
111                 ../gnatmem$(exeext)
112
113 gnatprep$(exeext): force
114         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
115                 ../gnatprep$(exeext)
116
117 gnatpsta$(exeext): force
118         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
119                 ../gnatpsta$(exeext)
120
121 gnatpsys$(exeext): force
122         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
123                 ../gnatpsys$(exeext)
124
125 gnatxref$(exeext): force
126         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
127                 ../gnatxref$(exeext)
128
129 gnatfind$(exeext): force
130         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
131                 ../gnatfind$(exeext)
132
133 # Gnatlbr is extra tool only used on VMS
134
135 gnatlbr$(exeext): force
136         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
137                 ../gnatlbr$(exeext)
138
139 # use target-gcc
140 gnattools: $(GCC_PARTS) force
141         $(MAKE) $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
142            CC="../xgcc -B../" STAGE_PREFIX=../ \
143            gnatbl$(exeext) gnatchop$(exeext) gnatcmd$(exeext) \
144            gnatkr$(exeext) gnatlink$(exeext) \
145            gnatls$(exeext) gnatmake$(exeext) gnatmem$(exeext) \
146            gnatprep$(exeext) gnatpsta$(exeext) gnatpsys$(exeext) \
147        gnatxref$(exeext) gnatfind$(exeext) $(EXTRA_GNATTOOLS)
148
149 # use host-gcc
150 cross-gnattools: force
151         $(MAKE) $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
152            gnatbl$(exeext) gnatchop$(exeext) gnatcmd$(exeext) \
153            gnatkr$(exeext) gnatlink$(exeext) \
154            gnatls$(exeext) gnatmake$(exeext) gnatmem$(exeext) \
155            gnatprep$(exeext) gnatpsta$(exeext) gnatpsys$(exeext) \
156            gnatxref$(exeext) gnatfind$(exeext) $(EXTRA_GNATTOOLS)
157
158 gnatlib: force
159         $(MAKE) -C ada $(FLAGS_TO_PASS)  \
160            GNATLIBFLAGS="$(GNATLIBFLAGS)" \
161            GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
162            TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
163            THREAD_KIND="$(THREAD_KIND)" \
164            gnatlib
165
166 gnatlib-shared: force
167         $(MAKE) -C ada $(FLAGS_TO_PASS)  \
168            GNATLIBFLAGS="$(GNATLIBFLAGS)" \
169            GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
170            GNATLIBLDFLAGS="$(GNATLIBLDFLAGS)" \
171            TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
172            THREAD_KIND="$(THREAD_KIND)" \
173            gnatlib-shared
174
175 # use only for native compiler
176 gnatlib_and_tools: gnatlib gnattools
177
178 # use cross-gcc
179 gnat-cross: force
180         $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) gnat-cross
181 \f
182 # Build hooks:
183
184 ada.all.build: 
185 ada.all.cross:
186         -if [ -f gnatbind$(exeext) ] ; \
187         then \
188           $(MV) gnatbind$(exeext)  gnatbind-cross$(exeext); \
189         fi
190         -if [ -f gnatbl$(exeext) ] ; \
191         then \
192           $(MV) gnatbl$(exeext)    gnatbl-cross$(exeext); \
193         fi
194         -if [ -f gnatchop$(exeext) ] ; \
195         then \
196           $(MV) gnatchop$(exeext)   gnatchop-cross$(exeext); \
197         fi
198         -if [ -f gnatcmd$(exeext) ] ; \
199         then \
200            $(MV) gnatcmd$(exeext)  gnatcmd-cross$(exeext); \
201         fi
202         -if [ -f gnatkr$(exeext) ] ; \
203         then \
204           $(MV) gnatkr$(exeext)    gnatkr-cross$(exeext); \
205         fi
206         -if [ -f gnatlink$(exeext) ] ; \
207         then \
208            $(MV) gnatlink$(exeext)  gnatlink-cross$(exeext); \
209         fi
210         -if [ -f gnatls$(exeext) ] ; \
211         then \
212           $(MV) gnatls$(exeext)    gnatls-cross$(exeext); \
213         fi
214         -if [ -f gnatmake$(exeext) ] ; \
215         then \
216            $(MV) gnatmake$(exeext)  gnatmake-cross$(exeext); \
217         fi
218         -if [ -f gnatmem$(exeext) ] ; \
219         then \
220            $(MV) gnatmem$(exeext)  gnatmem-cross$(exeext); \
221         fi
222         -if [ -f gnatprep$(exeext) ] ; \
223         then \
224            $(MV) gnatprep$(exeext)  gnatprep-cross$(exeext); \
225         fi
226         -if [ -f gnatpsta$(exeext) ] ; \
227         then \
228            $(MV) gnatpsta$(exeext)  gnatpsta-cross$(exeext); \
229         fi
230         -if [ -f gnatpsys$(exeext) ] ; \
231         then \
232            $(MV) gnatpsys$(exeext)  gnatpsys-cross$(exeext); \
233         fi
234         -if [ -f gnatxref$(exeext) ] ; \
235         then \
236            $(MV) gnatxref$(exeext)  gnatxref-cross$(exeext); \
237         fi
238         -if [ -f gnatfind$(exeext) ] ; \
239         then \
240            $(MV) gnatfind$(exeext)  gnatfind-cross$(exeext); \
241         fi
242
243 ada.start.encap: 
244 ada.rest.encap: 
245 ada.info:
246 ada.dvi:
247 \f
248 # Install hooks:
249 # gnat1 is installed elsewhere as part of $(COMPILERS).
250
251 ada.install-normal:
252
253 # Install the binder program as $(target_alias)-gnatbind
254 # and also as either gnatbind (if native) or $(tooldir)/bin/gnatbind
255 # likewise for gnatf, gnatchop, and gnatlink, gnatkr, gnatmake, gnatcmd,
256 # gnatprep, gnatbl, gnatls, gnatxref, gnatfind
257 ada.install-common:
258         -if [ -f gnat1$(exeext) ] ; \
259          then \
260           if [ -f gnatbind-cross$(exeext) ] ; \
261           then \
262             $(RM) $(bindir)/$(target_alias)-gnatbind$(exeext); \
263             $(INSTALL_PROGRAM) gnatbind-cross$(exeext) $(bindir)/$(target_alias)-gnatbind$(exeext); \
264             if [ -d $(tooldir)/bin/. ] ; then \
265               rm -f $(tooldir)/bin/gnatbind$(exeext); \
266               $(INSTALL_PROGRAM) gnatbind-cross$(exeext) $(tooldir)/bin/gnatbind$(exeext); \
267             fi; \
268           else \
269             $(RM) $(bindir)/gnatbind$(exeext); \
270             $(INSTALL_PROGRAM) gnatbind$(exeext) $(bindir)/gnatbind$(exeext); \
271           fi ; \
272         fi
273         -if [ -f gnat1$(exeext) ] ; \
274         then \
275           if [ -f gnatbl-cross$(exeext) ] ; \
276           then \
277             $(RM) $(bindir)/$(target_alias)-gnatbl$(exeext); \
278             $(INSTALL_PROGRAM) gnatbl-cross$(exeext) $(bindir)/$(target_alias)-gnatbl$(exeext); \
279             if [ -d $(tooldir)/bin/. ] ; then \
280                rm -f $(tooldir)/bin/gnatbl$(exeext); \
281                $(INSTALL_PROGRAM) gnatbl-cross$(exeext) $(tooldir)/bin/gnatbl$(exeext); \
282             fi; \
283           else \
284             $(RM) $(bindir)/gnatbl$(exeext); \
285             $(INSTALL_PROGRAM) gnatbl$(exeext) $(bindir)/gnatbl$(exeext); \
286           fi ; \
287         fi
288         -if [ -f gnat1$(exeext) ] ; \
289         then \
290           if [ -f gnatchop-cross$(exeext) ] ; \
291           then \
292             $(RM) $(bindir)/$(target_alias)-gnatchop$(shext); \
293             $(INSTALL_PROGRAM) $(srcdir)/ada/gnatchop$(shext) $(bindir)/$(target_alias)-gnatchop$(shext); \
294             if [ -d $(tooldir)/bin/. ] ; then \
295                rm -f $(tooldir)/bin/gnatchop$(shext); \
296                $(INSTALL_PROGRAM) gnatchop$(shext) $(tooldir)/bin/gnatchop$(exeext); \
297             fi; \
298           else \
299             $(RM) $(bindir)/gnatchop$(shext); \
300             $(INSTALL_PROGRAM) $(srcdir)/ada/gnatchop$(shext) $(bindir)/gnatchop$(shext); \
301           fi ; \
302         fi
303         -if [ -f gnat1$(exeext) ] ; \
304         then \
305           if [ -f gnatchop-cross$(exeext) ] ; \
306           then \
307             $(RM) $(bindir)/$(target_alias)-gnatchop$(exeext); \
308             $(INSTALL_PROGRAM) gnatchop-cross$(exeext) $(bindir)/$(target_alias)-gnatchop$(exeext); \
309             if [ -d $(tooldir)/bin/. ] ; then \
310                rm -f $(tooldir)/bin/gnatchop$(exeext); \
311                $(INSTALL_PROGRAM) gnatchop-cross$(exeext) $(tooldir)/bin/gnatchop$(exeext); \
312             fi; \
313           else \
314             $(RM) $(bindir)/gnatchop$(exeext); \
315             $(INSTALL_PROGRAM) gnatchop$(exeext) $(bindir)/gnatchop$(exeext); \
316           fi ; \
317         fi
318         -if [ -f gnat1$(exeext) ] ; \
319         then \
320           if [ -f gnatcmd-cross$(exeext) ] ; \
321           then \
322             $(RM) $(bindir)/$(target_alias)-gnat$(exeext); \
323             $(INSTALL_PROGRAM) gnatcmd-cross$(exeext) $(bindir)/$(target_alias)-gnat$(exeext); \
324             if [ -d $(tooldir)/bin/. ] ; then \
325                rm -f $(tooldir)/bin/gnat$(exeext); \
326                $(INSTALL_PROGRAM) gnatcmd-cross$(exeext) $(tooldir)/bin/gnat$(exeext); \
327             fi; \
328           else \
329             $(RM) $(bindir)/gnat$(exeext); \
330             $(INSTALL_PROGRAM) gnatcmd$(exeext) $(bindir)/gnat$(exeext); \
331           fi ; \
332         fi
333         -if [ -f gnat1$(exeext) ] ; \
334         then \
335           if [ -f gnatkr-cross$(exeext) ] ; \
336           then \
337             $(RM) $(bindir)/$(target_alias)-gnatkr$(exeext); \
338             $(INSTALL_PROGRAM) gnatkr-cross$(exeext) $(bindir)/$(target_alias)-gnatkr$(exeext); \
339             if [ -d $(tooldir)/bin/. ] ; then \
340                rm -f $(tooldir)/bin/gnatkr$(exeext); \
341                $(INSTALL_PROGRAM) gnatkr-cross$(exeext) $(tooldir)/bin/gnatkr$(exeext); \
342             fi; \
343           else \
344             $(RM) $(bindir)/gnatkr$(exeext); \
345             $(INSTALL_PROGRAM) gnatkr$(exeext) $(bindir)/gnatkr$(exeext); \
346           fi ; \
347         fi
348         -if [ -f gnat1$(exeext) ] ; \
349         then \
350           if [ -f gnatlink-cross$(exeext) ] ; \
351           then \
352             $(RM) $(bindir)/$(target_alias)-gnatlink$(exeext); \
353             $(INSTALL_PROGRAM) gnatlink-cross$(exeext) $(bindir)/$(target_alias)-gnatlink$(exeext); \
354             if [ -d $(tooldir)/bin/. ] ; then \
355                rm -f $(tooldir)/bin/gnatlink$(exeext); \
356                $(INSTALL_PROGRAM) gnatlink-cross$(exeext) $(tooldir)/bin/gnatlink$(exeext); \
357             fi; \
358           else \
359             $(RM) $(bindir)/gnatlink$(exeext); \
360             $(INSTALL_PROGRAM) gnatlink$(exeext) $(bindir)/gnatlink$(exeext); \
361           fi ; \
362         fi
363         -if [ -f gnat1$(exeext) ] ; \
364         then \
365           if [ -f gnatls-cross$(exeext) ] ; \
366           then \
367             $(RM) $(bindir)/$(target_alias)-gnatls$(exeext); \
368             $(INSTALL_PROGRAM) gnatls-cross$(exeext) $(bindir)/$(target_alias)-gnatls$(exeext); \
369             if [ -d $(tooldir)/bin/. ] ; then \
370                rm -f $(tooldir)/bin/gnatls$(exeext); \
371                $(INSTALL_PROGRAM) gnatls-cross$(exeext) $(tooldir)/bin/gnatls$(exeext); \
372             fi; \
373           else \
374             $(RM) $(bindir)/gnatls$(exeext); \
375             $(INSTALL_PROGRAM) gnatls$(exeext) $(bindir)/gnatls$(exeext); \
376           fi ; \
377         fi
378         -if [ -f gnat1$(exeext) ] ; \
379         then \
380           if [ -f gnatmake-cross$(exeext) ] ; \
381           then \
382             $(RM) $(bindir)/$(target_alias)-gnatmake$(exeext); \
383             $(INSTALL_PROGRAM) gnatmake-cross$(exeext) $(bindir)/$(target_alias)-gnatmake$(exeext); \
384             if [ -d $(tooldir)/bin/. ] ; then \
385                rm -f $(tooldir)/bin/gnatmake$(exeext); \
386                $(INSTALL_PROGRAM) gnatmake-cross$(exeext) $(tooldir)/bin/gnatmake$(exeext); \
387             fi; \
388           else \
389             $(RM) $(bindir)/gnatmake$(exeext); \
390             $(INSTALL_PROGRAM) gnatmake$(exeext) $(bindir)/gnatmake$(exeext); \
391           fi ; \
392         fi
393         -if [ -f gnat1$(exeext) ] ; \
394         then \
395           if [ -f gnatmem-cross$(exeext) ] ; \
396           then \
397             $(RM) $(bindir)/$(target_alias)-gnatmem$(exeext); \
398             $(INSTALL_PROGRAM) gnatmem-cross$(exeext) $(bindir)/$(target_alias)-gnatmem$(exeext); \
399           else \
400             $(RM) $(bindir)/gnatmem$(exeext); \
401             $(INSTALL_PROGRAM) gnatmem$(exeext) $(bindir)/gnatmem$(exeext); \
402           fi ; \
403         fi
404         -if [ -f gnat1$(exeext) ] ; \
405         then \
406           if [ -f gnatprep-cross$(exeext) ] ; \
407           then \
408             $(RM) $(bindir)/$(target_alias)-gnatprep$(exeext); \
409             $(INSTALL_PROGRAM) gnatprep-cross$(exeext) $(bindir)/$(target_alias)-gnatprep$(exeext); \
410             if [ -d $(tooldir)/bin/. ] ; then \
411                rm -f $(tooldir)/bin/gnatprep$(exeext); \
412                $(INSTALL_PROGRAM) gnatprep-cross$(exeext) $(tooldir)/bin/gnatprep$(exeext); \
413             fi; \
414           else \
415             $(RM) $(bindir)/gnatprep$(exeext); \
416             $(INSTALL_PROGRAM) gnatprep$(exeext) $(bindir)/gnatprep$(exeext); \
417           fi ; \
418         fi
419         -if [ -f gnat1$(exeext) ] ; \
420         then \
421           if [ -f gnatpsta-cross$(exeext) ] ; \
422           then \
423             $(RM) $(bindir)/$(target_alias)-gnatpsta$(exeext); \
424             $(INSTALL_PROGRAM) gnatpsta-cross$(exeext) $(bindir)/$(target_alias)-gnatpsta$(exeext); \
425             if [ -d $(tooldir)/bin/. ] ; then \
426                rm -f $(tooldir)/bin/gnatpsta$(exeext); \
427                $(INSTALL_PROGRAM) gnatpsta-cross$(exeext) $(tooldir)/bin/gnatpsta$(exeext); \
428             fi; \
429           else \
430             $(RM) $(bindir)/gnatpsta$(exeext); \
431             $(INSTALL_PROGRAM) gnatpsta$(exeext) $(bindir)/gnatpsta$(exeext); \
432           fi ; \
433         fi
434         -if [ -f gnat1$(exeext) ] ; \
435         then \
436           if [ -f gnatpsys-cross$(exeext) ] ; \
437           then \
438             $(RM) $(bindir)/$(target_alias)-gnatpsys$(exeext); \
439             $(INSTALL_PROGRAM) gnatpsys-cross$(exeext) $(bindir)/$(target_alias)-gnatpsys$(exeext); \
440             if [ -d $(tooldir)/bin/. ] ; then \
441                rm -f $(tooldir)/bin/gnatpsys$(exeext); \
442                $(INSTALL_PROGRAM) gnatpsys-cross$(exeext) $(tooldir)/bin/gnatpsys$(exeext); \
443             fi; \
444           else \
445             $(RM) $(bindir)/gnatpsys$(exeext); \
446             $(INSTALL_PROGRAM) gnatpsys$(exeext) $(bindir)/gnatpsys$(exeext); \
447           fi ; \
448     fi
449         -if [ -f gnat1$(exeext) ] ; \
450         then \
451           if [ -f gnatxref-cross$(exeext) ] ; \
452           then \
453             $(RM) $(bindir)/$(target_alias)-gnatxref$(exeext); \
454             $(INSTALL_PROGRAM) gnatxref-cross$(exeext) $(bindir)/$(target_alias)-gnatxref$(exeext); \
455           else \
456             $(RM) $(bindir)/gnatxref$(exeext); \
457             $(INSTALL_PROGRAM) gnatxref$(exeext) $(bindir)/gnatxref$(exeext); \
458           fi ; \
459     fi
460         -if [ -f gnat1$(exeext) ] ; \
461         then \
462           if [ -f gnatfind-cross$(exeext) ] ; \
463           then \
464             $(RM) $(bindir)/$(target_alias)-gnatfind$(exeext); \
465             $(INSTALL_PROGRAM) gnatfind-cross$(exeext) $(bindir)/$(target_alias)-gnatfind$(exeext); \
466           else \
467             $(RM) $(bindir)/gnatfind$(exeext); \
468             $(INSTALL_PROGRAM) gnatfind$(exeext) $(bindir)/gnatfind$(exeext); \
469           fi ; \
470         fi
471 #
472 # Gnatlbr is only use on VMS
473 #
474         -if [ -f gnat1$(exeext) ] ; \
475         then \
476           if [ -f gnatchop$(exeext) ] ; \
477           then \
478             $(RM) $(bindir)/gnatchop$(exeext); \
479             $(INSTALL_PROGRAM) gnatchop$(exeext) $(bindir)/gnatchop$(exeext); \
480           fi ; \
481           if [ -f gnatlbr$(exeext) ] ; \
482           then \
483             $(RM) $(bindir)/gnatlbr$(exeext); \
484             $(INSTALL_PROGRAM) gnatlbr$(exeext) $(bindir)/gnatlbr$(exeext); \
485           fi ; \
486         fi
487 #
488 # Gnatdll is only use on Windows
489 #
490         -if [ -f gnat1$(exeext) ] ; \
491         then \
492             $(RM) $(bindir)/gnatdll$(exeext); \
493             $(INSTALL_PROGRAM) gnatdll$(exeext) $(bindir)/gnatdll$(exeext); \
494         fi
495 #
496 # Finally, install the library
497 #
498         -if [ -f gnat1$(exeext) ] ; \
499         then \
500           $(MAKE) $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) install-gnatlib; \
501         fi
502
503 install-gnatlib:
504         $(MAKE) -f ada/Makefile $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) install-gnatlib
505
506 ada.install-info:
507 ada.install-man:
508
509 ada.uninstall:
510         -$(RM) $(bindir)/gnatbind$(exeext)
511         -$(RM) $(bindir)/gnatbl$(exeext)
512         -$(RM) $(bindir)/gnatchop$(exeext)
513         -$(RM) $(bindir)/gnatcmd$(exeext)
514         -$(RM) $(bindir)/gnatdll$(exeext)
515         -$(RM) $(bindir)/gnatkr$(exeext)
516         -$(RM) $(bindir)/gnatlink$(exeext)
517         -$(RM) $(bindir)/gnatls$(exeext)
518         -$(RM) $(bindir)/gnatmake$(exeext)
519         -$(RM) $(bindir)/gnatmem$(exeext)
520         -$(RM) $(bindir)/gnatprep$(exeext)
521         -$(RM) $(bindir)/gnatpsta$(exeext)
522         -$(RM) $(bindir)/gnatpsys$(exeext)
523         -$(RM) $(bindir)/$(target_alias)-gnatbind$(exeext)
524         -$(RM) $(bindir)/$(target_alias)-gnatbl$(exeext)
525         -$(RM) $(bindir)/$(target_alias)-gnatchop$(exeext)
526         -$(RM) $(bindir)/$(target_alias)-gnatcmd$(exeext)
527         -$(RM) $(bindir)/$(target_alias)-gnatkr(exeext)
528         -$(RM) $(bindir)/$(target_alias)-gnatlink$(exeext)
529         -$(RM) $(bindir)/$(target_alias)-gnatls$(exeext)
530         -$(RM) $(bindir)/$(target_alias)-gnatmake$(exeext)
531         -$(RM) $(bindir)/$(target_alias)-gnatmem$(exeext)
532         -$(RM) $(bindir)/$(target_alias)-gnatprep$(exeext)
533         -$(RM) $(bindir)/$(target_alias)-gnatpsta$(exeext)
534         -$(RM) $(bindir)/$(target_alias)-gnatpsys$(exeext)
535         -$(RM) $(tooldir)/bin/gnatbind$(exeext)
536         -$(RM) $(tooldir)/bin/gnatbl$(exeext)
537         -$(RM) $(tooldir)/bin/gnatchop$(exeext)
538         -$(RM) $(tooldir)/bin/gnatcmd$(exeext)
539         -$(RM) $(tooldir)/bin/gnatdll$(exeext)
540         -$(RM) $(tooldir)/bin/gnatkr$(exeext)
541         -$(RM) $(tooldir)/bin/gnatlink$(exeext)
542         -$(RM) $(tooldir)/bin/gnatls$(exeext)
543         -$(RM) $(tooldir)/bin/gnatmake$(exeext)
544         -$(RM) $(tooldir)/bin/gnatmem$(exeext)
545         -$(RM) $(tooldir)/bin/gnatprep$(exeext)
546         -$(RM) $(tooldir)/bin/gnatpsta$(exeext)
547         -$(RM) $(tooldir)/bin/gnatpsys$(exeext)
548 # Gnatlbr and Gnatchop are only used on VMS
549         -$(RM) $(bindir)/gnatlbr$(exeext) $(bindir)/gnatchop$(exeext)
550 \f
551 # Clean hooks:
552 # A lot of the ancillary files are deleted by the main makefile.
553 # We just have to delete files specific to us.
554
555 ada.mostlyclean:
556         -$(RM) ada/*$(objext) ada/*.ali ada/b_*.c
557         -$(RM) ada/sdefault.adb ada/stamp-sdefault
558         -$(RMDIR) ada/tools
559 ada.clean:
560 ada.distclean:
561         -$(RM) ada/Makefile
562         -$(RM) gnatbl$(exeext)
563         -$(RM) gnatchop$(exeext)
564         -$(RM) gnatcmd$(exeext)
565         -$(RM) gnatdll$(exeext)
566         -$(RM) gnatkr$(exeext)
567         -$(RM) gnatlink$(exeext)
568         -$(RM) gnatls$(exeext)
569         -$(RM) gnatmake$(exeext)
570         -$(RM) gnatmem$(exeext)
571         -$(RM) gnatprep$(exeext)
572         -$(RM) gnatpsta$(exeext)
573         -$(RM) gnatpsys$(exeext)
574         -$(RM) gnatfind$(exeext)
575         -$(RM) gnatxref$(exeext)
576 # Gnatlbr and Gnatchop are only used on VMS
577         -$(RM) gnatchop$(exeext) gnatlbr$(exeext)
578         -$(RM) ada/rts/*
579         -$(RMDIR) ada/rts
580         -$(RMDIR) ada/tools
581 ada.extraclean:
582 ada.maintainer-clean:
583         -$(RM) ada/a-sinfo.h
584         -$(RM) ada/a-einfo.h
585         -$(RM) ada/nmake.adb
586         -$(RM) ada/nmake.ads
587         -$(RM) ada/treeprs.ads
588 \f
589 # Stage hooks:
590 # The main makefile has already created stage?/ada
591
592 ada.stage1:
593         -$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stage1/ada
594         -$(MV) ada/stamp-* stage1/ada
595 ada.stage2:
596         -$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stage2/ada
597         -$(MV) ada/stamp-* stage2/ada
598 ada.stage3:
599         -$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stage3/ada
600         -$(MV) ada/stamp-* stage3/ada
601 ada.stage4:
602         -$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stage4/ada
603         -$(MV) ada/stamp-* stage4/ada
604
605 check-ada:
606 \f
607 # Bootstrapping targets for just GNAT - use the same stage directories
608 gnatboot: force
609         -$(RM) gnatboot3
610         $(MAKE) gnat1$(exeext) gnatbind$(exeext) CC="$(CC)" \
611                 CFLAGS="$(CFLAGS)"
612         $(MAKE) gnatboot2 BOOT_CFLAGS="$(BOOT_CFLAGS)" \
613                           BOOT_ADAFLAGS="$(BOOT_ADAFLAGS)" \
614                           LDFLAGS="$(BOOT_LDFLAGS)"
615
616 gnatboot2: force
617         $(MAKE) gnatstage1
618         $(MAKE) gnat1$(exeext) gnatbind$(exeext)  CC="gcc -B../stage1/"\
619                                 CFLAGS="$(BOOT_CFLAGS)" \
620                                 ADAFLAGS="$(BOOT_ADAFLAGS)"\
621                                 LDFLAGS="$(BOOT_LDFLAGS)" \
622                                 STAGE_PREFIX=../stage1/
623         $(MAKE) gnatboot3 BOOT_CFLAGS="$(BOOT_CFLAGS)" \
624                             BOOT_ADAFLAGS="$(BOOT_ADAFLAGS)" \
625                             LDFLAGS="$(BOOT_LDFLAGS)"
626
627 gnatboot3:
628         $(MAKE) gnatstage2
629         $(MAKE) gnat1$(exeext) gnatbind$(exeext)  CC="gcc -B../stage2/"\
630                                 CFLAGS="$(BOOT_CFLAGS)" \
631                                 ADAFLAGS="$(BOOT_ADAFLAGS)"\
632                                 LDFLAGS="$(BOOT_LDFLAGS)" \
633                                 STAGE_PREFIX=../stage2/
634
635 gnatstage1: force
636         -$(MKDIR) stage1
637         -$(MKDIR) stage1/ada
638         -$(MV) gnat1$(exeext) gnatbind$(exeext) stage1
639         -$(MV) ada/*$(objext) ada/*.ali stage1/ada
640         -$(MV) ada/stamp-* stage1/ada
641
642 gnatstage2: force
643         -$(MKDIR) stage2
644         -$(MKDIR) stage2/ada
645         -$(MV) gnat1$(exeext) gnatbind$(exeext) stage2
646         -$(MV) ada/*$(objext) ada/*.ali stage2/ada
647         -$(MV) ada/stamp-* stage2/ada