code reorganization
[epoint] / pkg / Makefile
diff --git a/pkg/Makefile b/pkg/Makefile
new file mode 100644 (file)
index 0000000..4917a98
--- /dev/null
@@ -0,0 +1,49 @@
+include $(GOROOT)/src/Make.inc
+
+all: install
+
+DIRS=\
+       document\
+       key\
+       server\
+       store\
+       ../cmd/genkey\
+       ../cmd/epoint-client\
+       ../cmd/epoint-server\
+
+clean.dirs: $(addsuffix .clean, $(DIRS))
+install.dirs: $(addsuffix .install, $(DIRS))
+nuke.dirs: $(addsuffix .nuke, $(DIRS))
+test.dirs: $(addsuffix .test, $(DIRS))
+testshort.dirs: $(addsuffix .testshort, $(DIRS))
+
+%.clean:
+       +$(MAKE) -C $* clean
+
+%.install:
+       +@echo install $*
+       +@$(MAKE) -C $* install.clean >$*/build.out 2>&1 || (echo INSTALL FAIL $*; cat $*/build.out; exit 1)
+
+%.nuke:
+       +$(MAKE) -C $* nuke
+
+%.test:
+       +@echo test $*
+       +@$(MAKE) -C $* test.clean >$*/test.out 2>&1 || (echo TEST FAIL $*; cat $*/test.out; exit 1)
+
+clean: clean.dirs
+
+install: install.dirs
+
+test: test.dirs
+
+nuke: nuke.dirs
+       rm -rf "$(GOROOT)"/pkg/$(GOOS)_$(GOARCH)/epoint
+
+deps:
+       ./deps.sh
+
+echo-dirs:
+       @echo $(DIRS)
+
+-include Make.deps