LEFT | RIGHT |
1 # Copyright 2009 The Go Authors. All rights reserved. | 1 # Copyright 2009 The Go Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style | 2 # Use of this source code is governed by a BSD-style |
3 # license that can be found in the LICENSE file. | 3 # license that can be found in the LICENSE file. |
4 | 4 |
5 all: package | 5 all: package |
6 package: _obj/$(TARG).a | 6 package: _obj/$(TARG).a |
7 testpackage: _test/$(TARG).a | 7 testpackage: _test/$(TARG).a |
8 | 8 |
9 # GNU Make 3.80 has a bug in lastword | 9 # GNU Make 3.80 has a bug in lastword |
10 # elem=$(lastword $(subst /, ,$(TARG))) | 10 # elem=$(lastword $(subst /, ,$(TARG))) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 rm -f _test/$(TARG).a | 62 rm -f _test/$(TARG).a |
63 gopack grc $@ _gotest_.$O $(OFILES) | 63 gopack grc $@ _gotest_.$O $(OFILES) |
64 | 64 |
65 importpath: | 65 importpath: |
66 @echo $(TARG) | 66 @echo $(TARG) |
67 | 67 |
68 dir: | 68 dir: |
69 @echo $(dir) | 69 @echo $(dir) |
70 | 70 |
71 %.make: | 71 %.make: |
72 » (cd $* && sanemake) | 72 » (cd $* && gomake) |
73 | 73 |
74 # To use cgo in a Go package, add a line | 74 # To use cgo in a Go package, add a line |
75 # | 75 # |
76 # CGOFILES=x.go | 76 # CGOFILES=x.go |
77 # | 77 # |
78 # to the main Makefile. This signals that cgo should process x.go. | 78 # to the main Makefile. This signals that cgo should process x.go. |
79 # There are two optional variables to set, CGO_CFLAGS and CGO_LDFLAGS, | 79 # There are two optional variables to set, CGO_CFLAGS and CGO_LDFLAGS, |
80 # which specify compiler and linker flags to use when compiling | 80 # which specify compiler and linker flags to use when compiling |
81 # (using gcc) the C support for x.go. | 81 # (using gcc) the C support for x.go. |
82 | 82 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 # These come last so that the rules above can override them | 122 # These come last so that the rules above can override them |
123 # for more specific file names. | 123 # for more specific file names. |
124 %.$O: %.c | 124 %.$O: %.c |
125 $(CC) $(CFLAGS) $*.c | 125 $(CC) $(CFLAGS) $*.c |
126 | 126 |
127 %.$O: %.s | 127 %.$O: %.s |
128 $(AS) $*.s | 128 $(AS) $*.s |
129 | 129 |
130 %.$O: $(HFILES) | 130 %.$O: $(HFILES) |
131 | 131 |
LEFT | RIGHT |