Moxa W406-T-CE [22/74] Compiling tcps2 c

Moxa W406-T-LX [22/74] Compiling tcps2 c
W315A/325A Linux User's Manual Getting Started
2-14
Compiling tcps2.c
The source code for the tcps2 example is located on the CD-ROM at
CD-ROM://examples/W321.341.315.325.345_IA240.241_UC-7112PLUS_W315A.W325A/
TCPServer2/tcps2.c
.
Use the following commands to copy the file to a specific directory on your PC. We use the directory
/home/w3x5/1st_application/. Note that you need to copy 3 filesMakefile, tcps2.c, tcpsp.cfrom the
CD-ROM to the target directory.
#mount –t iso9660 /dev/cdrom /mnt/cdrom
#cp /mnt/cdrom/examples/W321.341.315.325.345_IA240.241_UC-7112PLUS_W315A.W325A/
TCPServer2/tcpsp.c /home/w3x5/1st_application/tcps2.c
#cp /mnt/cdrom/ /home/w3x5/1st_application/tcpsp.c
#cp /mnt/cdrom/examples/W321.341.315.325.345_IA240.241_UC-7112PLUS_W315A.W325A/
TCPServer2/Makefile /home/w3x5/1st_application/Makefile
Type #make to compile the example code:
You will get the following response, indicating that the example program compiled successfully.
root@server11:/home/w3x5/1st_application
[root@server11 1st_application]# pwd
/home/w3x5/1st_application
[root@server11 1st_application]# 11
total 20
-rw-r—r-- 1 root root 514 Nov 27 11:52 Makefile
-rw-r—r-- 1 root root 4554 Nov 27 11:52 tcps2.c
-rw-r—r-- 1 root root 6164 Nov 27 11:55 tcps2.c
[root@server11 1st_application]# make_
/usr/local/arm-linux/bin/arm-linux-gcc -o tcps2-release tcps2.c
/usr/local/arm-linux/bin/arm-linux-strip –s tcps2-release
/usr/local/arm-linux/bin/arm-linux-gcc -o tcpsp-release tcpsp.c
/usr/local/arm-linux/bin/arm-linux-strip –s tcpsp-release
/usr/local/arm-linux/bin/arm-linux-gcc –ggdb -o tcps2-debug tcps2.c
/usr/local/arm-linux/bin/arm-linux-gcc –ggdb -o tcpsp-debug tcpsp.c
[root@server11 1st_application]# 11
total 92
-rw-r—-r-- 1 root root 514 Nov 27 11:52 Makefile
-rwxr-xr—x 1 root root 25843 Nov 27 12:03 tcps2-debug
-rwxr—xr-x 1 root root 4996 Nov 27 12:03 tcps2-release
-rw-r—-r-- 1 root root 4554 Nov 27 11:52 tcps2.c
-rwxr—xr-x 1 root root 26823 Nov 27 12:03 tcpsp-debug
-rwxr—xr-x 1 root root 5396 Nov 27 12:03 tcpsp-release
-rw-r—-r-- 1 root root 6164 Nov 27 11:55 tcpsp.c
[root@server11 1st_application]#
Two executable files, tcps2-release and tcps2-debug, are created.
tcps2-releasean ARM platform execution file (created specifically to run on the W315A/325A)
tcps2-debugan ARM platform GDB debug server execution file (see Chapter 5 for details about the GDB
debug tool).
NOTE
If you get an error message at this point, it could be because you neglected to put tcps2.c and tcpsp.c in the
same directory. The example Makefile we provide is set up to compile both tcps2 and tcpsp into the same
project Makefile. Alternatively, you could modify the Makefile to suit your particular requirements.

Содержание

Скачать