Moxa Technologies W311 Computer Hardware User Manual


 
ThinkCore W311/321/341 Linux User’s Manual Tool Chains for Application Development
5-11
Next, enter the hello directory and invoke the make program that will execute the compilation
instructions written in the Makefile to compile the hello project.
/hello
drwxrwx--- 7 Jared_Wu 4294967295 0 Nov 4 11:10 etc
drwx------ 2 Jared_Wu mkpasswd 0 Nov 4 18:07 hello
-rwxr-x--- 1 Jared_Wu 4294967295 3262 Nov 4 11:12 insight.ico
drwxrwx--- 5 Jared_Wu 4294967295 0 Nov 4 11:10 lib
-rwxr-x--- 1 Jared_Wu 4294967295 53 Nov 4 10:12 moxa.bat
-rwxr-x--- 1 Jared_Wu 4294967295 3262 Nov 4 11:12 moxa.ico
drwxrwx--- 4 Jared_Wu 4294967295 0 Nov 4 18:11 tmp
drwxrwx--- 13 Jared_Wu 4294967295 0 Nov 4 11:06 usr
drwxrwx--- 6 Jared_Wu 4294967295 0 Nov 4 11:06 var
Jared_Wu@Jared_Wu /
$ cd hello/
Jared_Wu@Jared_Wu /hello
$ make
/usr/local/mxscaleb/bin/mxscaleb-gcc –o hello-release hello.c
/usr/local/mxscaleb/bin/mxscaleb-strip –s hello-release
/usr/local/mxscaleb/bin/mxscaleb-gcc –ggdb -o hello-debug hello.c
Jared_Wu@Jared_Wu /hello
$ ls
Makefile README hello-debug hello-release hello.c
Jared_Wu@Jared_Wu /hello
$
After that, use FTP to upload the executable file to the UC, and then run the executable.
/hello
ftp> bye
Jared_Wu@Jared_Wu /hello
$ ftp 192.168.14.9
Connected to 192.168.14.9.
220 Moxa FTP server <Version wu-2.6.1<2> Mon Nov 24 12:17:04 CST 2003> ready.
User <192.168.14.9:<none>>: root
331 Password required for root.
Password:
230 User root logged in.
ftp> bin
200 PORT command successful.
150 Opening BINARY mode data connection for hello-release.
226 Transfer complete.
ftp: 2744 bytes sent in 0.00Seconds 2744000.00Kbytes/sec.
ftp> bye
221-You have transferred 2744 bytes in 1 files.
221-Total traffic for this session was 3131 bytes in 1 transfers.
221-Thank you for using the FTP service on Moxa.
221 Goodbye.
Jared_Wu@Jared_Wu /hello
$
root@Moxa:~# chmod 777 hello-release
root@Moxa:~# ./hello-release
Hello