From 5ff4c17907d5b19510a62e08fd8d3b11e62b431d Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Tue, 13 Sep 2011 13:13:40 +0200 Subject: Imported Upstream version 60 --- src/Make.ccmd | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/Make.ccmd (limited to 'src/Make.ccmd') diff --git a/src/Make.ccmd b/src/Make.ccmd new file mode 100644 index 000000000..40cc3a0e8 --- /dev/null +++ b/src/Make.ccmd @@ -0,0 +1,48 @@ +# 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. + +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 "$(GOBIN)/$(TARG)" + +ifneq ($(NOINSTALL),1) +install: $(QUOTED_GOBIN)/$(TARG) +endif + +$(QUOTED_GOBIN)/$(TARG): $(TARG) + cp $(TARG) "$(GOBIN)"/$(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 + -- cgit v1.2.3