Created
March 4, 2011 00:08
-
-
Save davecheney/853886 to your computer and use it in GitHub Desktop.
A sample top level Makefile for multi package Go projects
This file contains hidden or 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
# A sample top level Makefile for multi package Go projects. | |
include $(GOROOT)/src/Make.inc | |
CMDS=\ | |
command-1\ | |
command-2\ | |
command-3 | |
PKGS=\ | |
package-1\ | |
package-2\ | |
package-3 | |
all: make | |
make: $(addsuffix .install, $(PKGS)) $(addsuffix .make, $(CMDS)) | |
clean: $(addsuffix .nuke, $(PKGS)) $(addsuffix .clean, $(CMDS)) | |
%.install: | |
$(MAKE) -C $* install | |
# compile all packages before any command | |
%.make: $(addsuffix .install, $(PKGS)) | |
$(MAKE) -C $* | |
# establish dependancies between packages | |
package-2.install: package-1.install | |
package-1.install package-2.install: package-3.install | |
%.clean: | |
$(MAKE) -C $* clean | |
%.nuke: | |
$(MAKE) -C $* nuke |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment