Created
July 8, 2020 19:32
-
-
Save xxami/c26839abbd6c4fd055c60fe76b84c3f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
vars: | |
cc: cc | |
cflags: -std=c18 -pedantic -Wall -fstack-protector-strong -O2 | |
tasks: | |
build: | |
silent: true | |
cmds: | |
- | | |
set -e | |
csources="" | |
for file in src/*.c; do | |
if test -f $file; then | |
csources+="$file " | |
fi | |
done | |
for file in src/*/*.c; do | |
if test -f $file; then | |
csources+="$file " | |
fi | |
done | |
if [[ ! -z $csources ]] then | |
echo "compiling..." | |
echo {{.cc}} {{.cflags}} -c $csources | |
{{.cc}} {{.cflags}} -c $csources | |
else | |
echo "compile error... no c sources found" | |
fi | |
- task: link | |
sources: | |
- ./src/*.c | |
- ./src/**/*.c | |
generates: | |
- xdi{{exeExt}} | |
link: | |
silent: true | |
cmds: | |
- | | |
set -e | |
objs="" | |
for file in *.o; do | |
if test -f $file; then | |
objs+="$file " | |
fi | |
done | |
if [[ ! -z "$objs" ]] then | |
echo "linking..." | |
echo {{.cc }} {{.cflags}} -o xdi{{exeExt}} $objs | |
{{.cc}} {{.cflags}} -o xdi{{exeExt}} $objs | |
rm *.o | |
else | |
echo "link error... no obj files found" | |
fi | |
run: | |
cmds: | |
- task: build | |
- ./xdi{{exeExt}} | |
clean: | |
ignore_error: true | |
silent: true | |
cmds: | |
- rm xdi{{exeExt}} | |
- rm *.exe | |
- rm *.dll | |
- rm *.o |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment