-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzinn.yaml
54 lines (50 loc) · 1.15 KB
/
zinn.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
constants:
CC: gcc
CFLAGS: -std=c11 -pedantic -Wall -Werror -D_XOPEN_SOURCE=700
BIN: "cproj"
BUILDDIR: build
SOURCES: "{{joinlines (shell 'find . -name \"*.c\"')}}"
OBJECTS: "{{re SOURCES '([^\\\\s ]*).c' (cat BUILDDIR '/' '$1.o')}}"
jobs:
builddir:
outputs: "{{BUILDDIR}}"
run: mkdir -vp {{BUILDDIR}}
object:
args: [path]
requires:
- job: builddir
inputs: "{{path}}"
outputs: "{{BUILDDIR}}/{{subst path '.c' '.o'}}"
run: |
echo "compiling."
sleep 1
echo "compiling.."
false
sleep 1
echo "compiling..."
sleep 1
{{CC}} {{CFLAGS}} -c {{path}} -o "{{BUILDDIR}}/{{subst path '.c' '.o'}}"
binary:
requires:
- job: object
foreach:
var: path
in: "{{SOURCES}}"
- job: builddir
inputs: "{{OBJECTS}}"
outputs: "{{BUILDDIR}}/{{BIN}}"
run: |
echo "linking."
sleep 1
echo "linking.."
sleep 1
echo "linking..."
sleep 1
{{CC}} {{CFLAGS}} -o "{{BUILDDIR}}/{{BIN}}" {{OBJECTS}}
clean:
run: |
rm -rf {{BUILDDIR}}
rm -rf {{BIN}}
default:
requires:
- job: binary