Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tested-on: morland i686 GNU/Linux
- Loading branch information
Showing
7 changed files
with
89 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
*.[8] | ||
*.[865a] | ||
*~ | ||
testit | ||
_obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,58 @@ | ||
# Copyright 2010 David Roundy, roundyd@physics.oregonstate.edu. | ||
# All rights reserved. | ||
|
||
all: Makefile packages | ||
|
||
Makefile: scripts/make.header $(wildcard *.go) | ||
cp -f scripts/make.header $@ | ||
gotmake >> $@ | ||
|
||
test: install testit | ||
|
||
install: installbins installpkgs | ||
|
||
|
||
include $(GOROOT)/src/Make.$(GOARCH) | ||
|
||
TARG=goopt | ||
GOFILES=\ | ||
goopt.go\ | ||
binaries: | ||
packages: pkg/goopt.a | ||
|
||
ifndef GOBIN | ||
GOBIN=$(HOME)/bin | ||
endif | ||
|
||
# ugly hack to deal with whitespaces in $GOBIN | ||
nullstring := | ||
space := $(nullstring) # a space at the end | ||
bindir=$(subst $(space),\ ,$(GOBIN)) | ||
pkgdir=$(subst $(space),\ ,$(GOROOT)/pkg/$(GOOS)_$(GOARCH)) | ||
|
||
.PHONY: test binaries packages install installbins installpkgs | ||
.SUFFIXES: .$(O) .go .got .gotgo | ||
|
||
.go.$(O): | ||
cd `dirname "$<"`; $(GC) `basename "$<"` | ||
.got.gotgo: | ||
gotgo "$<" | ||
|
||
# looks like we require gotgo/slice.got as installed package... | ||
gotgo/slice(string).go: $(pkgdir)/./gotgo/slice.gotgo | ||
mkdir -p gotgo/ | ||
$< 'string' > "$@" | ||
goopt.$(O): goopt.go gotgo/slice(string).$(O) | ||
|
||
pkg/goopt.$(O): pkg/goopt.go | ||
pkg/goopt.a: pkg/goopt.$(O) | ||
gopack grc $@ $< | ||
$(pkgdir)/goopt.a: pkg/goopt.a | ||
mkdir -p $(pkgdir)/ | ||
cp $< $@ | ||
|
||
|
||
testit: testit.$(O) | ||
@mkdir -p bin | ||
$(LD) -o $@ $< | ||
testit.$(O): testit.go | ||
|
||
include $(GOROOT)/src/Make.pkg | ||
installbins: | ||
installpkgs: $(pkgdir)/goopt.a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2010 David Roundy, roundyd@physics.oregonstate.edu. | ||
# All rights reserved. | ||
|
||
all: Makefile packages | ||
|
||
Makefile: scripts/make.header $(wildcard *.go) | ||
cp -f scripts/make.header $@ | ||
gotmake >> $@ | ||
|
||
test: install testit | ||
|
||
install: installbins installpkgs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters