summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakiyamn2020-09-03 21:34:40 +1000
committerakiyamn2020-09-03 21:34:40 +1000
commit4444a375ac7f24ada2932291661d9102791604d9 (patch)
treec8b5c042078693b7cf787d4e2aad99ae21cebcf7
parent78858644ebdb5d171c3243408cbf33c5b4afd92d (diff)
downloadfit2100_ass1-4444a375ac7f24ada2932291661d9102791604d9.tar.gz
fit2100_ass1-4444a375ac7f24ada2932291661d9102791604d9.zip
Makefile and basic mechanisms added
-rw-r--r--Makefile9
-rwxr-xr-xa.outbin0 -> 16672 bytes
-rwxr-xr-xfileutilbin0 -> 16672 bytes
-rw-r--r--fileutil.c17
-rw-r--r--fileutil.h2
-rw-r--r--fileutil.obin0 -> 1848 bytes
6 files changed, 28 insertions, 0 deletions
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
--- /dev/null
+++ b/a.out
Binary files differ
diff --git a/fileutil b/fileutil
new file mode 100755
index 0000000..5186573
--- /dev/null
+++ b/fileutil
Binary files differ
diff --git a/fileutil.c b/fileutil.c
index e69de29..af98a1b 100644
--- a/fileutil.c
+++ b/fileutil.c
@@ -0,0 +1,17 @@
+#include <unistd.h>
+#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
--- /dev/null
+++ b/fileutil.o
Binary files differ