merge shellscripts to Makefile

This commit is contained in:
rr- 2021-02-10 16:21:57 +01:00
parent bc9246b1d4
commit 660d892033
6 changed files with 19 additions and 12 deletions

View file

@ -2,9 +2,10 @@ FROM ubuntu:latest
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y gcc-mingw-w64-i686
apt-get install -y gcc-mingw-w64-i686 make
WORKDIR /
ADD src /src
ADD Makefile /Makefile
ENTRYPOINT ["/entrypoint.sh"]
CMD ["make", "build"]

14
Makefile Normal file
View file

@ -0,0 +1,14 @@
CC=i686-w64-mingw32-gcc
CFLAGS=-W -static -shared
build: $(shell find src)
$(CC) $(CFLAGS) $(shell find src -type f -iname '*.c') -ldbghelp -o build/TR1Main.dll
docker_build:
docker build -t tr1main .
docker run -v $(shell pwd)/build:/build tr1main
lint:
clang-format-10 -i $(wildcard **/*.h **/*.c)
.PHONY: build docker_build lint

View file

@ -34,7 +34,8 @@ Currently the following configuration options are supported:
- i686-w64-mingw32-gcc - C/C++ compiler
- Vim @ WSL - IDE
To compile the project with Docker, just run `./compile`.
To compile the project, run `make build`.
To compile the project with Docker, run `make docker_build`.
## License

View file

@ -1,3 +0,0 @@
#!/bin/sh
docker build -t tr1main .
docker run -v $(pwd)/entrypoint.sh:/entrypoint.sh -v $(pwd)/build:/build tr1main

View file

@ -1,3 +0,0 @@
#!/bin/bash
shopt -s globstar
i686-w64-mingw32-gcc -W -static -shared src/**/*.c -ldbghelp -o build/TR1Main.dll

3
format
View file

@ -1,3 +0,0 @@
#!/bin/bash
shopt -s globstar
clang-format-10 **/*.{c,h} -i