Skip to content

Commit

Permalink
Added my details and changed buildfile
Browse files Browse the repository at this point in the history
  • Loading branch information
djhworld committed Jun 23, 2013
1 parent 35afef4 commit 9b0d447
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,22 @@ task :build_linux => [:setgopath, :get_go_deps] do
ENV["CGO_LDFLAGS"] = "-Wl,-Bstatic -lGLEW -lglfw -Wl,-Bdynamic"
puts "Set CGO_LDFLAGS to #{ENV["CGO_LDFLAGS"]}"
sh %{#{construct_build_command(@build_platform, @version, EXE_NAME)}}
package(EXE_NAME, @version, "target/#{@build_platform}")
package(EXE_NAME, @version, "target")
end

task :build_darwin => [:setgopath, :set_cgo_flags, :get_go_deps] do
puts "Building for #{@build_platform} (dymanic linked binary)"
sh construct_build_command(@build_platform, @version, EXE_NAME)
sh "mkdir target/#{@build_platform}/bin && mv target/#{@build_platform}/#{EXE_NAME} target/#{@build_platform}/bin/"
sh "cp -a #{Dir.pwd}/dist/#{@build_platform}/pkg/* target/#{@build_platform}/"
package(EXE_NAME, @version, "target/#{@build_platform}")
sh "mkdir target/#{EXE_NAME}-#{@version}/bin && mv target/#{EXE_NAME}-#{@version}/#{EXE_NAME} target/#{EXE_NAME}-#{@version}/bin/"
sh "cp -a #{Dir.pwd}/dist/#{@build_platform}/pkg/* target/#{EXE_NAME}-#{@version}/"
package(EXE_NAME, @version, "target")
end

task :build_windows => [:setgopath, :set_cgo_flags, :get_go_deps] do |t, args|
puts "Building for #{@build_platform} (dymanic linked binary)"
sh construct_build_command(@build_platform, @version, EXE_NAME+".exe")
sh "cp -a #{Dir.pwd}/dist/#{@build_platform}/pkg/* target/#{@build_platform}/"
package(EXE_NAME, @version, "target/#{@build_platform}")
sh "cp -a #{Dir.pwd}/dist/#{@build_platform}/pkg/* target/#{EXE_NAME}-#{@version}/"
package(EXE_NAME, @version, "target")
end

task :run_darwin, [:prog_args] => [:setgopath, :set_cgo_flags, :get_go_deps_no_download] do |t, args|
Expand Down Expand Up @@ -118,7 +118,7 @@ def package(name, version, artifacts_dir)
sh "rm -rf artifacts"
sh "mkdir artifacts"
cd artifacts_dir
sh "zip -r ../../artifacts/#{filename} ./*"
sh "zip -r ../artifacts/#{filename} ./*"
end

def get_deps(download)
Expand All @@ -134,7 +134,7 @@ def get_deps(download)
end

def construct_build_command(platform, version, exename)
return "go build -a -o target/#{platform}/#{exename} -ldflags=\"-X main.VERSION #{version}\" src/gbc.go src/debugger.go src/config.go"
return "go build -a -o target/#{exename}-#{version}/#{exename} -ldflags=\"-X main.VERSION #{version}\" src/gbc.go src/debugger.go src/config.go"
end

def construct_run_command
Expand Down
2 changes: 2 additions & 0 deletions src/gbc.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ func (gbc *GomeboyColor) StoreFPSSample(sample int) {

func main() {
log.Printf("%s. %s", TITLE, VERSION)
log.Println("Copyright (c) 2013. Daniel James Harper.")
log.Println("http://djhworld.github.io/gomeboycolor")
log.Println(strings.Repeat("*", 120))

flag.Parse()
Expand Down

0 comments on commit 9b0d447

Please sign in to comment.