~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/Make.ccmd

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-04-20 17:36:48 UTC
  • Revision ID: james.westby@ubuntu.com-20110420173648-ifergoxyrm832trd
Tags: upstream-2011.03.07.1
Import upstream version 2011.03.07.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2010 The Go Authors.  All rights reserved.
 
2
# Use of this source code is governed by a BSD-style
 
3
# license that can be found in the LICENSE file.
 
4
 
 
5
# Makefile for commands written in C.
 
6
 
 
7
ifeq (windows,$(findstring windows, $(shell uname | tr A-Z a-z | sed 's/mingw/windows/')))
 
8
TARG:=$(TARG).exe
 
9
endif
 
10
 
 
11
$(TARG): $(OFILES) $(LIB)
 
12
        $(HOST_LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) $(LIB) -lbio -l9 -lm $(HOST_LDFLAGS)
 
13
 
 
14
$(OFILES): $(HFILES)
 
15
 
 
16
CLEANFILES+=y.tab.[ch]
 
17
 
 
18
clean:
 
19
        rm -f *.$(HOST_O) $(TARG) $(CLEANFILES)
 
20
 
 
21
ifneq ($(NOINSTALL),1)
 
22
install: $(QUOTED_GOBIN)/$(TARG)
 
23
endif
 
24
 
 
25
$(QUOTED_GOBIN)/$(TARG): $(TARG)
 
26
        cp $(TARG) "$(GOBIN)"/$(TARG)
 
27
 
 
28
y.tab.h: $(YFILES)
 
29
        bison -y $(HOST_YFLAGS) $(YFILES)
 
30
 
 
31
y.tab.c: y.tab.h
 
32
        test -f y.tab.c && touch y.tab.c
 
33
 
 
34
all: $(TARG)
 
35
 
 
36
%.$(HOST_O): %.c
 
37
        $(HOST_CC) $(HOST_CFLAGS) -c "$(PWD)/$*.c"
 
38
 
 
39
# These are used by enough different Makefiles to be
 
40
# worth writing down in one place, even if they don't
 
41
# apply to every command that builds with Make.ccmd
 
42
../%l/enam.o:
 
43
        cd ../$*l; $(MAKE) enam.o
 
44