diff --git a/examples/.gitignore b/examples/.gitignore new file mode 100644 index 0000000..ce01362 --- /dev/null +++ b/examples/.gitignore @@ -0,0 +1 @@ +hello diff --git a/examples/Makefile b/examples/Makefile new file mode 100644 index 0000000..829628e --- /dev/null +++ b/examples/Makefile @@ -0,0 +1,13 @@ +CC = m68k-amigaos-gcc -noixemul -s +CFLAGS = -Os -Wall -fomit-frame-pointer + +all: hello + +hello: LDLIBS = -lnix13 +hello: CC += -fbaserel +hello: CFLAGS += -m68000 -msmall-code +hello: hello.c + +clean: + rm -f hello + rm -f *.o *~ diff --git a/examples/hello.c b/examples/hello.c new file mode 100644 index 0000000..9ff578e --- /dev/null +++ b/examples/hello.c @@ -0,0 +1,17 @@ +/* This example works even for Kickstart 1.3 ! */ + +#include +#include + +int __nocommandline = 1; +int __initlibraries = 0; + +struct DosLibrary *DOSBase = NULL; + +int main() { + if ((DOSBase = (struct DosLibrary *) OpenLibrary("dos.library", 34))) { + Write(Output(), "Hello world!\n", 13); + CloseLibrary((struct Library *)DOSBase); + } + return 0; +}