summaryrefslogtreecommitdiffstats
path: root/gcc/ada/Make-generated.in
blob: 30ce14e916dc3fa9c493f2ada260823385ae940d (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
# Dependencies for compiler sources that are generated at build time

# Note: can't use ?= here, not supported by older versions of GNU Make

ifeq ($(origin ADA_GEN_SUBDIR), undefined)
ADA_GEN_SUBDIR=ada
endif

ifeq ($(origin CP), undefined)
CP=cp
endif

ifeq ($(origin MKDIR), undefined)
MKDIR=mkdir -p
endif

ifeq ($(origin MOVE_IF_CHANGE), undefined)
MOVE_IF_CHANGE=mv -f
endif

ada_extra_files : $(ADA_GEN_SUBDIR)/treeprs.ads $(ADA_GEN_SUBDIR)/einfo.h $(ADA_GEN_SUBDIR)/sinfo.h $(ADA_GEN_SUBDIR)/nmake.adb \
	$(ADA_GEN_SUBDIR)/nmake.ads $(ADA_GEN_SUBDIR)/snames.ads $(ADA_GEN_SUBDIR)/snames.adb $(ADA_GEN_SUBDIR)/snames.h

# We delete the files before copying, below, in case they are read-only.

$(ADA_GEN_SUBDIR)/treeprs.ads : $(ADA_GEN_SUBDIR)/treeprs.adt $(ADA_GEN_SUBDIR)/sinfo.ads $(ADA_GEN_SUBDIR)/xtreeprs.adb
	-$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/treeprs
	$(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/treeprs/,$(notdir $^))
	$(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/treeprs
	(cd $(ADA_GEN_SUBDIR)/bldtools/treeprs; gnatmake -q xtreeprs ; ./xtreeprs ../../treeprs.ads )

$(ADA_GEN_SUBDIR)/einfo.h : $(ADA_GEN_SUBDIR)/einfo.ads $(ADA_GEN_SUBDIR)/einfo.adb $(ADA_GEN_SUBDIR)/xeinfo.adb $(ADA_GEN_SUBDIR)/ceinfo.adb
	-$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/einfo
	$(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/einfo/,$(notdir $^))
	$(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/einfo
	(cd $(ADA_GEN_SUBDIR)/bldtools/einfo; gnatmake -q xeinfo ; ./xeinfo ../../einfo.h )

$(ADA_GEN_SUBDIR)/sinfo.h : $(ADA_GEN_SUBDIR)/sinfo.ads $(ADA_GEN_SUBDIR)/sinfo.adb $(ADA_GEN_SUBDIR)/xsinfo.adb $(ADA_GEN_SUBDIR)/csinfo.adb
	-$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/sinfo
	$(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/sinfo/,$(notdir $^))
	$(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/sinfo
	(cd $(ADA_GEN_SUBDIR)/bldtools/sinfo; gnatmake -q xsinfo ; ./xsinfo ../../sinfo.h )

$(ADA_GEN_SUBDIR)/snames.h $(ADA_GEN_SUBDIR)/snames.ads $(ADA_GEN_SUBDIR)/snames.adb : $(ADA_GEN_SUBDIR)/stamp-snames ; @true
$(ADA_GEN_SUBDIR)/stamp-snames : $(ADA_GEN_SUBDIR)/snames.ads-tmpl $(ADA_GEN_SUBDIR)/snames.adb-tmpl $(ADA_GEN_SUBDIR)/snames.h-tmpl $(ADA_GEN_SUBDIR)/xsnamest.adb $(ADA_GEN_SUBDIR)/xutil.ads $(ADA_GEN_SUBDIR)/xutil.adb
	-$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/snamest
	$(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/snamest/,$(notdir $^))
	$(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/snamest
	(cd $(ADA_GEN_SUBDIR)/bldtools/snamest; gnatmake -q xsnamest ; ./xsnamest )
	$(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/snamest/snames.ns $(ADA_GEN_SUBDIR)/snames.ads
	$(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/snamest/snames.nb $(ADA_GEN_SUBDIR)/snames.adb
	$(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/snamest/snames.nh $(ADA_GEN_SUBDIR)/snames.h
	touch $(ADA_GEN_SUBDIR)/stamp-snames

$(ADA_GEN_SUBDIR)/nmake.adb : $(ADA_GEN_SUBDIR)/sinfo.ads $(ADA_GEN_SUBDIR)/nmake.adt $(ADA_GEN_SUBDIR)/xnmake.adb $(ADA_GEN_SUBDIR)/xutil.ads $(ADA_GEN_SUBDIR)/xutil.adb
	-$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/nmake_b
	$(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/nmake_b/,$(notdir $^))
	$(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/nmake_b
	(cd $(ADA_GEN_SUBDIR)/bldtools/nmake_b; gnatmake -q xnmake ; ./xnmake -b ../../nmake.adb )

$(ADA_GEN_SUBDIR)/nmake.ads :  $(ADA_GEN_SUBDIR)/sinfo.ads $(ADA_GEN_SUBDIR)/nmake.adt $(ADA_GEN_SUBDIR)/xnmake.adb $(ADA_GEN_SUBDIR)/nmake.adb $(ADA_GEN_SUBDIR)/xutil.ads $(ADA_GEN_SUBDIR)/xutil.adb
	-$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/nmake_s
	$(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/nmake_s/,$(notdir $^))
	$(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/nmake_s
	(cd $(ADA_GEN_SUBDIR)/bldtools/nmake_s; gnatmake -q xnmake ; ./xnmake -s ../../nmake.ads )

ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(subst -, ,$(host)))),)
OSCONS_CPP=../../../$(DECC) -E /comment=as_is -DNATIVE \
             -DTARGET='""$(target)""' s-oscons-tmplt.c

OSCONS_EXTRACT=../../../$(DECC) -DNATIVE \
                 -DTARGET='""$(target)""' s-oscons-tmplt.c ; \
  ld -o s-oscons-tmplt.exe s-oscons-tmplt.obj; \
  ./s-oscons-tmplt.exe > s-oscons-tmplt.s

else
# GCC_FOR_TARGET has paths relative to the gcc directory, so we need to ajust
# for running it from $(ADA_GEN_SUBDIR)/bldtools/oscons
OSCONS_CC=`echo "$(GCC_FOR_TARGET)" \
  | sed -e 's^\./xgcc^../../../xgcc^' -e 's^-B./^-B../../../^'`
OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS) -E -C \
  -DTARGET=\"$(target)\" s-oscons-tmplt.c > s-oscons-tmplt.i
OSCONS_EXTRACT=$(OSCONS_CC) -S s-oscons-tmplt.i
endif

$(ADA_GEN_SUBDIR)/s-oscons.ads : $(ADA_GEN_SUBDIR)/s-oscons-tmplt.c $(ADA_GEN_SUBDIR)/gsocket.h $(ADA_GEN_SUBDIR)/xoscons.adb $(ADA_GEN_SUBDIR)/xutil.ads $(ADA_GEN_SUBDIR)/xutil.adb
	-$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/oscons
	$(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/oscons/,$(notdir $^))
	$(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/oscons
	(cd $(ADA_GEN_SUBDIR)/bldtools/oscons ; gnatmake -q xoscons ; \
		$(RM) s-oscons-tmplt.i s-oscons-tmplt.s ; \
		$(OSCONS_CPP) ; \
		$(OSCONS_EXTRACT) ; \
		./xoscons ; \
		$(RM) ../../s-oscons.ads ; \
		$(CP) s-oscons.ads s-oscons.h ../../)

$(ADA_GEN_SUBDIR)/sdefault.adb: $(ADA_GEN_SUBDIR)/stamp-sdefault ; @true
$(ADA_GEN_SUBDIR)/stamp-sdefault : $(srcdir)/version.c Makefile
	$(ECHO) "pragma Style_Checks (Off);" >tmp-sdefault.adb
	$(ECHO) "with Osint; use Osint;" >>tmp-sdefault.adb
	$(ECHO) "package body Sdefault is" >>tmp-sdefault.adb
	$(ECHO) "   S0 : constant String := \"$(prefix)/\";" >>tmp-sdefault.adb
	$(ECHO) "   S1 : constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb
	$(ECHO) "   S2 : constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb
	$(ECHO) "   S3 : constant String := \"$(target)/\";" >>tmp-sdefault.adb
	$(ECHO) "   S4 : constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb
	$(ECHO) "   function Include_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb
	$(ECHO) "   begin" >>tmp-sdefault.adb
	$(ECHO) "      return Relocate_Path (S0, S1);" >>tmp-sdefault.adb
	$(ECHO) "   end Include_Dir_Default_Name;" >>tmp-sdefault.adb
	$(ECHO) "   function Object_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb
	$(ECHO) "   begin" >>tmp-sdefault.adb
	$(ECHO) "      return Relocate_Path (S0, S2);" >>tmp-sdefault.adb
	$(ECHO) "   end Object_Dir_Default_Name;" >>tmp-sdefault.adb
	$(ECHO) "   function Target_Name return String_Ptr is" >>tmp-sdefault.adb
	$(ECHO) "   begin" >>tmp-sdefault.adb
	$(ECHO) "      return new String'(S3);" >>tmp-sdefault.adb
	$(ECHO) "   end Target_Name;" >>tmp-sdefault.adb
	$(ECHO) "   function Search_Dir_Prefix return String_Ptr is" >>tmp-sdefault.adb
	$(ECHO) "   begin" >>tmp-sdefault.adb
	$(ECHO) "      return Relocate_Path (S0, S4);" >>tmp-sdefault.adb
	$(ECHO) "   end Search_Dir_Prefix;" >>tmp-sdefault.adb
	$(ECHO) "end Sdefault;" >> tmp-sdefault.adb
	$(MOVE_IF_CHANGE) tmp-sdefault.adb $(ADA_GEN_SUBDIR)/sdefault.adb
	touch $(ADA_GEN_SUBDIR)/stamp-sdefault

$(ADA_GEN_SUBDIR)/gnat.hlp :  $(ADA_GEN_SUBDIR)/vms_help.adb $(ADA_GEN_SUBDIR)/vms_cmds.ads $(ADA_GEN_SUBDIR)/gnat.help_in $(ADA_GEN_SUBDIR)/vms_data.ads
	-$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/gnat_hlp
	$(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/gnat_hlp/,$(notdir $^))
	$(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/gnat_hlp
	(cd $(ADA_GEN_SUBDIR)/bldtools/gnat_hlp; \
	  gnatmake -q vms_help; \
	  ./vms_help$(build_exeext) gnat.help_in vms_data.ads ../../gnat.hlp)
OpenPOWER on IntegriCloud