diff --git a/build.go b/build.go
index 5b75f318e..8b67cfcef 100644
--- a/build.go
+++ b/build.go
@@ -284,9 +284,7 @@ func assets() {
}
func xdr() {
- for _, f := range []string{"internal/discover/packets", "internal/files/leveldb", "internal/protocol/message"} {
- runPipe(f+"_xdr.go", "go", "run", "./Godeps/_workspace/src/github.com/calmh/xdr/cmd/genxdr/main.go", "--", f+".go")
- }
+ runPrint("go", "generate", "./internal/discover", "./internal/files", "./internal/protocol")
}
func translate() {
diff --git a/internal/discover/packets.go b/internal/discover/packets.go
index 85cf13b66..c0e53d427 100644
--- a/internal/discover/packets.go
+++ b/internal/discover/packets.go
@@ -13,6 +13,9 @@
// You should have received a copy of the GNU General Public License along
// with this program. If not, see .
+//go:generate -command genxdr go run ../../Godeps/_workspace/src/github.com/calmh/xdr/cmd/genxdr/main.go
+//go:generate genxdr -o packets_xdr.go packets.go
+
package discover
const (
diff --git a/internal/files/leveldb.go b/internal/files/leveldb.go
index 1fba0598b..9c93658fe 100644
--- a/internal/files/leveldb.go
+++ b/internal/files/leveldb.go
@@ -13,6 +13,9 @@
// You should have received a copy of the GNU General Public License along
// with this program. If not, see .
+//go:generate -command genxdr go run ../../Godeps/_workspace/src/github.com/calmh/xdr/cmd/genxdr/main.go
+//go:generate genxdr -o leveldb_xdr.go leveldb.go
+
package files
import (
diff --git a/internal/protocol/message.go b/internal/protocol/message.go
index 9a96f80c5..8cc191d8c 100644
--- a/internal/protocol/message.go
+++ b/internal/protocol/message.go
@@ -13,6 +13,9 @@
// You should have received a copy of the GNU General Public License along
// with this program. If not, see .
+//go:generate -command genxdr go run ../../Godeps/_workspace/src/github.com/calmh/xdr/cmd/genxdr/main.go
+//go:generate genxdr -o message_xdr.go message.go
+
package protocol
import "fmt"