From a67836c7c8aadd011762fe74a842e51d975e98a7 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 31 Mar 2020 11:57:48 -0400 Subject: basic implementation --- .gitignore | 2 ++ Makefile | 12 ++++++++++++ liby.c | 15 +++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 liby.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e0292b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.o +*.a diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..70a1c29 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +LIB=liby + +$(LIB).a: $(LIB).o + $(AR) rv $@ $(LIB).o + +$(LIB).o: $(LIB).c + $(CC) $(CFLAGS) -c $(LIB).c + +clean: + rm -f *.a *.o diff --git a/liby.c b/liby.c new file mode 100644 index 0000000..f7a7049 --- /dev/null +++ b/liby.c @@ -0,0 +1,15 @@ +#include + +extern int yyparse(void); + +int yyerror(const char *s) +{ + return fprintf(stderr, "%s\n", s); +} + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + return yyparse(); +} -- cgit v1.2.1