Add Makefile to simply building

This commit is contained in:
Kienan Stewart 2023-06-26 20:29:09 -04:00
parent 28c48d7515
commit 6ba5a056a1
6 changed files with 40 additions and 34 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
Cameo-mod/
CameoReloaded/

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "Cameo-mod"]
path = Cameo-mod
url = https://github.com/Zeruel87/Cameo-mod.git

View File

@ -2,11 +2,12 @@ FROM docker.io/mono:6.12.0
WORKDIR /workdir
RUN dpkg --add-architecture i386
RUN apt-get update
RUN apt-get install -y apt-transport-https
RUN apt-get install -y --allow-unauthenticated --no-install-recommends \
ca-certificates zip file mono-devel libfreetype6 libopenal1 liblua5.1-0 libsdl2-2.0-0 \
xdg-utils zenity wget make unzip python nsis imagemagick python3
xdg-utils zenity wget make unzip python nsis imagemagick python3 wine32 wine64
RUN mkdir /dotnet
WORKDIR /dotnet
@ -16,5 +17,4 @@ RUN tar xzf /root/dotnet-sdk.tar.gz
ENV PATH="${PATH}:/dotnet"
ENV DOTNET_ROOT=/dotnet
WORKDIR /workdir
COPY build.sh /root/build.sh
CMD /root/build.sh
CMD /workdir/build-docker.sh

21
Makefile Normal file
View File

@ -0,0 +1,21 @@
CWD=$(shell pwd)
CAMEO_DIR?=$(CWD)/Cameo-mod
VERSION?=$(shell git --git-dir=$(CAMEO_DIR)/.git --work-tree=$(CAMEO_DIR) describe --tags)
VERSION?=$(shell git --git-dir=$(CAMEO_DIR)/.git --work-tree=$(CAMEO_DIR) rev-parse HEAD)
.phony: build-dev build all container build-linux
all: container build
container:
podman build -t cameo-build:latest .
build:
podman run --rm -v $(CAMEO_DIR):/workdir -e APPIMAGE_EXTRACT_AND_RUN=1 -e RELEASE_VERSION=$(VERSION) localhost/cameo-build:latest
build-dev:
podman run --rm -v $(CAMEO_DIR):/workdir localhost/cameo-build:latest
build-linux:
podman run --rm -v $(CAMEO_DIR):/workdir -e APPIMAGE_EXTRACT_AND_RUN=1 -e RELEASE_VERSION=$(VERSION) localhost/cameo-build:latest make
podman run --rm -v $(CAMEO_DIR):/workdir -e APPIMAGE_EXTRACT_AND_RUN=1 -e RELEASE_VERSION=$(VERSION) localhost/cameo-build:latest /bin/bash -c "cd build && ../packaging/linux/buildpackage.sh $(VERSION)"

View File

@ -4,38 +4,32 @@ It could be used to build any OpenRA mod which uses make and package-all.sh.
## Checking out the code
The actual Cameo source is a git submodule. If you are cloning this initially, use
```
git clone --recurse-submodules https://gitea.burntworld.ca/kienan/cameo-build.git
git clone https://gitea.burntworld.ca/kienan/cameo-build.git
```
If you already have the source checked out:
To get the Cameo source code, clone one of the following repos;
```
git submodule init
```
### Updating the checked out Cameo mod code
```
git submodule update
```
* [Cameo (releases)](https://github.com/Zeruel87/Cameo-mod.git)
* [Cameo (dev)](https://github.com/Elpollo315/Cameo-mod.git)
* [Cameo Reloaded](https://github.com/Carloo999/CameoReloaded.git)
## Building container image
```
podman build -t cameo-build:latest .
make container
```
## Building Cameo
```
podman run --rm -v $(pwd)/Cameo-mod:/workdir localhost/cameo-build:latest
```
To build the release packages (exe, AppImage):
To produce builds with complete packages:
```
podman run --rm -v $(pwd)/Cameo-mod:/workdir -e RELEASE_VERSION=$(git --git-dir=Cameo-mod/.git --work-tree=Cameo-mod describe --tags) localhost/cameo-build:latest
make build
```
To build the executables only;
```
make build-dev
```

View File

@ -1,8 +0,0 @@
#!/usr/bin/env bash
make
mkdir -p build && cd build
if [ -n "$RELEASE_VERSION" ]; then
../packaging/package-all.sh ${RELEASE_VERSION} $(pwd)
fi
cd ..