Basic instructions for use under Linux and configuration of makefile

  

The first big question: Mainly use some basic commands: cat, cp, mkdir, mv…

Create a new folder named test in the home directory

Then enter the etc directory, view the contents:

Then, query the passwd file inside, find and cp it to the test:

modify its name is mypasswd: < Br>

Create a new test1 folder in test

Create a hello.c file with the cat command in test1.

The first question is OK, comrades, this question It's easy!!!

The second big question: Make project manager use

Advantages: Make project manager is also an "automatic compiler manager" that can make a lot of files The file is compiled to reduce the amount of compilation work. At the same time, he performs a lot of compilation work by reading the contents of the makefile file.

The first method:

Makefile:

Hello:hello.c

gcc –o hello hello.c

The second method:

I will not write the hello program one by one, directly from the front cp a

Then in the current directory

# autoscan

#ls

Build

Change configure.scan to configure.in

#autoconf

#ls

Generating the appropriate file

Step 2: vi configure.scan Modify Add AC_INIT(hello,1.0)

AM_INIT_AUTOMAKE(hello,1.0) AC_CONFIG_FILES([makefile]) mv

configure.scan->configure.in

Step 3: aclocal------Generate aclocal.m4 Autoconf--------Generate configure

Step 4: autoheader--------Generate config.h.in

Step 5: vimakefile.am- -------

AUTOMAKE_OPTIONS=foreign

bin_PROGRAMS=hello

hello_SOURCES=hello.c

Step 6: automake –a ----------Generate configure.in

Step 7: ./configure

Third Question: Install QQ software

Set up sharing first, first install VMTools

#sudo dpkg–i WineQQ2012-20120719-Longene.deb

This will decompress and then execute The process is OK

The fourth question: install cross-compilation environment

I put arm-linux-gcc-3.4.1.tar.bz2.tar in mnt

Then unzip: tar jxvf arm-linux-gcc-3.4.1.tar.bz2.tar Unzip in the current directory, after extracting will find a usr directory:

Then, modify the environment variables, the specific steps:

# vim /etc/profile

Add path: /usr/local/arm/3.4.1/bin

On the last line:

Export PATH=$PATH: /usr/local/arm/3.4.1/bin

#source $PATH //Improve the new environment variable immediately

Check if the path is added to the PATH:

#echo $PATH

Test whether the installation was successful:

# arm-linux-gcc –v

Compile the Hello World program and test the cross tool Chain

perform the following Command:

# arm-linux-gcc -o hello hello.c

This command is only used on the arm board, so after execution, an error will occur.

Let's compile with gcc!

This code can't be used for commercial!!!

Copyright © Windows knowledge All Rights Reserved