added basic files

This commit is contained in:
Emil 2023-08-02 04:57:45 -06:00
parent 1b30982dba
commit 81f172648a
4 changed files with 62 additions and 0 deletions

24
build.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
# Simple script handling unity builds and options.
DIR=$(dirname $(readlink -f "$0"))
cd $DIR
PROGN=${PROGN:-dc}
PREFIX=${PREFIX:-$DIR}
CC=${CC-cc}
CFLAGS='-std=c99 -Wall -Wextra -Wpedantic'
CPPFLAGS='-Iinclude'
LDFLAGS='-lgmp -lreadline'
mkdir -p $PREFIX && echo "Made directory: $PREFIX"
if [ ! -z ${DEBUG} ] ; then CFLAG="$CFLAGS -Og -g3";
else CFLAG="$CFLAGS -O2 -flto=auto -fomit-frame-pointer"; fi
[ ! -z ${SAN} ] && CFLAG="$CFLAGS -fsanitize=$SAN"
echo "$CC $CFLAGS -pipe $DIR/src/unity.c -o $PREFIX/$PROGN $CPPFLAGS $LDFLAGS"
$CC $CFLAGS -pipe $DIR/src/unity.c -o $PREFIX/$PROGN $CPPFLAGS $LDFLAGS
echo "\nStatus: $?"

30
src/fetch.c Normal file
View File

@ -0,0 +1,30 @@
/* fetch.c - fetch from file */
#include <stdio.h>
#ifdef LOCAL_PROBOTIC_MAIN
int
main (int argc,
char ** argv)
{
if (argc > 1)
{
char * b;
/* get week number via stoi */
++argv; --argc;
/* no options, yet */
while (++argv, --argc)
{
printf("%s\n", *argv);
}
}
else
{
/* no stdin yet */
/* usage(); */
return 1;
}
}
#endif /* LOCAL_PROBOTIC_MAIN */

6
src/main.c Normal file
View File

@ -0,0 +1,6 @@
/* main.c - this file would handle the bot? */
int main(void)
{
return 0;
}

2
src/unity.c Normal file
View File

@ -0,0 +1,2 @@
#include "fetch.c"
#include "main.c"