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 .PHONY: ada_extra_files
22 ada_extra_files : $(ADA_GEN_SUBDIR)/treeprs.ads $(ADA_GEN_SUBDIR)/einfo.h $(ADA_GEN_SUBDIR)/sinfo.h $(ADA_GEN_SUBDIR)/nmake.adb \
23 $(ADA_GEN_SUBDIR)/nmake.ads $(ADA_GEN_SUBDIR)/snames.ads $(ADA_GEN_SUBDIR)/snames.adb $(ADA_GEN_SUBDIR)/snames.h
25 # We delete the files before copying, below, in case they are read-only.
27 $(ADA_GEN_SUBDIR)/treeprs.ads : $(ADA_GEN_SUBDIR)/treeprs.adt $(ADA_GEN_SUBDIR)/sinfo.ads $(ADA_GEN_SUBDIR)/xtreeprs.adb
28 -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/treeprs
29 $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/treeprs/,$(notdir $^))
30 $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/treeprs
31 (cd $(ADA_GEN_SUBDIR)/bldtools/treeprs; gnatmake -q xtreeprs ; ./xtreeprs treeprs.ads )
32 $(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/treeprs/treeprs.ads $(ADA_GEN_SUBDIR)/treeprs.ads
34 $(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
35 -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/einfo
36 $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/einfo/,$(notdir $^))
37 $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/einfo
38 (cd $(ADA_GEN_SUBDIR)/bldtools/einfo; gnatmake -q xeinfo ; ./xeinfo einfo.h )
39 $(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/einfo/einfo.h $(ADA_GEN_SUBDIR)/einfo.h
41 $(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
42 -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/sinfo
43 $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/sinfo/,$(notdir $^))
44 $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/sinfo
45 (cd $(ADA_GEN_SUBDIR)/bldtools/sinfo; gnatmake -q xsinfo ; ./xsinfo sinfo.h )
46 $(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/sinfo/sinfo.h $(ADA_GEN_SUBDIR)/sinfo.h
48 $(ADA_GEN_SUBDIR)/snames.h $(ADA_GEN_SUBDIR)/snames.ads $(ADA_GEN_SUBDIR)/snames.adb : $(ADA_GEN_SUBDIR)/stamp-snames ; @true
49 $(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
50 -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/snamest
51 $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/snamest/,$(notdir $^))
52 $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/snamest
53 (cd $(ADA_GEN_SUBDIR)/bldtools/snamest; gnatmake -q xsnamest ; ./xsnamest )
54 $(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/snamest/snames.ns $(ADA_GEN_SUBDIR)/snames.ads
55 $(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/snamest/snames.nb $(ADA_GEN_SUBDIR)/snames.adb
56 $(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/snamest/snames.nh $(ADA_GEN_SUBDIR)/snames.h
57 touch $(ADA_GEN_SUBDIR)/stamp-snames
59 $(ADA_GEN_SUBDIR)/nmake.adb $(ADA_GEN_SUBDIR)/nmake.ads: $(ADA_GEN_SUBDIR)/stamp-nmake ; @true
60 $(ADA_GEN_SUBDIR)/stamp-nmake: $(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
61 -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/nmake
62 $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/nmake/,$(notdir $^))
63 $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/nmake
64 (cd $(ADA_GEN_SUBDIR)/bldtools/nmake; gnatmake -q xnmake ; ./xnmake -b nmake.adb ; ./xnmake -s nmake.ads)
65 $(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/nmake/nmake.ads $(ADA_GEN_SUBDIR)/nmake.ads
66 $(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/nmake/nmake.adb $(ADA_GEN_SUBDIR)/nmake.adb
67 touch $(ADA_GEN_SUBDIR)/stamp-nmake
69 $(ADA_GEN_SUBDIR)/sdefault.adb: $(ADA_GEN_SUBDIR)/stamp-sdefault ; @true
70 $(ADA_GEN_SUBDIR)/stamp-sdefault : $(srcdir)/version.c Makefile
71 $(ECHO) "pragma Style_Checks (Off);" >tmp-sdefault.adb
72 $(ECHO) "with Osint; use Osint;" >>tmp-sdefault.adb
73 $(ECHO) "package body Sdefault is" >>tmp-sdefault.adb
74 $(ECHO) " S0 : constant String := \"$(prefix)/\";" >>tmp-sdefault.adb
75 $(ECHO) " S1 : constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb
76 $(ECHO) " S2 : constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb
77 $(ECHO) " S3 : constant String := \"$(target_noncanonical)/\";" >>tmp-sdefault.adb
78 $(ECHO) " S4 : constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb
79 $(ECHO) " function Include_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb
80 $(ECHO) " begin" >>tmp-sdefault.adb
81 $(ECHO) " return Relocate_Path (S0, S1);" >>tmp-sdefault.adb
82 $(ECHO) " end Include_Dir_Default_Name;" >>tmp-sdefault.adb
83 $(ECHO) " function Object_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb
84 $(ECHO) " begin" >>tmp-sdefault.adb
85 $(ECHO) " return Relocate_Path (S0, S2);" >>tmp-sdefault.adb
86 $(ECHO) " end Object_Dir_Default_Name;" >>tmp-sdefault.adb
87 $(ECHO) " function Target_Name return String_Ptr is" >>tmp-sdefault.adb
88 $(ECHO) " begin" >>tmp-sdefault.adb
89 $(ECHO) " return new String'(S3);" >>tmp-sdefault.adb
90 $(ECHO) " end Target_Name;" >>tmp-sdefault.adb
91 $(ECHO) " function Search_Dir_Prefix return String_Ptr is" >>tmp-sdefault.adb
92 $(ECHO) " begin" >>tmp-sdefault.adb
93 $(ECHO) " return Relocate_Path (S0, S4);" >>tmp-sdefault.adb
94 $(ECHO) " end Search_Dir_Prefix;" >>tmp-sdefault.adb
95 $(ECHO) "end Sdefault;" >> tmp-sdefault.adb
96 $(MOVE_IF_CHANGE) tmp-sdefault.adb $(ADA_GEN_SUBDIR)/sdefault.adb
97 touch $(ADA_GEN_SUBDIR)/stamp-sdefault