Commit 76036192 authored by Russ Cox's avatar Russ Cox

make Makefiles safe for parallel make

use -j4 (4-way parallel) in make.bash.

halves time for make.bash on r45

also add libregexp, acid to default build

R=r
DELTA=90  (39 added, 37 deleted, 14 changed)
OCL=15485
CL=15487
parent 899c5281
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Use of this source code is governed by a BSD-style # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
for i in lib9 libbio libmach_amd64 syscall for i in lib9 libbio libmach_amd64 libregexp syscall
do do
cd $i cd $i
make clean make clean
......
...@@ -29,9 +29,12 @@ $(OFILES): $(HFILES) ...@@ -29,9 +29,12 @@ $(OFILES): $(HFILES)
lex.$O: ../cc/macbody ../cc/lexbody lex.$O: ../cc/macbody ../cc/lexbody
y.tab.c: $(YFILES) y.tab.h: $(YFILES)
yacc $(YFLAGS) $(YFILES) yacc $(YFLAGS) $(YFILES)
y.tab.c: y.tab.h
# do nothing
clean: clean:
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out y.tab.h y.tab.c rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out y.tab.h y.tab.c
......
...@@ -38,9 +38,12 @@ $(LIB): $(OFILES) ...@@ -38,9 +38,12 @@ $(LIB): $(OFILES)
$(OFILES): $(HFILES) $(OFILES): $(HFILES)
y.tab.c: $(YFILES) y.tab.h: $(YFILES)
yacc $(YFLAGS) $(YFILES) yacc $(YFLAGS) $(YFILES)
y.tab.c: y.tab.h
# do nothing
clean: clean:
rm -f $(OFILES) *.6 enam.c 6.out a.out y.tab.h y.tab.c $(LIB) rm -f $(OFILES) *.6 enam.c 6.out a.out y.tab.h y.tab.c $(LIB)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Use of this source code is governed by a BSD-style # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
for i in 6l 6a 6c 6g gc cc ar db for i in 6l 6a 6c 6g gc cc ar db nm acid
do do
cd $i cd $i
make clean make clean
......
...@@ -33,9 +33,12 @@ $(LIB): $(OFILES) ...@@ -33,9 +33,12 @@ $(LIB): $(OFILES)
$(OFILES): $(HFILES) $(OFILES): $(HFILES)
y.tab.c: $(YFILES) y.tab.h: $(YFILES)
yacc $(YFLAGS) $(YFILES) yacc $(YFLAGS) $(YFILES)
y.tab.c: y.tab.h
# do nothing
sysimport.c: sys.go mksys.bash sysimport.c: sys.go mksys.bash
bash mksys.bash bash mksys.bash
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# Use of this source code is governed by a BSD-style # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
set -e
bash clean.bash bash clean.bash
...@@ -11,47 +12,10 @@ bash mkenam ...@@ -11,47 +12,10 @@ bash mkenam
make enam.o make enam.o
cd .. cd ..
echo; echo; echo %%%% making cc %%%%; echo for i in cc 6l 6a 6c gc 6g ar db nm acid
cd cc do
make install echo; echo; echo %%%% making $i %%%%; echo
cd .. cd $i
make install
echo; echo; echo %%%% making 6l %%%%; echo cd ..
cd 6l done
make install
cd ..
echo; echo; echo %%%% making 6a %%%%; echo
cd 6a
make install
cd ..
echo; echo; echo %%%% making 6c %%%%; echo
cd 6c
make install
cd ..
echo; echo; echo %%%% making gc %%%%; echo
cd gc
make install
cd ..
echo; echo; echo %%%% making 6g %%%%; echo
cd 6g
make install
cd ..
echo; echo; echo %%%% making ar %%%%; echo
cd ar
make install
cd ..
echo; echo; echo %%%% making db %%%%; echo
cd db
make install
cd ..
echo; echo; echo %%%% making nm %%%%; echo
cd nm
make install
cd ..
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#!/bin/bash #!/bin/bash
set -e
echo; echo; echo %%%% making lib %%%%; echo echo; echo; echo %%%% making lib %%%%; echo
for i in os math for i in os math
......
...@@ -37,6 +37,11 @@ a3: $(O3) ...@@ -37,6 +37,11 @@ a3: $(O3)
a4: $(O4) a4: $(O4)
$(O)ar grc $(PKG) $(O4) $(O)ar grc $(PKG) $(O4)
$(O1): nuke
$(O2): a1
$(O3): a2
$(O4): a3
nuke: nuke:
rm -f *.$(O) *.a $(PKG) rm -f *.$(O) *.a $(PKG)
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#!/bin/bash #!/bin/bash
set -e
make install make install
# old way: bash g1 && cp math.a $GOROOT/pkg/math.a # old way: bash g1 && cp math.a $GOROOT/pkg/math.a
...@@ -22,8 +22,11 @@ $(NET): $(NETO) ...@@ -22,8 +22,11 @@ $(NET): $(NETO)
$(NETO): $(IP) $(SOCKET) $(NETO): $(IP) $(SOCKET)
$(SOCKETO): $(IP)
$(SOCKET): $(SOCKETO) $(SOCKET): $(SOCKETO)
$(O)ar grc $(SOCKET) $(SOCKETO) $(O)ar grc $(SOCKET) $(SOCKETO)
rm $(SOCKETO)
$(GOROOT)/pkg/%.$O: %.$O $(GOROOT)/pkg/%.$O: %.$O
cp $*.$O $(GOROOT)/pkg/$*.$O cp $*.$O $(GOROOT)/pkg/$*.$O
......
...@@ -23,6 +23,9 @@ a1: $(O1) ...@@ -23,6 +23,9 @@ a1: $(O1)
a2: $(O2) a2: $(O2)
$(O)ar grc $(PKG) $(O2) $(O)ar grc $(PKG) $(O2)
$(O1): nuke
$(O2): a1
nuke: nuke:
rm -f *.$(O) *.a $(PKG) rm -f *.$(O) *.a $(PKG)
......
...@@ -22,6 +22,9 @@ a1: $(O1) ...@@ -22,6 +22,9 @@ a1: $(O1)
a2: $(O2) a2: $(O2)
$(O)ar grc $(PKG) $(O2) $(O)ar grc $(PKG) $(O2)
$(O1): nuke
$(O2): a1
nuke: nuke:
rm -f *.$(O) *.a $(PKG) rm -f *.$(O) *.a $(PKG)
......
...@@ -3,9 +3,12 @@ ...@@ -3,9 +3,12 @@
# Use of this source code is governed by a BSD-style # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
set -e
export MAKEFLAGS=-j4
bash clean.bash bash clean.bash
for i in lib9 libbio libmach_amd64 for i in lib9 libbio libmach_amd64 libregexp
do do
cd $i cd $i
make install make install
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#!/bin/bash #!/bin/bash
set -e
# clean # clean
rm -f *.6 6.out test_integer rm -f *.6 6.out test_integer
......
...@@ -32,6 +32,9 @@ a2: $(O2) ...@@ -32,6 +32,9 @@ a2: $(O2)
$(O)ar grc $(PKG) $(O2) $(O)ar grc $(PKG) $(O2)
rm *.6 rm *.6
$(O1): nuke
$(O2): a1
nuke: nuke:
rm -f *.$(O) *.a $(PKG) rm -f *.$(O) *.a $(PKG)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment