summaryrefslogtreecommitdiff
path: root/gcc/ada/Make-lang.in
blob: 1cd8ff6dba6ee495479165d00083dff5d5aa1793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
# Top level makefile fragment for GNU Ada (GNAT).
#   Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
#   Free Software Foundation, Inc.

#This file is part of GNU CC.

#GNU CC is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2, or (at your option)
#any later version.

#GNU CC is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with GNU CC; see the file COPYING.  If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston, MA 02111-1307, USA.

# This file provides the language dependent support in the main Makefile.
# Each language makefile fragment must provide the following targets:
#
# foo.all.cross, foo.start.encap, foo.rest.encap,
# foo.info, foo.dvi,
# foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
# foo.uninstall, foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
#
# where `foo' is the name of the language.
#
# It should also provide rules for:
#
# - making any compiler driver (eg: g++)
# - the compiler proper (eg: cc1plus)
# - define the names for selecting the language in LANGUAGES.
# tool definitions
CHMOD = chmod
CHMOD_AX_FLAGS = a+x
MV = mv
MKDIR = mkdir -p
RM = rm -f
RMDIR = rm -rf
# default extensions
shext  =

# Extra flags to pass to recursive makes.
BOOT_ADAFLAGS= $(ADAFLAGS)
ADAFLAGS= -gnatpg -gnata
GNATLIBFLAGS= -W -Wall -gnatpg
GNATLIBCFLAGS= -g -O2
ADA_INCLUDE_DIR = $(libsubdir)/adainclude
ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
THREAD_KIND=native
TRACE=no
GNATBIND = gnatbind
ADA_FLAGS_TO_PASS = \
	"ADA_FOR_BUILD=$(ADA_FOR_BUILD)"	\
	"ADA_INCLUDE_DIR=$(ADA_INCLUDE_DIR)"	\
	"ADA_RTL_OBJ_DIR=$(ADA_RTL_OBJ_DIR)"	\
	"ADAFLAGS=$(ADAFLAGS)"			\
	"ADA_FOR_TARGET=$(ADA_FOR_TARGET)"	\
	"INSTALL_DATA=$(INSTALL_DATA)"		\
	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)"

# Define the names for selecting Ada in LANGUAGES.
Ada ada: gnat1$(exeext) gnatbind$(exeext)

# Tell GNU Make to ignore these, if they exist.
.PHONY: Ada ada

# There are too many Ada sources to check against here.  Let's
# always force the recursive make.
ADA_TOOLS_FLAGS_TO_PASS=\
        "CC=../../xgcc -B../../"	\
        "CFLAGS=$(CFLAGS)"		\
	"exeext=$(exeext)"              \
        "ADAFLAGS=$(ADAFLAGS)"		\
        "ADA_INCLUDES=-I../rts"		\
	"GNATMAKE=../../gnatmake"	\
	"GNATLINK=../../gnatlink"	\
	"GNATBIND=../../gnatbind"

gnat1$(exeext): prefix.o attribs.o $(LIBDEPS) $(BACKEND) force
	$(MAKE) -C ada $(SUBDIR_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
		../gnat1$(exeext)

gnatbind$(exeext): force
	$(MAKE) -C ada $(SUBDIR_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
		../gnatbind$(exeext)

# use target-gcc target-gnatmake target-gnatbind target-gnatlink 
gnattools: $(GCC_PARTS) force
	$(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
	   ADA_INCLUDES="-I- -I../rts"\
	   CC="../../xgcc -B../../" STAGE_PREFIX=../../  gnattools1
	$(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2
	$(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools3

regnattools: 
	$(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools1-re
	$(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2
	$(MAKE) -C ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools3

# use host-gcc host-gnatmake host-gnatbind host-gnatlink
# put the host RTS dir first in the PATH to hide the default runtime
# files that are among the sources
RTS_DIR:=$(dir $(subst \,/,$(shell $(CC) -print-libgcc-file-name)))
cross-gnattools: force
	$(MAKE)  -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS)\
	   ADA_INCLUDES="-I$(RTS_DIR)adainclude -I$(RTS_DIR)adalib" \
	   GNATMAKE="gnatmake" \
           GNATBIND="gnatbind" \
           GNATLINK="gnatlink" \
           LIBGNAT="" \
	   gnattools1-re gnattools2
  
rts-none: force
	$(MAKE) -C ada  $(FLAGS_TO_PASS) GNATMAKE=../gnatmake rts-none

install-rts-none: force
	$(MAKE) -C ada  $(FLAGS_TO_PASS) install-rts RTS_NAME=none

rts-ravenscar: force
	$(MAKE) -C ada  $(FLAGS_TO_PASS) GNATMAKE=../gnatmake rts-ravenscar

install-rts-ravenscar: force
	$(MAKE) -C ada  $(FLAGS_TO_PASS) install-rts RTS_NAME=ravenscar

gnatlib: force
	$(MAKE) -C ada $(FLAGS_TO_PASS)  \
	   GNATLIBFLAGS="$(GNATLIBFLAGS)" \
	   GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
	   TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
	   THREAD_KIND="$(THREAD_KIND)" \
	   TRACE="$(TRACE)" \
	   gnatlib

gnatlib-shared: force
	$(MAKE) -C ada $(FLAGS_TO_PASS)  \
	   GNATLIBFLAGS="$(GNATLIBFLAGS)" \
	   GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
	   GNATLIBLDFLAGS="$(GNATLIBLDFLAGS)" \
	   TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
	   THREAD_KIND="$(THREAD_KIND)" \
	   TRACE="$(TRACE)" \
	   gnatlib-shared

# use only for native compiler
gnatlib_and_tools: gnatlib gnattools

# use cross-gcc
gnat-cross: force
	$(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) gnat-cross

# Build hooks:

ada.all.cross:
	-if [ -f gnatbind$(exeext) ] ; \
	then \
	  $(MV) gnatbind$(exeext)  gnatbind-cross$(exeext); \
	fi
	-if [ -f gnatbl$(exeext) ] ; \
	then \
	  $(MV) gnatbl$(exeext)    gnatbl-cross$(exeext); \
	fi
	-if [ -f gnatchop$(exeext) ] ; \
	then \
	  $(MV) gnatchop$(exeext)   gnatchop-cross$(exeext); \
	fi
	-if [ -f gnat$(exeext) ] ; \
	then \
	   $(MV) gnat$(exeext)  gnat-cross$(exeext); \
	fi
	-if [ -f gnatkr$(exeext) ] ; \
	then \
	  $(MV) gnatkr$(exeext)    gnatkr-cross$(exeext); \
	fi
	-if [ -f gnatlink$(exeext) ] ; \
	then \
	   $(MV) gnatlink$(exeext)  gnatlink-cross$(exeext); \
	fi
	-if [ -f gnatls$(exeext) ] ; \
	then \
	  $(MV) gnatls$(exeext)    gnatls-cross$(exeext); \
	fi
	-if [ -f gnatmake$(exeext) ] ; \
	then \
	   $(MV) gnatmake$(exeext)  gnatmake-cross$(exeext); \
	fi
	-if [ -f gnatmem$(exeext) ] ; \
	then \
	   $(MV) gnatmem$(exeext)  gnatmem-cross$(exeext); \
	fi
	-if [ -f gnatname$(exeext) ] ; \
	then \
	   $(MV) gnatname$(exeext)  gnatname-cross$(exeext); \
	fi
	-if [ -f gnatprep$(exeext) ] ; \
	then \
	   $(MV) gnatprep$(exeext)  gnatprep-cross$(exeext); \
	fi
	-if [ -f gnatpsta$(exeext) ] ; \
	then \
	   $(MV) gnatpsta$(exeext)  gnatpsta-cross$(exeext); \
	fi
	-if [ -f gnatxref$(exeext) ] ; \
	then \
	   $(MV) gnatxref$(exeext)  gnatxref-cross$(exeext); \
	fi
	-if [ -f gnatfind$(exeext) ] ; \
	then \
	   $(MV) gnatfind$(exeext)  gnatfind-cross$(exeext); \
	fi

ada.start.encap: 
ada.rest.encap: 
ada.info:
ada.dvi:
ada.generated-manpages:

# Install hooks:
# gnat1 is installed elsewhere as part of $(COMPILERS).

ada.install-normal:

# Install the binder program as $(target_alias)-gnatbind
# and also as either gnatbind (if native) or $(tooldir)/bin/gnatbind
# likewise for gnatf, gnatchop, and gnatlink, gnatkr, gnatmake, gnat,
# gnatprep, gnatbl, gnatls, gnatxref, gnatfind
ada.install-common:
	-if [ -f gnat1$(exeext) ] ; \
	 then \
	  if [ -f gnatbind-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatbind$(exeext); \
	    $(INSTALL_PROGRAM) gnatbind-cross$(exeext) $(bindir)/$(target_alias)-gnatbind$(exeext); \
	    if [ -d $(tooldir)/bin/. ] ; then \
	      rm -f $(tooldir)/bin/gnatbind$(exeext); \
	      $(INSTALL_PROGRAM) gnatbind-cross$(exeext) $(tooldir)/bin/gnatbind$(exeext); \
            fi; \
	  else \
	    $(RM) $(bindir)/gnatbind$(exeext); \
	    $(INSTALL_PROGRAM) gnatbind$(exeext) $(bindir)/gnatbind$(exeext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatbl-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatbl$(exeext); \
	    $(INSTALL_PROGRAM) gnatbl-cross$(exeext) $(bindir)/$(target_alias)-gnatbl$(exeext); \
	    if [ -d $(tooldir)/bin/. ] ; then \
	       rm -f $(tooldir)/bin/gnatbl$(exeext); \
	       $(INSTALL_PROGRAM) gnatbl-cross$(exeext) $(tooldir)/bin/gnatbl$(exeext); \
            fi; \
	  else \
	    $(RM) $(bindir)/gnatbl$(exeext); \
	    $(INSTALL_PROGRAM) gnatbl$(exeext) $(bindir)/gnatbl$(exeext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatchop-cross$(shext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatchop$(shext); \
	    $(INSTALL_PROGRAM) $(srcdir)/ada/gnatchop$(shext) $(bindir)/$(target_alias)-gnatchop$(shext); \
	    if [ -d $(tooldir)/bin/. ] ; then \
	       rm -f $(tooldir)/bin/gnatchop$(shext); \
	       $(INSTALL_PROGRAM) gnatchop$(shext) $(tooldir)/bin/gnatchop$(exeext); \
            fi; \
	  else \
	    $(RM) $(bindir)/gnatchop$(shext); \
	    $(INSTALL_PROGRAM) $(srcdir)/ada/gnatchop$(shext) $(bindir)/gnatchop$(shext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatchop-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatchop$(exeext); \
	    $(INSTALL_PROGRAM) gnatchop-cross$(exeext) $(bindir)/$(target_alias)-gnatchop$(exeext); \
	    if [ -d $(tooldir)/bin/. ] ; then \
	       rm -f $(tooldir)/bin/gnatchop$(exeext); \
	       $(INSTALL_PROGRAM) gnatchop-cross$(exeext) $(tooldir)/bin/gnatchop$(exeext); \
            fi; \
	  else \
	    $(RM) $(bindir)/gnatchop$(exeext); \
	    $(INSTALL_PROGRAM) gnatchop$(exeext) $(bindir)/gnatchop$(exeext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnat-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnat$(exeext); \
	    $(INSTALL_PROGRAM) gnat-cross$(exeext) $(bindir)/$(target_alias)-gnat$(exeext); \
	    if [ -d $(tooldir)/bin/. ] ; then \
	       rm -f $(tooldir)/bin/gnat$(exeext); \
	       $(INSTALL_PROGRAM) gnat-cross$(exeext) $(tooldir)/bin/gnat$(exeext); \
            fi; \
	  else \
	    $(RM) $(bindir)/gnat$(exeext); \
	    $(INSTALL_PROGRAM) gnat$(exeext) $(bindir)/gnat$(exeext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatkr-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatkr$(exeext); \
	    $(INSTALL_PROGRAM) gnatkr-cross$(exeext) $(bindir)/$(target_alias)-gnatkr$(exeext); \
	    if [ -d $(tooldir)/bin/. ] ; then \
	       rm -f $(tooldir)/bin/gnatkr$(exeext); \
	       $(INSTALL_PROGRAM) gnatkr-cross$(exeext) $(tooldir)/bin/gnatkr$(exeext); \
            fi; \
	  else \
	    $(RM) $(bindir)/gnatkr$(exeext); \
	    $(INSTALL_PROGRAM) gnatkr$(exeext) $(bindir)/gnatkr$(exeext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatlink-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatlink$(exeext); \
	    $(INSTALL_PROGRAM) gnatlink-cross$(exeext) $(bindir)/$(target_alias)-gnatlink$(exeext); \
	    if [ -d $(tooldir)/bin/. ] ; then \
	       rm -f $(tooldir)/bin/gnatlink$(exeext); \
	       $(INSTALL_PROGRAM) gnatlink-cross$(exeext) $(tooldir)/bin/gnatlink$(exeext); \
            fi; \
	  else \
	    $(RM) $(bindir)/gnatlink$(exeext); \
	    $(INSTALL_PROGRAM) gnatlink$(exeext) $(bindir)/gnatlink$(exeext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatls-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatls$(exeext); \
	    $(INSTALL_PROGRAM) gnatls-cross$(exeext) $(bindir)/$(target_alias)-gnatls$(exeext); \
	    if [ -d $(tooldir)/bin/. ] ; then \
	       rm -f $(tooldir)/bin/gnatls$(exeext); \
	       $(INSTALL_PROGRAM) gnatls-cross$(exeext) $(tooldir)/bin/gnatls$(exeext); \
            fi; \
	  else \
	    $(RM) $(bindir)/gnatls$(exeext); \
	    $(INSTALL_PROGRAM) gnatls$(exeext) $(bindir)/gnatls$(exeext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatmake-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatmake$(exeext); \
	    $(INSTALL_PROGRAM) gnatmake-cross$(exeext) $(bindir)/$(target_alias)-gnatmake$(exeext); \
	    if [ -d $(tooldir)/bin/. ] ; then \
	       rm -f $(tooldir)/bin/gnatmake$(exeext); \
	       $(INSTALL_PROGRAM) gnatmake-cross$(exeext) $(tooldir)/bin/gnatmake$(exeext); \
            fi; \
	  else \
	    $(RM) $(bindir)/gnatmake$(exeext); \
	    $(INSTALL_PROGRAM) gnatmake$(exeext) $(bindir)/gnatmake$(exeext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatmem-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatmem$(exeext); \
	    $(INSTALL_PROGRAM) gnatmem-cross$(exeext) $(bindir)/$(target_alias)-gnatmem$(exeext); \
	  else \
	    $(RM) $(bindir)/gnatmem$(exeext); \
	    $(INSTALL_PROGRAM) gnatmem$(exeext) $(bindir)/gnatmem$(exeext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatname-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatname$(exeext); \
	    $(INSTALL_PROGRAM) gnatname-cross$(exeext) $(bindir)/$(target_alias)-gnatname$(exeext); \
	  else \
	    $(RM) $(bindir)/gnatname$(exeext); \
	    $(INSTALL_PROGRAM) gnatname$(exeext) $(bindir)/gnatname$(exeext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatprep-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatprep$(exeext); \
	    $(INSTALL_PROGRAM) gnatprep-cross$(exeext) $(bindir)/$(target_alias)-gnatprep$(exeext); \
	    if [ -d $(tooldir)/bin/. ] ; then \
	       rm -f $(tooldir)/bin/gnatprep$(exeext); \
	       $(INSTALL_PROGRAM) gnatprep-cross$(exeext) $(tooldir)/bin/gnatprep$(exeext); \
            fi; \
	  else \
	    $(RM) $(bindir)/gnatprep$(exeext); \
	    $(INSTALL_PROGRAM) gnatprep$(exeext) $(bindir)/gnatprep$(exeext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatpsta-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatpsta$(exeext); \
	    $(INSTALL_PROGRAM) gnatpsta-cross$(exeext) $(bindir)/$(target_alias)-gnatpsta$(exeext); \
	    if [ -d $(tooldir)/bin/. ] ; then \
	       rm -f $(tooldir)/bin/gnatpsta$(exeext); \
	       $(INSTALL_PROGRAM) gnatpsta-cross$(exeext) $(tooldir)/bin/gnatpsta$(exeext); \
            fi; \
	  else \
	    $(RM) $(bindir)/gnatpsta$(exeext); \
	    $(INSTALL_PROGRAM) gnatpsta$(exeext) $(bindir)/gnatpsta$(exeext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatxref-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatxref$(exeext); \
	    $(INSTALL_PROGRAM) gnatxref-cross$(exeext) $(bindir)/$(target_alias)-gnatxref$(exeext); \
	  else \
	    $(RM) $(bindir)/gnatxref$(exeext); \
	    $(INSTALL_PROGRAM) gnatxref$(exeext) $(bindir)/gnatxref$(exeext); \
	  fi ; \
    fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatfind-cross$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/$(target_alias)-gnatfind$(exeext); \
	    $(INSTALL_PROGRAM) gnatfind-cross$(exeext) $(bindir)/$(target_alias)-gnatfind$(exeext); \
	  else \
	    $(RM) $(bindir)/gnatfind$(exeext); \
	    $(INSTALL_PROGRAM) gnatfind$(exeext) $(bindir)/gnatfind$(exeext); \
	  fi ; \
	fi
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatchop$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/gnatchop$(exeext); \
	    $(INSTALL_PROGRAM) gnatchop$(exeext) $(bindir)/gnatchop$(exeext); \
	  fi ; \
#
# Gnatlbr is only used on VMS.
#
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  if [ -f gnatlbr$(exeext) ] ; \
	  then \
	    $(RM) $(bindir)/gnatlbr$(exeext); \
	    $(INSTALL_PROGRAM) gnatlbr$(exeext) $(bindir)/gnatlbr$(exeext); \
	  fi ; \
	fi
#
# Gnatdll is only use on Windows
#
	-if [ -f gnat1$(exeext) ] ; \
	then \
	    $(RM) $(bindir)/gnatdll$(exeext); \
	    $(INSTALL_PROGRAM) gnatdll$(exeext) $(bindir)/gnatdll$(exeext); \
	fi
#
# Finally, install the library
#
	-if [ -f gnat1$(exeext) ] ; \
	then \
	  $(MAKE) $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) install-gnatlib; \
	fi

install-gnatlib:
	$(MAKE) -f ada/Makefile $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) install-gnatlib

ada.install-info:
ada.install-man:

ada.uninstall:
	-$(RM) $(bindir)/gnatbind$(exeext)
	-$(RM) $(bindir)/gnatbl$(exeext)
	-$(RM) $(bindir)/gnatchop$(exeext)
	-$(RM) $(bindir)/gnat$(exeext)
	-$(RM) $(bindir)/gnatdll$(exeext)
	-$(RM) $(bindir)/gnatkr$(exeext)
	-$(RM) $(bindir)/gnatlink$(exeext)
	-$(RM) $(bindir)/gnatls$(exeext)
	-$(RM) $(bindir)/gnatmake$(exeext)
	-$(RM) $(bindir)/gnatmem$(exeext)
	-$(RM) $(bindir)/gnatname$(exeext)
	-$(RM) $(bindir)/gnatprep$(exeext)
	-$(RM) $(bindir)/gnatpsta$(exeext)
	-$(RM) $(bindir)/$(target_alias)-gnatbind$(exeext)
	-$(RM) $(bindir)/$(target_alias)-gnatbl$(exeext)
	-$(RM) $(bindir)/$(target_alias)-gnatchop$(exeext)
	-$(RM) $(bindir)/$(target_alias)-gnat$(exeext)
	-$(RM) $(bindir)/$(target_alias)-gnatkr(exeext)
	-$(RM) $(bindir)/$(target_alias)-gnatlink$(exeext)
	-$(RM) $(bindir)/$(target_alias)-gnatls$(exeext)
	-$(RM) $(bindir)/$(target_alias)-gnatmake$(exeext)
	-$(RM) $(bindir)/$(target_alias)-gnatmem$(exeext)
	-$(RM) $(bindir)/$(target_alias)-gnatname$(exeext)
	-$(RM) $(bindir)/$(target_alias)-gnatprep$(exeext)
	-$(RM) $(bindir)/$(target_alias)-gnatpsta$(exeext)
	-$(RM) $(tooldir)/bin/gnatbind$(exeext)
	-$(RM) $(tooldir)/bin/gnatbl$(exeext)
	-$(RM) $(tooldir)/bin/gnatchop$(exeext)
	-$(RM) $(tooldir)/bin/gnat$(exeext)
	-$(RM) $(tooldir)/bin/gnatdll$(exeext)
	-$(RM) $(tooldir)/bin/gnatkr$(exeext)
	-$(RM) $(tooldir)/bin/gnatlink$(exeext)
	-$(RM) $(tooldir)/bin/gnatls$(exeext)
	-$(RM) $(tooldir)/bin/gnatmake$(exeext)
	-$(RM) $(tooldir)/bin/gnatmem$(exeext)
	-$(RM) $(tooldir)/bin/gnatname$(exeext)
	-$(RM) $(tooldir)/bin/gnatprep$(exeext)
	-$(RM) $(tooldir)/bin/gnatpsta$(exeext)
# Gnatlbr and Gnatchop are only used on VMS
	-$(RM) $(bindir)/gnatlbr$(exeext) $(bindir)/gnatchop$(exeext)

# Clean hooks:
# A lot of the ancillary files are deleted by the main makefile.
# We just have to delete files specific to us.

ada.mostlyclean:
	-$(RM) ada/*$(objext) ada/*.ali ada/b_*.c
	-$(RM) ada/sdefault.adb ada/stamp-sdefault
	-$(RMDIR) ada/tools
ada.clean:
ada.distclean:
	-$(RM) ada/Makefile
	-$(RM) gnatbl$(exeext)
	-$(RM) gnatchop$(exeext)
	-$(RM) gnat$(exeext)
	-$(RM) gnatdll$(exeext)
	-$(RM) gnatkr$(exeext)
	-$(RM) gnatlink$(exeext)
	-$(RM) gnatls$(exeext)
	-$(RM) gnatmake$(exeext)
	-$(RM) gnatmem$(exeext)
	-$(RM) gnatname$(exeext)
	-$(RM) gnatprep$(exeext)
	-$(RM) gnatpsta$(exeext)
	-$(RM) gnatfind$(exeext)
	-$(RM) gnatxref$(exeext)
# Gnatlbr is only used on VMS
	-$(RM) gnatlbr$(exeext)
	-$(RM) ada/rts/*
	-$(RMDIR) ada/rts
	-$(RM) ada/tools/*
	-$(RMDIR) ada/tools
ada.extraclean:
ada.maintainer-clean:
	-$(RM) ada/a-sinfo.h
	-$(RM) ada/a-einfo.h
	-$(RM) ada/nmake.adb
	-$(RM) ada/nmake.ads
	-$(RM) ada/treeprs.ads

# Stage hooks:
# The main makefile has already created stage?/ada

ada.stage1:
	-$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stage1/ada
	-$(MV) ada/stamp-* stage1/ada
ada.stage2:
	-$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stage2/ada
	-$(MV) ada/stamp-* stage2/ada
ada.stage3:
	-$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stage3/ada
	-$(MV) ada/stamp-* stage3/ada
ada.stage4:
	-$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stage4/ada
	-$(MV) ada/stamp-* stage4/ada

check-ada:

# Bootstrapping targets for just GNAT - use the same stage directories
gnatboot: force
	-$(RM) gnatboot3
	$(MAKE) gnat1$(exeext) gnatbind$(exeext) CC="$(CC)" \
		CFLAGS="$(CFLAGS)"
	$(MAKE) gnatboot2 BOOT_CFLAGS="$(BOOT_CFLAGS)" \
	                  BOOT_ADAFLAGS="$(BOOT_ADAFLAGS)" \
	                  LDFLAGS="$(BOOT_LDFLAGS)"

gnatboot2: force
	$(MAKE) gnatstage1
	$(MAKE) gnat1$(exeext) gnatbind$(exeext)  CC="gcc -B../stage1/"\
				CFLAGS="$(BOOT_CFLAGS)" \
	        		ADAFLAGS="$(BOOT_ADAFLAGS)"\
				LDFLAGS="$(BOOT_LDFLAGS)" \
				STAGE_PREFIX=../stage1/
	$(MAKE) gnatboot3 BOOT_CFLAGS="$(BOOT_CFLAGS)" \
			    BOOT_ADAFLAGS="$(BOOT_ADAFLAGS)" \
			    LDFLAGS="$(BOOT_LDFLAGS)"

gnatboot3:
	$(MAKE) gnatstage2
	$(MAKE) gnat1$(exeext) gnatbind$(exeext)  CC="gcc -B../stage2/"\
				CFLAGS="$(BOOT_CFLAGS)" \
	        		ADAFLAGS="$(BOOT_ADAFLAGS)"\
				LDFLAGS="$(BOOT_LDFLAGS)" \
				STAGE_PREFIX=../stage2/

gnatstage1: force
	-$(MKDIR) stage1
	-$(MKDIR) stage1/ada
	-$(MV) gnat1$(exeext) gnatbind$(exeext) stage1
	-$(MV) ada/*$(objext) ada/*.ali stage1/ada
	-$(MV) ada/stamp-* stage1/ada

gnatstage2: force
	-$(MKDIR) stage2
	-$(MKDIR) stage2/ada
	-$(MV) gnat1$(exeext) gnatbind$(exeext) stage2
	-$(MV) ada/*$(objext) ada/*.ali stage2/ada
	-$(MV) ada/stamp-* stage2/ada