Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * hello-1.2/Makefile
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1995, 1997 by Ralf Baechle
- */
- #include <regdef.h>
- #include <sys/asm.h>
- #include <sys/syscall.h>
- #define O_RDWR 02
- EXPORT(__start)
- .set noreorder
- LEAF(main)
- # fd = open("/dev/tty1", O_RDWR, 0);
- la a0,tty
- li a1,O_RDWR
- li a2,0
- li v0,SYS_open
- syscall
- bnez a3,quit
- move s0,v0 # delay slot
- # write(fd, "hello, world.n", 14);
- move a0,s0
- la a1,hello
- li a2,14
- li v0,SYS_write
- syscall
- # close(fd);
- move a0,s0
- li v0,SYS_close
- syscall
- quit:
- li a0,0
- li v0,SYS_exit
- syscall
- j quit
- nop
- END(main)
- .data
- tty: .asciz "/dev/tty1"
- hello: .ascii "Hello, world.n"
- #
- # hello-1.2/Makefile
- #
- # This file is subject to the terms and conditions of the GNU General Public
- # License. See the file COPYING in the main directory of this archive for more
- # details.
- tool-prefix = mips-linux-gnu-
- CC = $(tool-prefix)gcc -I /home/slobodan/rtl819x-toolchain/toolchain/rsdk-1.5.5-5281-EB-2.6.30-0.9.30.3-110714/include/sys/
- LD = $(tool-prefix)ld
- STRIP = $(tool-prefix)strip
- CFLAGS = -G0 -mno-abicalls -fno-pic
- LDFLAGS = -N -s
- all: hello
- hello: hello.o
- $(LD) $(LDFLAGS) -o hello hello.o
- hello.o: hello.S
- $(CC) $(CFLAGS) -c hello.S
- clean:
- rm -f core a.out *.o *.s
- distclean: clean
- rm -f hello
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement