Makefile 1.85 KB
Newer Older
1 2 3 4
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

5
include ../../Make.$(GOARCH)
6 7 8

TARG=runtime

9 10 11 12 13 14 15 16
# Set SIZE to 32 or 64.
SIZE_386=32
SIZE_amd64=64
SIZE_arm=32
SIZE=$(SIZE_$(GOARCH))

# Setup CFLAGS.  Add -D_64BIT on 64-bit platforms (sorry).
CFLAGS_64=-D_64BIT
17 18 19 20
# TODO(kaib): fix register allocation to honor extern register so we
# can enable optimizations again.
CFLAGS_arm=-N
CFLAGS=-I$(GOOS) -I$(GOOS)/$(GOARCH) -wF $(CFLAGS_$(SIZE)) $(CFLAGS_$(GOARCH))
21

22 23 24
GOFILES=\
	extern.go\
	type.go\
25 26 27 28 29 30

# 386-specific object files
OFILES_386=\
	vlop.$O\
	vlrt.$O\

31
GOARM?=6
32

33 34
# arm-specific object files
OFILES_arm=\
35
	cas$(GOARM).$O\
36
	memset.$O\
37 38 39
	vlop.$O\
	vlrt.$O\

40 41
OFILES=\
	asm.$O\
Russ Cox's avatar
Russ Cox committed
42
	cgocall.$O\
43 44 45 46 47 48 49 50 51
	chan.$O\
	closure.$O\
	float.$O\
	hashmap.$O\
	iface.$O\
	malloc.$O\
	mcache.$O\
	mcentral.$O\
	mem.$O\
Russ Cox's avatar
Russ Cox committed
52
	memmove.$O\
53 54 55 56 57 58 59
	mfixalloc.$O\
	mgc0.$O\
	mheap.$O\
	mheapmap$(SIZE).$O\
	msize.$O\
	print.$O\
	proc.$O\
Russ Cox's avatar
Russ Cox committed
60
	reflect.$O\
61 62 63 64 65
	rune.$O\
	runtime.$O\
	rt0.$O\
	sema.$O\
	signal.$O\
66
	slice.$O\
67 68 69 70 71 72 73 74
	string.$O\
	symtab.$O\
	sys.$O\
	thread.$O\
	traceback.$O\
	$(OFILES_$(GOARCH))\

HFILES=\
Russ Cox's avatar
Russ Cox committed
75
	cgocall.h\
76 77 78
	runtime.h\
	hashmap.h\
	malloc.h\
79
	$(GOARCH)/asm.h\
80 81 82
	$(GOOS)/os.h\
	$(GOOS)/$(GOARCH)/defs.h\

83
include ../../Make.pkg
84

85
clean: clean-local
86

87
clean-local:
88
	rm -f cgo2c */asm.h runtime.acid.*
89

90
$(GOARCH)/asm.h: mkasmh.sh runtime.acid.$(GOARCH)
Russ Cox's avatar
Russ Cox committed
91
	./mkasmh.sh >$@.x
92
	mv -f $@.x $@
93

94 95
cgo2c: cgo2c.c
	quietgcc -o $@ $<
96

97 98 99
%.c:	%.cgo cgo2c
	./cgo2c $< > $@.tmp
	mv -f $@.tmp $@
100

101 102
%.$O:	$(GOARCH)/%.c
	$(CC) $(CFLAGS) $<
103

104 105
%.$O:	$(GOOS)/%.c
	$(CC) $(CFLAGS) $<
106

107 108
%.$O:	$(GOOS)/$(GOARCH)/%.c
	$(CC) $(CFLAGS) $<
109

110
%.$O:	$(GOARCH)/%.s $(GOARCH)/asm.h
111
	$(AS) $<
112

113
%.$O:	$(GOOS)/$(GOARCH)/%.s $(GOARCH)/asm.h
114
	$(AS) $<
115

Rob Pike's avatar
Rob Pike committed
116
# for discovering offsets inside structs when debugging
117 118
runtime.acid.$(GOARCH): runtime.h proc.c
	$(CC) -a proc.c >$@