revert chill Sanitize patches
[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 TARGETS = m68k-aout m68k-coff m68k-vxworks a29k-amd-udi
78 CC = cc 
79 all: all-native
80 endif
81
82 ifeq ($(canonhost),i386-sco3.2v4)
83 TARGETS = $(NATIVE) i386-aout
84 all: all-cygnus
85 endif
86
87 FLAGS_TO_PASS := \
88         "GCC=$(GCC)" \
89         "CFLAGS=$(CFLAGS)" \
90         "host=$(canonhost)"
91
92 all-cygnus:
93         @echo build started at `date`
94         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
95         rm -f /usr/cygnus/$(TAG)
96         ln -s $(INSTALLDIR) /usr/cygnus/$(TAG) 
97         @for i in $(TARGETS) ; do \
98           if [ "$$i" = "native" ] ; then \
99             if [ ! -f $(canonhost)-3stage-done ] ; then \
100               echo "3staging $(canonhost) native" ; \
101               $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
102                  echo "     completed successfully" ; \
103             fi \
104           else \
105             echo "building $(canonhost) cross to $$i" ; \
106             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-cygnus $(tlog) && \
107                echo "     completed successfully" ; \
108           fi ; \
109         done
110         @echo done at `date`
111
112 native:
113         @echo build started at `date`
114         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
115         rm -f /usr/cygnus/$(TAG)
116         ln -s $(INSTALLDIR) /usr/cygnus/$(TAG) 
117         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log)
118         @echo done at `date`
119
120 build-cygnus:
121         @echo build started at `date`
122         @for i in $(TARGETS) ; do \
123           if [ "$$i" = "native" ] ; then \
124             if [ ! -f $(canonhost)-3stage-done ] ; then \
125               echo "3staging $(canonhost) native" ; \
126               $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
127                  echo "     completed successfully" ; \
128             fi \
129           else \
130             echo "building $(canonhost) cross to $$i:" `date` ; \
131             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
132                echo "     completed successfully" ; \
133           fi ; \
134         done
135         @echo done at `date`
136
137 all-native:
138         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
139         rm -f /usr/cygnus/$(TAG)
140         ln -s $(INSTALLDIR) /usr/cygnus/$(TAG)
141         @for i in $(TARGETS) ; do \
142             echo "building $(canonhost) cross to $$i" ; \
143             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native $(tlog) && \
144                echo "     completed successfully" ; \
145         done
146
147 config:
148         @for i in $(TARGETS) ; do \
149           if [ "$$i" = "native" ] ; then \
150             echo "config stage1 for $(canonhost)" ; \
151             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-config $(log) && \
152                echo "     completed successfully" ; \
153           else \
154             echo "config $(canonhost) cross to $$i" ; \
155             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native-config $(tlog) && \
156                echo "     completed successfully" ;  \
157           fi ; \
158         done
159
160
161 build:
162         @for i in $(TARGETS) ; do \
163           if [ "$$i" = "native" ] ; then \
164             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-build $(log) && \
165                echo "     completed successfully" ; \
166           else \
167             echo "building $(canonhost) cross to $$i" ; \
168             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-native $(tlog) && \
169                echo "     completed successfully" ; \
170           fi ; \
171         done
172
173
174 3build:
175         @for i in $(TARGETS) ; do \
176           if [ "$$i" = "native" ] ; then \
177             echo "building 3stage for $(canonhost)" ; \
178             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) all $(log) && \
179                echo "     completed successfully" ; \
180           else \
181             echo "building $(canonhost) cross to $$i" ; \
182             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
183                echo "     completed successfully" ; \
184           fi ; \
185         done
186
187 endif  # host
188
189 ### Local Variables:
190 ### fill-column: 131
191 ### End: