Skip to content

Commit

Permalink
Updated makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
yeoji committed May 3, 2020
1 parent afe35e8 commit c7e7ef0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
21 changes: 14 additions & 7 deletions fifty-bird/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
.PHONY: build
.PHONY: build build_darwin_x64 build_windows_x64

game = fifty-bird

compile-assets:
@go generate assets/generate.go
@echo "[OK] Fifty Bird static assets compiled!"
@echo "[OK] $(game) static assets compiled!"

build: compile-assets build_darwin_x64 build_windows_x64
@echo "[OK] $(game) binary was created!"

build_darwin_x64:
@GOOS=darwin GOARCH=amd64 go build -o ./build/macos-x64/$(game)

build: compile-assets
@go build -o ./build/fifty-bird *.go
@echo "[OK] Fifty Bird binary was created!"
build_windows_x64:
@GOOS=windows GOARCH=amd64 go build -o ./build/windows-x64/$(game).exe

run: build
@./build/fifty-bird
run:
go run *.go

clean:
rm -rf build
Expand Down
24 changes: 16 additions & 8 deletions pong/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
.PHONY: build
.PHONY: build build_darwin_x64 build_windows_x64

game = pong

compile-assets:
@go generate assets/generate.go
@echo "[OK] Pong static assets compiled!"
@echo "[OK] $(game) static assets compiled!"

build: compile-assets build_darwin_x64 build_windows_x64
@echo "[OK] $(game) binary was created!"

build_darwin_x64:
@GOOS=darwin GOARCH=amd64 go build -o ./build/macos-x64/$(game)

build: compile-assets
@go build -o ./build/pong *.go
@echo "[OK] Pong binary was created!"
build_windows_x64:
@GOOS=windows GOARCH=amd64 go build -o ./build/windows-x64/$(game).exe

run: build
@./build/pong
run:
go run *.go

clean:
rm -rf build
rm -rf build
rm -rf assets/**/*.generated.go

0 comments on commit c7e7ef0

Please sign in to comment.