LinuxÖеÄmakefieÊéд¹æÔòѧϰ3
Áù¡¢ÁíÀà·ç¸ñµÄmakefile
¼´È»ÎÒÃǵÄmake¿ÉÒÔ×Ô¶¯ÍƵ¼ÃüÁÄÇôÎÒ¿´µ½ÄǶÑ[.o]ºÍ[.h]µÄÒÀÀµ¾ÍÓе㲻ˬ£¬ÄÇô¶àµÄÖظ´µÄ[.h]£¬Äܲ»ÄÜ°ÑÆäÊÕ£ÆðÀ´£¬ºÃ°É£¬Ã»ÓÐÎÊÌ⣬Õâ¸ö¶ÔÓÚmakeÀ´ËµºÜÈÝÒ×£¬Ë½ÐËüÌṩÁË×Ô¶¯ÍƵ¼ÃüÁîºÍÎļþµÄ¹¦ÄÜ ÄØ£¿À´¿´¿´×îзç¸ñµÄmakefile°É¡£
objects = main.o kbd.o command.o display.o \
insert.o search.o files.o utils.o
edit : $(objects)
cc -o edit $(objects)
$(objects) : defs.h
kbd.o command.o files.o : command.h
display.o insert.o search.o files.o : buffer.h
.PHONY : clean
clean :
rm edit $(objects)
ÕâÖÖ·ç¸ñ£¬ÈÃÎÒÃǵÄmakefile±äµÃºÜ¼òµ¥£¬µ«ÎÒÃǵÄÎļþÒÀÀµ¹Øϵ¾ÍÏÔµÃÓеãÁèÂÒÁË¡£ÓãºÍÐÜÕƲ»¿É¼æµÃ¡£»¹¿´ÄãµÄϲºÃÁË¡£ÎÒÊDz»Ï²»¶ÕâÖÖ·ç¸ñµÄ£¬Ò»ÊÇÎļþµÄÒÀÀµ¹Øϵ¿´²»Çå³þ£¬¶þÊÇÈç¹ûÎļþÒ»¶à£¬Òª¼ÓÈ뼸¸öеÄ.oÎļþ£¬ÄǾÍÀí²»Çå³þÁË¡£
Æß¡¢Çå¿ÕÄ¿±êÎļþµÄ¹æÔò
ÿ¸öMakefileÖж¼Ó¦¸Ãдһ¸öÇå¿ÕÄ¿±êÎļþ£¨.oºÍÖ´ÐÐÎļþ£©µÄ¹æÔò£¬Õâ²»½ö±ãÓÚÖرàÒ룬ҲºÜÀûÓÚ±£³ÖÎļþµÄÇå½à¡£ÕâÊÇÒ»¸ö“ÐÞÑø”£¨ºÇºÇ£¬»¹¼ÇµÃÎҵġ¶±à³ÌÐÞÑø¡·Â𣩡£Ò»°ãµÄ·ç¸ñ¶¼ÊÇ£º
clean:
rm edit $(objects)
¸üΪÎȽ¡µÄ×ö·¨ÊÇ£º
.PHONY : clean
clean :
-rm edit $(objects)
Ç°Ãæ˵¹ý£¬.PHONYÒâ˼±íʾcleanÊÇÒ»¸ö“αĿ±ê” £¬¡£¶øÔÚrmÃüÁîÇ°Ãæ¼ÓÁËÒ»¸öС¼õºÅµÄÒâ˼¾ÍÊÇ£¬Ò²ÐíijЩÎļþ³öÏÖÎÊÌ⣬µ«²»Òª¹Ü£¬¼ÌÐø×öºóÃæµÄÊ ¡£µ±È»£¬cleanµÄ¹æÔò²»Òª·ÅÔÚÎļþµÄ¿ªÍ·£¬²»È»£¬Õâ¾Í»á±ä³ÉmakeµÄĬÈÏÄ¿±ê£¬ÏàÐÅËÒ²²»Ô¸ÒâÕâÑù¡£²»³ÉÎĵĹæ¾ØÊÇ——“clean´ÓÀ´¶¼ÊÇ·ÅÔÚÎļþµÄ×îºó ”¡£
ÉÏÃæ¾ÍÊÇÒ»¸ömakefileµÄ¸Åò£¬Ò²ÊÇmakefileµÄ»ù´¡£¬ÏÂÃ滹ÓкܶàmakefileµÄÏà¹Øϸ½Ú£¬×¼±¸ºÃÁËÂð£¿×¼±¸ºÃÁ˾ÍÀ´¡£
Makefile ×ÜÊö
———————
Ò»¡¢MakefileÀïÓÐʲô£¿
MakefileÀïÖ÷Òª°üº¬ÁËÎå¸ö¶«Î÷£ºÏÔʽ¹æÔò¡¢Òþ»Þ¹æÔò¡¢±äÁ¿¶¨Òå¡¢ÎļþָʾºÍ×¢ÊÍ¡£
1¡¢ÏÔʽ¹æÔò ¡£ÏÔʽ¹æÔò˵Ã÷ÁË£¬ÈçºÎÉú³ÉÒ»¸ö»ò¶àµÄµÄÄ¿±êÎļþ ¡£ÕâÊÇÓÉMakefileµÄÊéдÕßÃ÷ÏÔÖ¸³ö£¬ÒªÉú³ÉµÄÎļþ£¬ÎļþµÄÒÀÀµÎļþ£¬Éú³ÉµÄÃüÁî¡£
2¡¢Òþ»Þ¹æÔò ¡£ÓÉÓÚÎÒÃǵÄmakeÓÐ×Ô¶¯ÍƵ¼µÄ¹¦ÄÜ £¬ËùÒÔÒþ»ÞµÄ¹æÔò¿ÉÒÔÈÃÎÒÃDZȽϴֲڵؼòÂÔµØÊéдMakefile£¬ÕâÊÇÓÉmakeËù
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
µÚÒ»Õ ÒÆÖ²ÄÚºË
1.1 LinuxÄں˻ù´¡ÖªÊ¶
ÔÚ¶¯ÊÖ½øÐÐLinuxÄÚºËÒÆֲ֮ǰ£¬·Ç³£ÓбØÒª¶ÔLinuxÄں˽øÐÐÒ»¶¨µÄÁ˽⣬ÏÂÃæ´ÓLinuxÄں˵İ汾ºÍ·ÖÀà˵Æð¡£
1.1.1 Linux°æ±¾
LinuxÄں˵İ汾ºÅ¿ÉÒÔ´ÓÔ´´úÂëµÄ¶¥²ãĿ¼ÏµÄMakefileÖп´µ½£¬±ÈÈç2.6.29.1Äں˵ÄMakefileÖУº
VERSION = 2
PATCHLEVEL = 6
......
ÐÂÊÖÈëÃÅ£ºÇ³Ì¸LinuxµÄÎļþϵͳ
ØýÃû / 2008-09-18
Èç¹ûÄúÊÇһλÐÂÊÖ£¬Ò²Ðí Äú»¹²»ÖªµÀÈçºÎ°ÑÎļþ´ÓWindows¿½±´µ½LinuxÉÏ°É?ÏÂÃ棬ÎÒÃǽ«ËµÃ÷UnixÎļþϵͳÒÔ¼°mountµÄ¹¤×÷¹ý³Ì£¬È»ºóÔٱȽÏÏêϸµØÌÖÂÛ
¡¡¡¡mountµÄʹÓúÍÓйØÑ¡Ïî¡£Èç¹ûÄúÒѾÁ˽âUnixÎļþϵͳÊÇÈçºÎ¹¤×÷µÄ£¬ÄÇô¿ÉÒÔÌø¹ýÏÂÃæÒ»½Ú¡£·ñÔò£¬Äú×îº ......
LinuxÄں˲üôµÄ¾ßÌå²½Öè
ÔÚmenuconfigÖÐÅäÖãº
Ïêϸ½éÉÜÄÚºËÅäÖÃÑ¡Ïɾ¸ÄÇé¿ö
µÚÒ»²¿·Ö£ºÈ«²¿É¾³ý
Code maturity level options ---> ´úÂë³ÉÊìµÈ¼¶Ñ¡Ïî
[]Prompt for development and/or incomplete code/drivers ĬÈÏÇé¿öÏÂÊÇÑ¡ÔñµÄ£¬Õ⽫»áÔÚÉèÖýçÃæÖÐÏÔʾ»¹ÔÚ¿ª·¢»òÕß»¹Ã»ÓÐÍê³ÉµÄ´úÂëÓëÇý¶¯.²» ......
LinuxϵÄshellÓëmake
Ò»¡¢shell
1.1 ʲôÊÇshell
¡ñ Óû§ÓëLinuxµÄ½Ó¿Ú
¡ñ ÃüÁî½âÊÍÆ÷
¡ñ Ö§³Ö¶àÓû§
¡ñ Ö§³Ö¸´Ôӵıà³ÌÓïÑÔ
¡ñ ShellÓкܶàÖÖ£¬È磺csh,tcsh,pdksh,ash,sash,zsh,bashµÈ¡£LinuxµÄȱʡShellΪbash(Bourne Again Shell)¡£
ShellÊÇÓû§ºÍ²Ù×÷ϵͳ֮¼ä×îÖ÷Òª½Ó¿Ú¡£Í¨¹ýShell£¬¿ÉÒÔͬʱÔÚºǫ́ÔËÐжà¸öÓ ......