2008-06-11 18:50:07 -06:00
|
|
|
# Copyright 2009 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.
|
|
|
|
|
2008-08-04 00:03:31 -06:00
|
|
|
include ../../Make.conf
|
2008-06-11 18:50:07 -06:00
|
|
|
|
|
|
|
LIB=\
|
|
|
|
gc.a$O\
|
|
|
|
|
|
|
|
HFILES=\
|
|
|
|
go.h\
|
|
|
|
y.tab.h\
|
|
|
|
|
|
|
|
YFILES=\
|
|
|
|
go.y\
|
|
|
|
|
|
|
|
OFILES=\
|
|
|
|
y.tab.$O\
|
|
|
|
lex.$O\
|
|
|
|
subr.$O\
|
|
|
|
dcl.$O\
|
|
|
|
export.$O\
|
|
|
|
walk.$O\
|
|
|
|
const.$O\
|
2008-08-09 18:29:26 -06:00
|
|
|
mparith1.$O\
|
|
|
|
mparith2.$O\
|
|
|
|
mparith3.$O\
|
2008-06-11 18:50:07 -06:00
|
|
|
sysimport.$O\
|
2008-06-13 19:16:23 -06:00
|
|
|
compat.$O\
|
2008-06-11 18:50:07 -06:00
|
|
|
|
|
|
|
$(LIB): $(OFILES)
|
2008-06-12 14:38:54 -06:00
|
|
|
ar rsc $(LIB) $(OFILES)
|
2008-06-11 18:50:07 -06:00
|
|
|
|
|
|
|
$(OFILES): $(HFILES)
|
|
|
|
|
2008-09-18 16:06:43 -06:00
|
|
|
y.tab.h: $(YFILES)
|
2008-06-11 18:50:07 -06:00
|
|
|
yacc $(YFLAGS) $(YFILES)
|
|
|
|
|
2008-09-18 16:06:43 -06:00
|
|
|
y.tab.c: y.tab.h
|
2008-09-22 11:56:54 -06:00
|
|
|
test -f y.tab.c && touch y.tab.c
|
2008-09-18 16:06:43 -06:00
|
|
|
|
2008-12-11 12:58:45 -07:00
|
|
|
# the test here checks whether we have 6g at all.
|
|
|
|
# if so, use it. if not, just use the sysimport.c we have.
|
|
|
|
# this happens on fresh perforce checkouts where
|
|
|
|
# sysimport.c ends up with an older time stamp
|
|
|
|
# than sys.go (or unsafe.go or mksys.c).
|
2008-12-08 20:46:39 -07:00
|
|
|
sysimport.c: sys.go unsafe.go mksys.c
|
2008-12-11 12:58:45 -07:00
|
|
|
if test -x $(BIN)/6g; then \
|
2008-12-19 10:03:44 -07:00
|
|
|
p4 open sysimport.c; \
|
2008-12-11 12:58:45 -07:00
|
|
|
gcc -o mksys mksys.c; \
|
|
|
|
6g sys.go; \
|
|
|
|
6g unsafe.go; \
|
|
|
|
./mksys sys >_sysimport.c && \
|
|
|
|
./mksys unsafe >>_sysimport.c && \
|
|
|
|
mv _sysimport.c sysimport.c; \
|
|
|
|
elif test -f sysimport.c; then \
|
|
|
|
touch sysimport.c; \
|
|
|
|
fi
|
2008-06-11 18:50:07 -06:00
|
|
|
|
|
|
|
clean:
|
2008-10-03 17:15:55 -06:00
|
|
|
rm -f $(OFILES) *.6 enam.c 6.out a.out y.tab.h y.tab.c $(LIB) _sysimport.c
|
2008-06-11 18:50:07 -06:00
|
|
|
|
|
|
|
install: $(LIB)
|