瀏覽代碼

replace GNU.make with Ruby.rake

tags/v0.9.0
jimzhan 9 年之前
父節點
當前提交
ea88839815
共有 2 個文件被更改,包括 34 次插入15 次删除
  1. +0
    -15
      Makefile
  2. +34
    -0
      Rakefile

+ 0
- 15
Makefile 查看文件

@@ -1,15 +0,0 @@
ARCH=$(shell ls $(GOPATH)/pkg | head -n 1)
PKG=$(GOPATH)/pkg/$(ARCH)/github.com/goanywhere

all: test
@echo $HOST

clean:
@find $(PKG) -name 'rex.a' -delete
@find $(PKG) -name 'rex' -type d -print0|xargs -0 rm -r

build:
@go get -v ./...

test: build
@go test -v ./...

+ 34
- 0
Rakefile 查看文件

@@ -0,0 +1,34 @@
require 'pathname'
require 'fileutils'

OS=RbConfig::CONFIG["host_os"][0..5]
Package = File.join("#{ENV['GOPATH']}", "pkg", "*")


desc 'Remove previously built packages.'
task :clean do
Pathname.glob("#{Package}").map {|item|
if item.basename.to_s.start_with?(OS)
base = File.join(item.to_s, 'github.com', 'goanywhere')
# remove compiled rex sub-packages
if File.exists?(File.join(base, 'rex'))
FileUtils.rm_r File.join(base, 'rex'), :force => true
end
# remove compiled rex package
if File.exists?(File.join(base, 'rex.a'))
FileUtils.rm File.join(base, 'rex.a'), :force => true
end
end
}
end

desc 'Start building whole rex packages.'
task :build => :clean do
sh 'go get -v ./...'
end


desc 'Start testing rex packages...'
task 'test' do
sh 'go test -v ./...'
end

Loading…
取消
儲存