mirror of
https://github.com/golang/go
synced 2024-11-22 04:04:40 -07:00
4a9138751a
cov, nm, pprof, prof R=rsc, r, rsc CC=golang-dev https://golang.org/cl/5576067
51 lines
1.2 KiB
Plaintext
51 lines
1.2 KiB
Plaintext
# Copyright 2010 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.
|
|
|
|
# Makefile for commands written in C.
|
|
|
|
# Tools always go into $GOROOT/bin/go-tool
|
|
|
|
ifeq (windows,$(findstring windows, $(shell uname | tr A-Z a-z | sed 's/mingw/windows/')))
|
|
TARG:=$(TARG).exe
|
|
endif
|
|
|
|
$(TARG): $(OFILES) $(LIB)
|
|
$(HOST_LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) $(LIB) -lmach -lbio -l9 -lm $(HOST_LDFLAGS)
|
|
|
|
$(OFILES): $(HFILES)
|
|
|
|
CLEANFILES+=y.tab.[ch]
|
|
|
|
clean:
|
|
rm -f *.$(HOST_O) $(TARG) $(CLEANFILES)
|
|
|
|
nuke: clean
|
|
rm -f "$(GOROOT)/bin/go-tool/$(TARG)"
|
|
|
|
ifneq ($(NOINSTALL),1)
|
|
install: $(QUOTED_GOROOT)/bin/go-tool/$(TARG)
|
|
endif
|
|
|
|
$(QUOTED_GOROOT)/bin/go-tool/$(TARG): $(TARG)
|
|
mkdir -p "$(GOROOT)/bin/go-tool" && cp $(TARG) "$(GOROOT)/bin/go-tool/$(TARG)"
|
|
|
|
y.tab.h: $(YFILES)
|
|
bison -y $(HOST_YFLAGS) $(YFILES)
|
|
|
|
y.tab.c: y.tab.h
|
|
test -f y.tab.c && touch y.tab.c
|
|
|
|
all: $(TARG)
|
|
|
|
# Use $(PWD)/$*.c so that gdb shows full path in stack traces.
|
|
%.$(HOST_O): %.c
|
|
$(HOST_CC) $(HOST_CFLAGS) -c "$(PWD)/$*.c"
|
|
|
|
# These are used by enough different Makefiles to be
|
|
# worth writing down in one place, even if they don't
|
|
# apply to every command that builds with Make.ccmd
|
|
../%l/enam.o:
|
|
cd ../$*l; $(MAKE) enam.o
|
|
|