mirror of
https://frontier.innolan.net/github/amigaos-cross-toolchain6.git
synced 2024-10-19 10:29:55 +00:00
Put together an example that works on A500.
This commit is contained in:
1
examples/.gitignore
vendored
Normal file
1
examples/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
hello
|
||||||
13
examples/Makefile
Normal file
13
examples/Makefile
Normal file
@ -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 *~
|
||||||
17
examples/hello.c
Normal file
17
examples/hello.c
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/* This example works even for Kickstart 1.3 ! */
|
||||||
|
|
||||||
|
#include <proto/exec.h>
|
||||||
|
#include <proto/dos.h>
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user