Skip to content

Commit

Permalink
Add building targets using Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
jolisper committed Apr 1, 2024
1 parent f4c3bf7 commit e351e26
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
SHELL := /bin/bash
WORKSPACE := $(shell pwd)
IMAGE := chip8-devcontainer
USER := $(shell id -u)
GROUP := $(shell id -g)

.PHONY: help clean lint format test doc build run bump build-windows

help:
Expand Down Expand Up @@ -37,6 +42,16 @@ build-windows: ## Build for Windows
@cp target/x86_64-pc-windows-gnu/release/chip8-cli.exe build/windows/chip8.exe
@cp target/x86_64-pc-windows-gnu/release/SDL2.dll build/windows

build-linux-with-docker: ## Build for Windows with Docker
@docker build . -f .devcontainer/Dockerfile -t $(IMAGE)
@docker run --rm -v $(WORKSPACE):/workspace -w /workspace $(IMAGE) make build
@docker run --rm -v $(WORKSPACE):/workspace -w /workspace $(IMAGE) chown -R $(USER):$(GROUP) build target

build-windows-with-docker: ## Build for Windows with Docker
@docker build . -f .devcontainer/Dockerfile -t $(IMAGE)
@docker run --rm -v $(WORKSPACE):/workspace -w /workspace $(IMAGE) make build-windows
@docker run --rm -v $(WORKSPACE):/workspace -w /workspace $(IMAGE) chown -R $(USER):$(GROUP) build target

all: clean lint format test doc build ## Build

bump: ## Bump version
Expand Down

0 comments on commit e351e26

Please sign in to comment.