1 #!/usr/latest/bin/make -f
3 # Makefile used to three-stage build a tree of source code, usually devo.
6 # Every invocation of this Makefile needs to have a variable set (host),
7 # which is the named used for ./configure, and also the prefix for the
8 # various files and directories used in a three stage.
15 @echo You must set the variable \"host\" to use this Makefile
22 # from here to very near the end of the file is the real guts of this
23 # Makefile, and it is not seen if the variable 'host' is not set
27 ROOTING := /opt/cygnus-sol2-1.0
28 CVS_MODULE := progressive-solaris
30 RELEASE_TAG := $(CVS_MODULE)-$(TAG_DATE)
31 release_root := $(ROOTING)
40 INSTDIR := $(shell pwd)/$(host)
41 PREFIXES := prefix=$(ROOTING)
44 arch=$(host)=$(target)
51 configuration: $(TREE) $(host)-stamp-stage1-configured
55 for i in `cd $(host)-objdir.3 ; find . -name \*.o -print` ; do \
56 cmp $(host)-objdir.2/$$i $(host)-objdir.3/$$i ; \
61 rm -rf $(host)-$(TREE)-holes $(host)-objdir $(host)-objdir.[123] $(host)-stamp-stage[123]* $(host)-stamp-holes *~
68 $(TIME) cvs co $(CVS_TAG) $(CVS_MODULE)
71 do1: $(host)-$(TREE)-holes $(host)-stamp-stage1
73 $(host)-stamp-stage1: $(host)-objdir.1
74 touch $(host)-stamp-stage1
76 $(host)-objdir.1: $(TREE) $(host)-stamp-stage1-configured
77 (cd $(host)-objdir ; $(TIME) make $(MF) all info host=$(host))
78 @echo CONFIGURE: make all completed for $(host)
79 (cd $(host)-objdir ; $(TIME) make $(MF) install install-info host=$(host))
80 @echo CONFIGURE: make install-all completed for $(host)
81 mv $(host)-objdir $(host)-objdir.1
83 $(host)-stamp-stage1-configured:
84 [ -d $(host)-objdir ] || mkdir $(host)-objdir
85 (cd $(host)-objdir ; \
86 $(TIME) ../$(TREE)/configure $(host) -v -srcdir=../$(TREE) \
91 do2: $(host)-$(TREE)-holes $(host)-stamp-stage2
93 $(host)-stamp-stage2: $(host)-objdir.2
94 PATH=$(release_root)/bin:`pwd`/$(host)-$(TREE)-holes ; \
97 SHELL=sh ; export SHELL ; \
98 $(TIME) make $(host)-objdir.2 host=$(host)
99 touch $(host)-stamp-stage2
101 $(host)-objdir.2: $(TREE) $(host)-stamp-stage2-configured
102 [ -d $(host)-objdir ] || mkdir $(host)-objdir
103 (cd $(host)-objdir ; $(TIME) make $(MF) all info "CC=$(GNUC)" host=$(host))
104 (cd $(host)-objdir ; $(TIME) make $(MF) $(PREFIXES) install install-info "CC=$(GNUC)" host=$(host))
105 mv $(host)-objdir $(host)-objdir.2
107 $(host)-stamp-stage2-configured:
108 [ -d $(host)-objdir ] || mkdir $(host)-objdir
109 (cd $(host)-objdir ; \
110 $(TIME) ../$(TREE)/configure $(host) -v -srcdir=../$(TREE) \
115 do3: $(host)-$(TREE)-holes $(host)-stamp-stage3
117 $(host)-stamp-stage3: $(host)-objdir.3
118 PATH=$(release_root)/bin:`pwd`/$(host)-$(TREE)-holes ; \
120 SHELL=sh ; export SHELL ; \
121 $(TIME) make $(host)-objdir.3 host=$(host)
122 touch $(host)-stamp-stage3
124 $(host)-objdir.3: $(TREE) $(host)-stamp-stage3-configured
125 [ -d $(host)-objdir ] || mkdir $(host)-objdir
126 (cd $(host)-objdir ; $(TIME) make $(MF) all info "CC=$(GNUC)" host=$(host))
127 (cd $(host)-objdir ; $(TIME) make $(MF) install-no-fixedincludes install-info "CC=$(GNUC)" host=$(host))
128 mv $(host)-objdir $(host)-objdir.3
130 $(host)-stamp-stage3-configured:
131 [ -d $(host)-objdir ] || mkdir $(host)-objdir
132 (cd $(host)-objdir ; \
133 $(TIME) ../$(TREE)/configure $(host) -v -srcdir=../$(TREE) \
180 $(host)-$(TREE)-holes: $(host)-stamp-holes
183 -rm -rf $(host)-$(TREE)-holes
184 -mkdir $(host)-$(TREE)-holes
185 for i in $(HOLES) ; do \
186 if [ -x $(host)-$(TREE)-holes/$$i ] ; then \
187 echo "$$i already present" ; \
188 else if [ -x /bin/$$i ] ; then \
189 cp /bin/$$i $(host)-$(TREE)-holes ; \
190 echo $$i from /bin ; \
191 else if [ -x /usr/bin/$$i ] ; then \
192 cp /usr/bin/$$i $(host)-$(TREE)-holes ; \
193 echo $$i from /usr/bin ; \
194 else if [ -x /usr/ccs/bin/$$i ] ; then \
195 cp /usr/ccs/bin/$$i $(host)-$(TREE)-holes ; \
196 echo $$i from /usr/ccs/bin ; \
197 else if [ -x /usr/unsupported/bin/$$i ] ; then \
198 cp /usr/unsupported/bin/$$i $(host)-$(TREE)-holes ; \
199 echo $$i from /usr/unsupported/bin ; \
201 echo $$i is NOT found ; \
202 fi; fi ; fi ; fi ; fi ; true ; \
204 for i in $(PARTIAL_HOLES) ; do \
205 if [ -x /usr/latest/bin/$$i ] ; then \
206 cp /usr/latest/bin/$$i $(host)-$(TREE)-holes ; \
207 echo $$i from /usr/latest/bin ; \
208 else if [ -x /usr/unsupported/bin/$$i ] ; then \
209 cp /usr/unsupported/bin/$$i $(host)-$(TREE)-holes ; \
210 echo $$i from /usr/unsupported/bin ; \
213 touch $(host)-stamp-holes