Tue Dec 29 15:06:00 1992 Ian Lance Taylor (ian@cygnus.com)
[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    = 921224
19
20 TAG     = latest-$(DATE)
21
22 INSTALLDIR = /cirdan/taxes/devo-test/$(TAG)
23
24 GCC = gcc -O -g
25 CFLAGS = -O
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 CFLAGS = 
57 all: all-cygnus
58 endif
59
60 ifeq ($(canonhost),mips-sgi-irix4)
61 TARGETS = $(NATIVE) m68k-vxworks m68k-aout
62 all: all-cygnus
63 endif
64
65 ifeq ($(canonhost),rs6000-ibm-aix)
66 TARGETS = $(NATIVE) m68k-vxworks i960-vxworks m68k-aout
67 CFLAGS=-g
68 all: all-cygnus
69 endif
70
71 ifeq ($(canonhost),m68k-hp-hpux)
72 TARGETS = m68k-vxworks
73 CC = cc +O1000 -Wp,-P
74 CFLAGS =
75 all: all-native
76 endif
77
78 ifeq ($(canonhost),hppa1.1-hp-hpux)
79 TARGETS = m68k-aout m68k-coff m68k-vxworks i960-vxworks a29k-amd-udi
80 CC = cc 
81 CFLAGS = -g
82 all: all-native
83 endif
84
85 ifeq ($(canonhost),i386-sco3.2v4)
86 TARGETS = $(NATIVE) i386-aout
87 CFLAGS =
88 all: all-cygnus
89 endif
90
91 FLAGS_TO_PASS := \
92         "GCC=$(GCC)" \
93         "CFLAGS=$(CFLAGS)" \
94         "host=$(canonhost)"
95
96 all-cygnus:
97         @echo build started at `date`
98         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
99         rm -f /usr/cygnus/$(TAG)
100         ln -s $(INSTALLDIR) /usr/cygnus/$(TAG) 
101         @for i in $(TARGETS) ; do \
102           if [ "$$i" = "native" ] ; then \
103             if [ ! -f $(canonhost)-3stage-done ] ; then \
104               echo "3staging $(canonhost) native" ; \
105               $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
106                  echo "     completed successfully" ; \
107             fi \
108           else \
109             echo "building $(canonhost) cross to $$i" ; \
110             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-cygnus $(tlog) && \
111                echo "     completed successfully" ; \
112           fi ; \
113         done
114         @echo done at `date`
115
116 native:
117         @echo build started at `date`
118         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
119         rm -f /usr/cygnus/$(TAG)
120         ln -s $(INSTALLDIR) /usr/cygnus/$(TAG) 
121         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log)
122         @echo done at `date`
123
124 build-cygnus:
125         @echo build started at `date`
126         @for i in $(TARGETS) ; do \
127           if [ "$$i" = "native" ] ; then \
128             if [ ! -f $(canonhost)-3stage-done ] ; then \
129               echo "3staging $(canonhost) native" ; \
130               $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
131                  echo "     completed successfully" ; \
132             fi \
133           else \
134             echo "building $(canonhost) cross to $$i:" `date` ; \
135             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
136                echo "     completed successfully" ; \
137           fi ; \
138         done
139         @echo done at `date`
140
141 all-native:
142         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
143         rm -f /usr/cygnus/$(TAG)
144         ln -s $(INSTALLDIR) /usr/cygnus/$(TAG)
145         @for i in $(TARGETS) ; do \
146             echo "building $(canonhost) cross to $$i" ; \
147             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native $(tlog) && \
148                echo "     completed successfully" ; \
149         done
150
151 config:
152         @for i in $(TARGETS) ; do \
153           if [ "$$i" = "native" ] ; then \
154             echo "config stage1 for $(canonhost)" ; \
155             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-config $(log) && \
156                echo "     completed successfully" ; \
157           else \
158             echo "config $(canonhost) cross to $$i" ; \
159             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native-config $(tlog) && \
160                echo "     completed successfully" ;  \
161           fi ; \
162         done
163
164
165 build:
166         @for i in $(TARGETS) ; do \
167           if [ "$$i" = "native" ] ; then \
168             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-build $(log) && \
169                echo "     completed successfully" ; \
170           else \
171             echo "building $(canonhost) cross to $$i" ; \
172             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-native $(tlog) && \
173                echo "     completed successfully" ; \
174           fi ; \
175         done
176
177
178 3build:
179         @for i in $(TARGETS) ; do \
180           if [ "$$i" = "native" ] ; then \
181             echo "building 3stage for $(canonhost)" ; \
182             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) all $(log) && \
183                echo "     completed successfully" ; \
184           else \
185             echo "building $(canonhost) cross to $$i" ; \
186             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
187                echo "     completed successfully" ; \
188           fi ; \
189         done
190
191 endif  # host
192
193 ### Local Variables:
194 ### fill-column: 131
195 ### End: