update dates
[platform/upstream/binutils.git] / build-all.mk
1 #  Build all of the targets for any given host.....
2 #
3 #  This file is going to be ugly.  It will be VERY specific to the
4 #  Cygnus environment and build-process.
5 #
6 #
7
8 ifndef host
9 error:; @echo You must set the variable \"host\" to use this Makefile ; exit 1
10 else
11
12 # the rest of the makefile
13
14 TREE    = devo
15
16 NATIVE  = native
17
18 DATE    = 930104
19
20 TAG     = latest-$(DATE)
21
22 INSTALLDIR = /cirdan/taxes/devo-test/$(TAG)
23
24 GCC = gcc -O -g
25 CFLAGS = -g
26
27 log     = 1>$(canonhost)-build-log 2>&1
28 tlog    = 1> $(canonhost)-x-$$i-build-log 2>&1
29
30 canonhost := $(shell $(TREE)/config.sub $(host))
31 ifeq ($(canonhost),i386-unknown-sco3.2v4)
32 canonhost := i386-sco3.2v4
33 endif
34
35 ifeq ($(canonhost),sparc-sun-sunos4.1.1)
36 TARGETS = $(NATIVE) m68k-aout   i386-aout       a29k-amd-udi \
37         i960-vxworks            m68k-coff       m68k-vxworks \
38         i960-intel-nindy        sparc-aout      sparc-vxworks
39 all: all-cygnus
40 endif
41
42 ifeq ($(canonhost),m68k-sun-sunos4.1.1)
43 TARGETS = $(NATIVE) m68k-vxworks m68k-aout i386-aout
44 GCC = gcc -O -g -msoft-float
45 all: all-cygnus
46 endif
47
48 ifeq ($(canonhost),sparc-sun-solaris2)
49 TARGETS = $(NATIVE) m68k-aout sparc-aout a29k-amd-udi
50 all: all-cygnus
51 endif
52
53 ifeq ($(canonhost),mips-dec-ultrix)
54 TARGETS = $(NATIVE) m68k-vxworks m68k-aout i960-vxworks \
55           sparc-vxworks m68k-coff i386-aout sparc-aout i960-intel-nindy
56 all: all-cygnus
57 endif
58
59 ifeq ($(canonhost),mips-sgi-irix4)
60 TARGETS = $(NATIVE) m68k-vxworks a29k-amd-udi
61 all: all-cygnus
62 endif
63
64 ifeq ($(canonhost),rs6000-ibm-aix)
65 TARGETS = $(NATIVE) m68k-vxworks i960-vxworks m68k-aout
66 all: all-cygnus
67 endif
68
69 ifeq ($(canonhost),m68k-hp-hpux)
70 TARGETS = m68k-vxworks
71 CC = cc +O1000 -Wp,-P
72 all: all-native
73 endif
74
75 ifeq ($(canonhost),hppa1.1-hp-hpux)
76 TARGETS = m68k-aout m68k-coff m68k-vxworks i960-vxworks a29k-amd-udi
77 CC = cc 
78 all: all-native
79 endif
80
81 ifeq ($(canonhost),i386-sco3.2v4)
82 TARGETS = $(NATIVE) i386-aout
83 all: all-cygnus
84 endif
85
86 FLAGS_TO_PASS := \
87         "GCC=$(GCC)" \
88         "CFLAGS=$(CFLAGS)" \
89         "host=$(canonhost)"
90
91 all-cygnus:
92         @echo build started at `date`
93         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
94         rm -f /usr/cygnus/$(TAG)
95         ln -s $(INSTALLDIR) /usr/cygnus/$(TAG) 
96         @for i in $(TARGETS) ; do \
97           if [ "$$i" = "native" ] ; then \
98             if [ ! -f $(canonhost)-3stage-done ] ; then \
99               echo "3staging $(canonhost) native" ; \
100               $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
101                  echo "     completed successfully" ; \
102             fi \
103           else \
104             echo "building $(canonhost) cross to $$i" ; \
105             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-cygnus $(tlog) && \
106                echo "     completed successfully" ; \
107           fi ; \
108         done
109         @echo done at `date`
110
111 native:
112         @echo build started at `date`
113         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
114         rm -f /usr/cygnus/$(TAG)
115         ln -s $(INSTALLDIR) /usr/cygnus/$(TAG) 
116         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log)
117         @echo done at `date`
118
119 build-cygnus:
120         @echo build started at `date`
121         @for i in $(TARGETS) ; do \
122           if [ "$$i" = "native" ] ; then \
123             if [ ! -f $(canonhost)-3stage-done ] ; then \
124               echo "3staging $(canonhost) native" ; \
125               $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
126                  echo "     completed successfully" ; \
127             fi \
128           else \
129             echo "building $(canonhost) cross to $$i:" `date` ; \
130             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
131                echo "     completed successfully" ; \
132           fi ; \
133         done
134         @echo done at `date`
135
136 all-native:
137         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
138         rm -f /usr/cygnus/$(TAG)
139         ln -s $(INSTALLDIR) /usr/cygnus/$(TAG)
140         @for i in $(TARGETS) ; do \
141             echo "building $(canonhost) cross to $$i" ; \
142             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native $(tlog) && \
143                echo "     completed successfully" ; \
144         done
145
146 config:
147         @for i in $(TARGETS) ; do \
148           if [ "$$i" = "native" ] ; then \
149             echo "config stage1 for $(canonhost)" ; \
150             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-config $(log) && \
151                echo "     completed successfully" ; \
152           else \
153             echo "config $(canonhost) cross to $$i" ; \
154             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native-config $(tlog) && \
155                echo "     completed successfully" ;  \
156           fi ; \
157         done
158
159
160 build:
161         @for i in $(TARGETS) ; do \
162           if [ "$$i" = "native" ] ; then \
163             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-build $(log) && \
164                echo "     completed successfully" ; \
165           else \
166             echo "building $(canonhost) cross to $$i" ; \
167             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-native $(tlog) && \
168                echo "     completed successfully" ; \
169           fi ; \
170         done
171
172
173 3build:
174         @for i in $(TARGETS) ; do \
175           if [ "$$i" = "native" ] ; then \
176             echo "building 3stage for $(canonhost)" ; \
177             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) all $(log) && \
178                echo "     completed successfully" ; \
179           else \
180             echo "building $(canonhost) cross to $$i" ; \
181             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
182                echo "     completed successfully" ; \
183           fi ; \
184         done
185
186 endif  # host
187
188 ### Local Variables:
189 ### fill-column: 131
190 ### End: