mirror of
https://github.com/onyx-and-iris/vmrcli.git
synced 2025-04-01 20:03:49 +01:00
Compare commits
3 Commits
22b7e9a765
...
29510feb8e
Author | SHA1 | Date | |
---|---|---|---|
29510feb8e | |||
f2a3247077 | |||
452bf6f6de |
3
.gitignore
vendored
3
.gitignore
vendored
@ -51,6 +51,9 @@ Module.symvers
|
||||
Mkfile.old
|
||||
dkms.conf
|
||||
|
||||
# Task Runner
|
||||
.task/
|
||||
|
||||
.vscode/
|
||||
|
||||
test*
|
55
Taskfile.yml
Normal file
55
Taskfile.yml
Normal file
@ -0,0 +1,55 @@
|
||||
version: '3'
|
||||
|
||||
dotenv: [ '.env' ]
|
||||
|
||||
vars:
|
||||
program: vmrcli
|
||||
|
||||
CC: gcc
|
||||
|
||||
SRC_DIR: src
|
||||
OBJ_DIR: obj
|
||||
BIN_DIR: bin
|
||||
|
||||
CPPFLAGS: -Iinclude -MMD -MP {{if eq .LOG_USE_COLOR "yes"}}-DLOG_USE_COLOR{{end}}
|
||||
|
||||
CFLAGS: -O -Wall -W -pedantic -ansi -std=c2x
|
||||
LDFLAGS: -Llib
|
||||
LDLIBS: -lm
|
||||
|
||||
tasks:
|
||||
default:
|
||||
desc: "Build vmrcli for Windows"
|
||||
deps: [build]
|
||||
|
||||
build:
|
||||
desc: "Build vmrcli for Windows"
|
||||
deps: [link]
|
||||
|
||||
link:
|
||||
desc: "Link all files in obj/ for Windows"
|
||||
deps: [compile]
|
||||
cmds:
|
||||
- powershell -Command "if (!(Test-Path -Path '{{.BIN_DIR}}')) { New-Item -ItemType Directory -Path '{{.BIN_DIR}}' }"
|
||||
- powershell -Command "{{.CC}} {{.LDFLAGS}} {{.OBJ_DIR}}/*.o {{.LDLIBS}} -o {{.BIN_DIR}}/{{.program}}.exe"
|
||||
sources:
|
||||
- '{{.OBJ_DIR}}/**'
|
||||
generates:
|
||||
- '{{.BIN_DIR}}/{{.program}}.exe'
|
||||
|
||||
compile:
|
||||
desc: "Compile all files in src/ and include/ for Windows"
|
||||
cmds:
|
||||
- powershell -Command "if (!(Test-Path -Path '{{.OBJ_DIR}}')) { New-Item -ItemType Directory -Path '{{.OBJ_DIR}}' }"
|
||||
- powershell -Command "Get-ChildItem -Path 'src' -Filter '*.c' | ForEach-Object { \$_.Name -replace '\.c$', '' } | ForEach-Object { {{.CC}} {{.CPPFLAGS}} {{.CFLAGS}} -c {{.SRC_DIR}}/\$_.c -Iinclude -o {{.OBJ_DIR}}/\$_.o }"
|
||||
sources:
|
||||
- '{{.SRC_DIR}}/**'
|
||||
- include/**
|
||||
generates:
|
||||
- obj/**
|
||||
|
||||
clean:
|
||||
desc: "Remove all files in obj/ and bin/"
|
||||
cmds:
|
||||
- powershell -Command "Remove-Item -Path '{{.OBJ_DIR}}' -Recurse -Force"
|
||||
- powershell -Command "Remove-Item -Path '{{.BIN_DIR}}' -Recurse -Force"
|
Loading…
x
Reference in New Issue
Block a user