diff options
| author | akiyamn | 2020-09-03 21:34:40 +1000 |
|---|---|---|
| committer | akiyamn | 2020-09-03 21:34:40 +1000 |
| commit | 4444a375ac7f24ada2932291661d9102791604d9 (patch) | |
| tree | c8b5c042078693b7cf787d4e2aad99ae21cebcf7 | |
| parent | 78858644ebdb5d171c3243408cbf33c5b4afd92d (diff) | |
| download | fit2100_ass1-4444a375ac7f24ada2932291661d9102791604d9.tar.gz fit2100_ass1-4444a375ac7f24ada2932291661d9102791604d9.zip | |
Makefile and basic mechanisms added
| -rw-r--r-- | Makefile | 9 | ||||
| -rwxr-xr-x | a.out | bin | 0 -> 16672 bytes | |||
| -rwxr-xr-x | fileutil | bin | 0 -> 16672 bytes | |||
| -rw-r--r-- | fileutil.c | 17 | ||||
| -rw-r--r-- | fileutil.h | 2 | ||||
| -rw-r--r-- | fileutil.o | bin | 0 -> 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 Binary files differdiff --git a/fileutil b/fileutil Binary files differnew file mode 100755 index 0000000..5186573 --- /dev/null +++ b/fileutil @@ -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; +} @@ -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 Binary files differnew file mode 100644 index 0000000..df6344a --- /dev/null +++ b/fileutil.o |
