summaryrefslogtreecommitdiff
path: root/src/Make.clib
diff options
context:
space:
mode:
Diffstat (limited to 'src/Make.clib')
-rw-r--r--src/Make.clib37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Make.clib b/src/Make.clib
new file mode 100644
index 000000000..4a7ea02d9
--- /dev/null
+++ b/src/Make.clib
@@ -0,0 +1,37 @@
+# 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 included for C libraries
+
+all: $(LIB)
+
+# Use $(PWD)/$*.c so that gdb shows full path in stack traces.
+%.$(HOST_O): %.c
+ $(HOST_CC) $(HOST_CFLAGS) -c "$(PWD)/$*.c"
+
+$(OFILES): $(HFILES)
+
+ifneq ($(NOINSTALL),1)
+install: $(QUOTED_GOROOT)/lib/$(LIB)
+endif
+
+$(QUOTED_GOROOT)/lib/$(LIB): $(LIB)
+ cp $(LIB) "$(GOROOT)/lib/$(LIB)"
+
+$(LIB): $(OFILES)
+ $(HOST_AR) rsc $(LIB) $(OFILES)
+
+CLEANFILES+=y.tab.[ch] y.output a.out $(LIB)
+
+clean:
+ rm -f *.$(HOST_O) $(CLEANFILES)
+
+nuke: clean
+ rm -f "$(GOROOT)/lib/$(LIB)"
+
+y.tab.h: $(YFILES)
+ LANG=C LANGUAGE="en_US.UTF8" bison -v -y $(HOST_YFLAGS) $(YFILES)
+
+y.tab.c: y.tab.h
+ test -f y.tab.c && touch y.tab.c