Skip to content

Commit

Permalink
add gb generated makefiles, for compiling via gomake
Browse files Browse the repository at this point in the history
update this with gb --makefiles -f
  • Loading branch information
rdarder committed Dec 28, 2011
1 parent 3a81e64 commit d636580
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.8
*.6
_obj/
46 changes: 38 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
# Makefile generated by gb: http://go-gb.googlecode.com
# gb provides configuration-free building and distributing

include $(GOROOT)/src/Make.inc

TARG = gocached
TARG=gocached
GOFILES=\
command.go\
generationalstorage.go\
gocached.go\
hashingstorage.go\
heapexpiringstorage.go\
mapstorage.go\
storage.go\

# gb: this is the local install
GBROOT=.

# gb: compile/link against local install
GCIMPORTS+= -I $(GBROOT)/_obj
LDIMPORTS+= -L $(GBROOT)/_obj

# gb: compile/link against GOPATH entries
GOPATHSEP=:
ifeq ($(GOHOSTOS),windows)
GOPATHSEP=;
endif
GCIMPORTS+=-I $(subst $(GOPATHSEP),/pkg/$(GOOS)_$(GOARCH) -I , $(GOPATH))/pkg/$(GOOS)_$(GOARCH)
LDIMPORTS+=-L $(subst $(GOPATHSEP),/pkg/$(GOOS)_$(GOARCH) -L , $(GOPATH))/pkg/$(GOOS)_$(GOARCH)

GOFILES = \
gocached.go \
mapstorage.go \
hashingstorage.go \
command.go \
generationalstorage.go \
storage.go
# gb: default target is in GBROOT this way
command:

include $(GOROOT)/src/Make.cmd

# gb: copy to local install
$(GBROOT)/bin/$(TARG): $(TARG)
mkdir -p $(dir $@); cp -f $< $@
command: $(GBROOT)/bin/$(TARG)

# gb: local dependencies
$(TARG): $(GBROOT)/_obj/expiry.a

15 changes: 15 additions & 0 deletions build
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Build script generated by gb: http://go-gb.googlecode.com
# gb provides configuration-free building and distributing

echo "Build script generated by gb: http://go-gb.googlecode.com"
if [ "$1" = "goinstall" ]; then
echo Running goinstall \

else
echo Building \
&& echo "(in expiry)" gomake $1 && cd expiry && gomake $1 && cd - > /dev/null \
&& echo "(in .)" gomake $1 && cd . && gomake $1 && cd - > /dev/null \

fi

# The makefiles above are invoked in topological dependence order
31 changes: 31 additions & 0 deletions expiry/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Makefile generated by gb: http://go-gb.googlecode.com
# gb provides configuration-free building and distributing

include $(GOROOT)/src/Make.inc

TARG=expiry
GOFILES=\
heap.go\

# gb: this is the local install
GBROOT=..

# gb: compile/link against local install
GCIMPORTS+= -I $(GBROOT)/_obj
LDIMPORTS+= -L $(GBROOT)/_obj

# gb: compile/link against GOPATH entries
GOPATHSEP=:
ifeq ($(GOHOSTOS),windows)
GOPATHSEP=;
endif
GCIMPORTS+=-I $(subst $(GOPATHSEP),/pkg/$(GOOS)_$(GOARCH) -I , $(GOPATH))/pkg/$(GOOS)_$(GOARCH)
LDIMPORTS+=-L $(subst $(GOPATHSEP),/pkg/$(GOOS)_$(GOARCH) -L , $(GOPATH))/pkg/$(GOOS)_$(GOARCH)

# gb: copy to local install
$(GBROOT)/_obj/$(TARG).a: _obj/$(TARG).a
mkdir -p $(dir $@); cp -f $< $@

package: $(GBROOT)/_obj/$(TARG).a

include $(GOROOT)/src/Make.pkg

0 comments on commit d636580

Please sign in to comment.