1 # Dependencies for compiler sources that are generated at build time
3 # Note: can't use ?= here, not supported by older versions of GNU Make
5 ifeq ($(origin ADA_GEN_SUBDIR), undefined)
9 ifeq ($(origin CP), undefined)
13 ifeq ($(origin MKDIR), undefined)
17 ifeq ($(origin MOVE_IF_CHANGE), undefined)
21 ada_extra_files : $(ADA_GEN_SUBDIR)/treeprs.ads $(ADA_GEN_SUBDIR)/einfo.h $(ADA_GEN_SUBDIR)/sinfo.h $(ADA_GEN_SUBDIR)/nmake.adb \
22 $(ADA_GEN_SUBDIR)/nmake.ads $(ADA_GEN_SUBDIR)/snames.ads $(ADA_GEN_SUBDIR)/snames.adb $(ADA_GEN_SUBDIR)/snames.h
24 # We delete the files before copying, below, in case they are read-only.
26 $(ADA_GEN_SUBDIR)/treeprs.ads : $(ADA_GEN_SUBDIR)/treeprs.adt $(ADA_GEN_SUBDIR)/sinfo.ads $(ADA_GEN_SUBDIR)/xtreeprs.adb
27 -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/treeprs
28 $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/treeprs/,$(notdir $^))
29 $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/treeprs
30 (cd $(ADA_GEN_SUBDIR)/bldtools/treeprs; gnatmake -q xtreeprs ; ./xtreeprs ../../treeprs.ads )
32 $(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
33 -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/einfo
34 $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/einfo/,$(notdir $^))
35 $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/einfo
36 (cd $(ADA_GEN_SUBDIR)/bldtools/einfo; gnatmake -q xeinfo ; ./xeinfo ../../einfo.h )
38 $(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
39 -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/sinfo
40 $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/sinfo/,$(notdir $^))
41 $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/sinfo
42 (cd $(ADA_GEN_SUBDIR)/bldtools/sinfo; gnatmake -q xsinfo ; ./xsinfo ../../sinfo.h )
44 $(ADA_GEN_SUBDIR)/snames.h $(ADA_GEN_SUBDIR)/snames.ads $(ADA_GEN_SUBDIR)/snames.adb : $(ADA_GEN_SUBDIR)/stamp-snames ; @true
45 $(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
46 -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/snamest
47 $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/snamest/,$(notdir $^))
48 $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/snamest
49 (cd $(ADA_GEN_SUBDIR)/bldtools/snamest; gnatmake -q xsnamest ; ./xsnamest )
50 $(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/snamest/snames.ns $(ADA_GEN_SUBDIR)/snames.ads
51 $(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/snamest/snames.nb $(ADA_GEN_SUBDIR)/snames.adb
52 $(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/snamest/snames.nh $(ADA_GEN_SUBDIR)/snames.h
53 touch $(ADA_GEN_SUBDIR)/stamp-snames
55 $(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
56 -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/nmake_b
57 $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/nmake_b/,$(notdir $^))
58 $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/nmake_b
59 (cd $(ADA_GEN_SUBDIR)/bldtools/nmake_b; gnatmake -q xnmake ; ./xnmake -b ../../nmake.adb )
61 $(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
62 -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/nmake_s
63 $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/nmake_s/,$(notdir $^))
64 $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/nmake_s
65 (cd $(ADA_GEN_SUBDIR)/bldtools/nmake_s; gnatmake -q xnmake ; ./xnmake -s ../../nmake.ads )
67 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(subst -, ,$(host)))),)
68 OSCONS_CPP=../../../$(DECC) -E /comment=as_is -DNATIVE \
69 -DTARGET='""$(target)""' s-oscons-tmplt.c
71 OSCONS_EXTRACT=../../../$(DECC) -DNATIVE \
72 -DTARGET='""$(target)""' s-oscons-tmplt.c ; \
73 ld -o s-oscons-tmplt.exe s-oscons-tmplt.obj; \
74 ./s-oscons-tmplt.exe > s-oscons-tmplt.s
77 # GCC_FOR_TARGET has paths relative to the gcc directory, so we need to ajust
78 # for running it from $(ADA_GEN_SUBDIR)/bldtools/oscons
79 OSCONS_CC=`echo "$(GCC_FOR_TARGET)" \
80 | sed -e 's^\./xgcc^../../../xgcc^' -e 's^-B./^-B../../../^'`
81 OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS) -E -C \
82 -DTARGET=\"$(target)\" s-oscons-tmplt.c > s-oscons-tmplt.i
83 OSCONS_EXTRACT=$(OSCONS_CC) -S s-oscons-tmplt.i
86 $(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
87 -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/oscons
88 $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/oscons/,$(notdir $^))
89 $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/oscons
90 (cd $(ADA_GEN_SUBDIR)/bldtools/oscons ; gnatmake -q xoscons ; \
91 $(RM) s-oscons-tmplt.i s-oscons-tmplt.s ; \
95 $(RM) ../../s-oscons.ads ; \
96 $(CP) s-oscons.ads s-oscons.h ../../)
98 $(ADA_GEN_SUBDIR)/sdefault.adb: $(ADA_GEN_SUBDIR)/stamp-sdefault ; @true
99 $(ADA_GEN_SUBDIR)/stamp-sdefault : $(srcdir)/version.c Makefile
100 $(ECHO) "pragma Style_Checks (Off);" >tmp-sdefault.adb
101 $(ECHO) "with Osint; use Osint;" >>tmp-sdefault.adb
102 $(ECHO) "package body Sdefault is" >>tmp-sdefault.adb
103 $(ECHO) " S0 : constant String := \"$(prefix)/\";" >>tmp-sdefault.adb
104 $(ECHO) " S1 : constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb
105 $(ECHO) " S2 : constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb
106 $(ECHO) " S3 : constant String := \"$(target)/\";" >>tmp-sdefault.adb
107 $(ECHO) " S4 : constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb
108 $(ECHO) " function Include_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb
109 $(ECHO) " begin" >>tmp-sdefault.adb
110 $(ECHO) " return Relocate_Path (S0, S1);" >>tmp-sdefault.adb
111 $(ECHO) " end Include_Dir_Default_Name;" >>tmp-sdefault.adb
112 $(ECHO) " function Object_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb
113 $(ECHO) " begin" >>tmp-sdefault.adb
114 $(ECHO) " return Relocate_Path (S0, S2);" >>tmp-sdefault.adb
115 $(ECHO) " end Object_Dir_Default_Name;" >>tmp-sdefault.adb
116 $(ECHO) " function Target_Name return String_Ptr is" >>tmp-sdefault.adb
117 $(ECHO) " begin" >>tmp-sdefault.adb
118 $(ECHO) " return new String'(S3);" >>tmp-sdefault.adb
119 $(ECHO) " end Target_Name;" >>tmp-sdefault.adb
120 $(ECHO) " function Search_Dir_Prefix return String_Ptr is" >>tmp-sdefault.adb
121 $(ECHO) " begin" >>tmp-sdefault.adb
122 $(ECHO) " return Relocate_Path (S0, S4);" >>tmp-sdefault.adb
123 $(ECHO) " end Search_Dir_Prefix;" >>tmp-sdefault.adb
124 $(ECHO) "end Sdefault;" >> tmp-sdefault.adb
125 $(MOVE_IF_CHANGE) tmp-sdefault.adb $(ADA_GEN_SUBDIR)/sdefault.adb
126 touch $(ADA_GEN_SUBDIR)/stamp-sdefault
128 $(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
129 -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/gnat_hlp
130 $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/gnat_hlp/,$(notdir $^))
131 $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/gnat_hlp
132 (cd $(ADA_GEN_SUBDIR)/bldtools/gnat_hlp; \
133 gnatmake -q vms_help; \
134 ./vms_help$(build_exeext) gnat.help_in vms_data.ads ../../gnat.hlp)