From 4444a375ac7f24ada2932291661d9102791604d9 Mon Sep 17 00:00:00 2001 From: akiyamn Date: Thu, 3 Sep 2020 21:34:40 +1000 Subject: Makefile and basic mechanisms added --- Makefile | 9 +++++++++ a.out | Bin 0 -> 16672 bytes fileutil | Bin 0 -> 16672 bytes fileutil.c | 17 +++++++++++++++++ fileutil.h | 2 ++ fileutil.o | Bin 0 -> 1848 bytes 6 files changed, 28 insertions(+) create mode 100644 Makefile create mode 100755 a.out create mode 100755 fileutil create mode 100644 fileutil.o diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4ebec02 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +OBJS = fileutil.o +CC = gcc +CFLAGS = -Wall -c + +all: $(OBJS) + $(CC) $(OBJS) -o fileutil + +fileutil.o: fileutil.c fileutil.h + $(CC) $(CFLAGS) fileutil.c diff --git a/a.out b/a.out new file mode 100755 index 0000000..5186573 Binary files /dev/null and b/a.out differ diff --git a/fileutil b/fileutil new file mode 100755 index 0000000..5186573 Binary files /dev/null and b/fileutil differ diff --git a/fileutil.c b/fileutil.c index e69de29..af98a1b 100644 --- a/fileutil.c +++ b/fileutil.c @@ -0,0 +1,17 @@ +#include +#include "fileutil.h" + + +void to_stdout(char *string, ssize_t size) { + write(0, string, size); +} + +void to_stderr(char *string, ssize_t size) { + write(1, string, size); +} + +int main(int argc, char const *argv[]) { + /* code */ + to_stdout("Testing\n", 9); + return 0; +} diff --git a/fileutil.h b/fileutil.h index e69de29..23658ba 100644 --- a/fileutil.h +++ b/fileutil.h @@ -0,0 +1,2 @@ +void to_stdout(char *string, ssize_t size); +int main(int argc, char const *argv[]); \ No newline at end of file diff --git a/fileutil.o b/fileutil.o new file mode 100644 index 0000000..df6344a Binary files /dev/null and b/fileutil.o differ -- cgit v1.2.3