CLEANFILES= $TARG _go_.$O _test _testmain.go test.out build.out

all:V:	$TARG

install:V:	$TARGDIR/$TARG

$TARGDIR/$TARG:	$TARG
	test -d $TARGDIR || mkdir $TARGDIR
	cp $prereq $target

$TARG: _go_.$O
	$LD $LDIMPORTS -o $target $prereq

_go_.$O:	$GOFILES $PREREQ
	$GC $GCFLAGS $GCIMPORTS -o $target $GOFILES

clean:V:
	rm -rf $CLEANFILES

nuke:V:	clean
	rm -f $TARGDIR/$TARG

ignore:
	test -f .cvsignore || {
		echo '_go_.[25678qv]' 
	} >.cvsignore

# for gotest
testpackage: _test/main.a

testpackage-clean:
	rm -f _test/main.a _gotest_.$O

_test/main.a: _gotest_.$O
	test -d _test || mkdir _test
	rm -f $target
	gopack grc $target _gotest_.$O

_gotest_.$O: $GOFILES $GOTESTFILES
	$GC $GCFLAGS $GCIMPORTS -o $target $GOFILES $GOTESTFILES

importpath:
	echo main
