Commit 090efde4 authored by Russ Cox's avatar Russ Cox

makefile fixes; convert runtime to use new makefiles

R=r
DELTA=67  (17 added, 29 deleted, 21 changed)
OCL=33215
CL=33219
parent f8295fcd
...@@ -8,3 +8,4 @@ CC=${O}c ...@@ -8,3 +8,4 @@ CC=${O}c
GC=${O}g GC=${O}g
LD=${O}l LD=${O}l
OS=568vq OS=568vq
CFLAGS=-FVw
...@@ -8,3 +8,4 @@ CC=${O}c ...@@ -8,3 +8,4 @@ CC=${O}c
GC=${O}g GC=${O}g
LD=${O}l LD=${O}l
OS=568vq OS=568vq
CFLAGS=-FVw
...@@ -8,3 +8,4 @@ CC=${O}c ...@@ -8,3 +8,4 @@ CC=${O}c
GC=${O}g GC=${O}g
LD=${O}l LD=${O}l
OS=568vq OS=568vq
CFLAGS=-FVw
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,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.
all: package
package: _obj/$(TARG).a package: _obj/$(TARG).a
testpackage: _test/$(TARG).a testpackage: _test/$(TARG).a
elem=$(lastword $(subst /, ,$(TARG))) elem=$(lastword $(subst /, ,$(TARG)))
dir=$(patsubst %/$(elem),%,$(TARG)) dir=$(patsubst %/$(elem),%,./$(TARG))
pkgdir=$(GOROOT)/pkg/$(GOOS)_$(GOARCH) pkgdir=$(GOROOT)/pkg/$(GOOS)_$(GOARCH)
...@@ -39,7 +40,7 @@ _gotest_.$O: $(GOFILES) $(GOTESTFILES) ...@@ -39,7 +40,7 @@ _gotest_.$O: $(GOFILES) $(GOTESTFILES)
$(GC) -o $@ $(GOFILES) $(GOTESTFILES) $(GC) -o $@ $(GOFILES) $(GOTESTFILES)
%.$O: %.c %.$O: %.c
$(CC) $*.c $(CC) $(CFLAGS) $*.c
%.$O: %.s %.$O: %.s
$(AS) $*.s $(AS) $*.s
...@@ -59,3 +60,6 @@ _test/$(TARG).a: _gotest_.$O $(OFILES) ...@@ -59,3 +60,6 @@ _test/$(TARG).a: _gotest_.$O $(OFILES)
importpath: importpath:
@echo $(TARG) @echo $(TARG)
dir:
@echo $(dir)
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
# 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.
include $(GOROOT)/src/Make.$(GOARCH)
TARG=runtime
# Set SIZE to 32 or 64. # Set SIZE to 32 or 64.
SIZE_386=32 SIZE_386=32
SIZE_amd64=64 SIZE_amd64=64
...@@ -15,19 +19,9 @@ CFLAGS_64=-D_64BIT ...@@ -15,19 +19,9 @@ CFLAGS_64=-D_64BIT
CFLAGS_arm=-N CFLAGS_arm=-N
CFLAGS=-I$(GOOS) -I$(GOOS)/$(GOARCH) -wF $(CFLAGS_$(SIZE)) $(CFLAGS_$(GOARCH)) CFLAGS=-I$(GOOS) -I$(GOOS)/$(GOARCH) -wF $(CFLAGS_$(SIZE)) $(CFLAGS_$(GOARCH))
# Set O to right letter. GOFILES=\
O_386=8 extern.go\
O_amd64=6 type.go\
O_arm=5
O=$(O_$(GOARCH))
# Tools
CC=$(O)c
GC=$(O)g
AS=$(O)a
AR=gopack
LIB=runtime.a
# 386-specific object files # 386-specific object files
OFILES_386=\ OFILES_386=\
...@@ -45,7 +39,6 @@ OFILES=\ ...@@ -45,7 +39,6 @@ OFILES=\
asm.$O\ asm.$O\
chan.$O\ chan.$O\
closure.$O\ closure.$O\
extern.$O\
float.$O\ float.$O\
hashmap.$O\ hashmap.$O\
iface.$O\ iface.$O\
...@@ -71,7 +64,6 @@ OFILES=\ ...@@ -71,7 +64,6 @@ OFILES=\
sys.$O\ sys.$O\
thread.$O\ thread.$O\
traceback.$O\ traceback.$O\
type.$O\
$(OFILES_$(GOARCH))\ $(OFILES_$(GOARCH))\
HFILES=\ HFILES=\
...@@ -82,33 +74,23 @@ HFILES=\ ...@@ -82,33 +74,23 @@ HFILES=\
$(GOOS)/os.h\ $(GOOS)/os.h\
$(GOOS)/$(GOARCH)/defs.h\ $(GOOS)/$(GOARCH)/defs.h\
all: $(LIB) runtime.acid include $(GOROOT)/src/Make.pkg
TARG=$(GOROOT)/pkg/$(GOOS)_$(GOARCH)/$(LIB)
install: $(TARG)
$(TARG): $(LIB) runtime.acid
test -d $(GOROOT)/pkg && mkdir -p $(GOROOT)/pkg/$(GOOS)_$(GOARCH)
cp $(LIB) $(TARG)
cp runtime.acid $(GOROOT)/acid/runtime.acid
$(LIB): $(OFILES) clean: clean-local
$(AR) grc $(LIB) $(OFILES)
$(OFILES): $(HFILES) clean-local:
rm -f runtime.acid cgo2c */asm.h
nuke: $(GOARCH)/asm.h: runtime.acid mkasmh
rm -f *.[568] *.a $(TARG) ./mkasmh >$@.x
mv -f $@.x $@
clean:
rm -f *.[568] *.a runtime.acid cgo2c */asm.h
%.$O: %.go cgo2c: cgo2c.c
$(GC) $< quietgcc -o $@ $<
%.$O: %.c %.c: %.cgo cgo2c
$(CC) $(CFLAGS) $< ./cgo2c $< > $@.tmp
mv -f $@.tmp $@
%.$O: $(GOARCH)/%.c %.$O: $(GOARCH)/%.c
$(CC) $(CFLAGS) $< $(CC) $(CFLAGS) $<
...@@ -119,18 +101,21 @@ clean: ...@@ -119,18 +101,21 @@ clean:
%.$O: $(GOOS)/$(GOARCH)/%.c %.$O: $(GOOS)/$(GOARCH)/%.c
$(CC) $(CFLAGS) $< $(CC) $(CFLAGS) $<
%.$O: $(GOARCH)/%.s %.$O: $(GOARCH)/%.s $(GOARCH)/asm.h
$(AS) $< $(AS) $<
%.$O: $(GOOS)/$(GOARCH)/%.s %.$O: $(GOOS)/$(GOARCH)/%.s $(GOARCH)/asm.h
$(AS) $< $(AS) $<
cgo2c: cgo2c.c
quietgcc -o $@ $<
%.c: %.cgo cgo2c # acid support files
./cgo2c $< > $@.tmp
mv -f $@.tmp $@ all: runtime.acid
install: $(GOROOT)/acid/runtime.acid
$(GOROOT)/acid/runtime.acid: runtime.acid
cp runtime.acid $@
runtime.acid: runtime.h proc.c runtime.acid: runtime.h proc.c
$(CC) -a proc.c >runtime.acid $(CC) -a proc.c >runtime.acid
...@@ -138,7 +123,3 @@ runtime.acid: runtime.h proc.c ...@@ -138,7 +123,3 @@ runtime.acid: runtime.h proc.c
chan.acid: runtime.h chan.c chan.acid: runtime.h chan.c
$(CC) -a chan.c >chan.acid $(CC) -a chan.c >chan.acid
$(GOARCH)/asm.h: runtime.acid mkasmh.sh
./mkasmh.sh >$@.x
mv -f $@.x $@
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