LinuxÖ®Makefile (¶þ)
¾Å¡¢Ä£Ê½±äÁ¿
ÔÚGNUµÄmakeÖУ¬»¹Ö§³Öģʽ±äÁ¿£¨Pattern-specific Variable£©£¬Í¨¹ýÉÏÃæµÄÄ¿±ê±äÁ¿ÖУ¬ÎÒÃÇÖªµÀ£¬±äÁ¿¿ÉÒÔ¶¨ÒåÔÚij¸öÄ¿±êÉÏ¡£Ä£Ê½±äÁ¿µÄºÃ´¦¾ÍÊÇ£¬ÎÒÃÇ¿ÉÒÔ¸ø¶¨Ò»Ö֓ģʽ”£¬¿ÉÒ԰ѱäÁ¿¶¨ÒåÔÚ·ûºÏÕâÖÖģʽµÄËùÓÐÄ¿±êÉÏ¡£
ÎÒÃÇÖªµÀ£¬makeµÄ“ģʽ”Ò»°ãÊÇÖÁÉÙº¬ÓÐÒ»¸ö“%”µÄ£¬ËùÒÔ£¬ÎÒÃÇ¿ÉÒÔÒÔÈçÏ·½Ê½¸øËùÓÐÒÔ[.o]½áβµÄÄ¿±ê¶¨ÒåÄ¿±ê±äÁ¿£º
%.o : CFLAGS = -O
ͬÑù£¬Ä£Ê½±äÁ¿µÄÓï·¨ºÍ“Ä¿±ê±äÁ¿”Ò»Ñù£º
<pattern ...>; : <variable-assignment>;
<pattern ...>; : override <variable-assignment>;
overrideͬÑùÊÇÕë¶ÔÓÚϵͳ»·¾³´«ÈëµÄ±äÁ¿£¬»òÊÇmakeÃüÁîÐÐÖ¸¶¨µÄ±äÁ¿¡£
ʹÓÃÌõ¼þÅжÏ
——————
ʹÓÃÌõ¼þÅжϣ¬¿ÉÒÔÈÃmake¸ù¾ÝÔËÐÐʱµÄ²»Í¬Çé¿öÑ¡Ôñ²»Í¬µÄÖ´ÐзÖÖ§¡£Ìõ¼þ±í´ïʽ¿ÉÒÔÊDZȽϱäÁ¿µÄÖµ£¬»òÊDZȽϱäÁ¿ºÍ³£Á¿µÄÖµ¡£
Ò»¡¢Ê¾Àý
ÏÂÃæµÄÀý×Ó£¬ÅжÏ$(CC)±äÁ¿ÊÇ·ñ“gcc”£¬Èç¹ûÊǵĻ°£¬ÔòʹÓÃGNUº¯Êý±àÒëÄ¿±ê¡£
libs_for_gcc = -lgnu
normal_libs =
foo: $(objects)
ifeq ($(CC),gcc)
$(CC) -o foo $(objects) $(libs_for_gcc)
else
$(CC) -o foo $(objects) $(normal_libs)
endif
¿É¼û£¬ÔÚÉÏÃæʾÀýµÄÕâ¸ö¹æÔòÖУ¬Ä¿±ê“foo”¿ÉÒÔ¸ù¾Ý±äÁ¿“$(CC)”ÖµÀ´Ñ¡È¡²»Í¬µÄº¯Êý¿âÀ´±àÒë³ÌÐò¡£
ÎÒÃÇ¿ÉÒÔ´ÓÉÏÃæµÄʾÀýÖп´µ½Èý¸ö¹Ø¼ü×Ö£ºifeq¡¢elseºÍendif¡£ifeqµÄÒâ˼±íʾÌõ¼þÓï¾äµÄ¿ªÊ¼£¬²¢Ö¸¶¨Ò»¸öÌõ¼þ±í´ïʽ£¬±í´ïʽ°üº¬Á½¸ö²ÎÊý£¬ÒÔ¶ººÅ·Ö¸ô£¬±í´ïʽÒÔÔ²À¨ºÅÀ¨Æð¡£else±íʾÌõ¼þ±í´ïʽΪ¼ÙµÄÇé¿ö¡£endif±íʾһ¸öÌõ¼þÓï¾äµÄ½áÊø£¬ÈκÎÒ»¸öÌõ¼þ±í´ïʽ¶¼Ó¦¸ÃÒÔendif½áÊø¡£
µ±ÎÒÃǵıäÁ¿$(CC)ÖµÊÇ“gcc”ʱ£¬Ä¿±êfooµÄ¹æÔòÊÇ£º
foo: $(objects)
$(CC) -o foo $(objects) $(libs_for_gcc)
¶øµ±ÎÒÃǵıäÁ¿$(CC)Öµ²
Ïà¹ØÎĵµ£º
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
linuxÇý¶¯ ×ÔÐýËøµÄÔËÓÃ
//hello.c
#define __NO_VERSION__
#include <linux/module.h>
#include <linux/config.h>
#include <linux/version.h>
#include <asm/uaccess.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#inc ......
1¡¢ µ±°ÑÏîÄ¿ÅäÉÏÓòÃûʱ£¬±ØÐë°ÑtomcatµÄ¶Ë¿Ú¸ÄΪ80£¬×¢Òâµ±Ìæ»»ÅäÖÃÎļþʱ£¬Òª¼ÇµÃ°Ñtomcat¶Ë¿Ú¸Äһϡ£
2¡¢ CÅÌϵÄhostsÎļþ£¬ÊÇÅäÖÃÓòÃûÓõģ¬µ±²»ÔÚhostsÅäÖÃÓòÃûʱ£¬windowsϵͳ»áµ½ÍâÍøÈ¥ÕÒ·ûºÏµÄÓòÃû£¬µ±ÔÚhostsÏÂÅäÖÃÓòÃûʱ£¬¾Í²»»áµ½ÍâÍøÈ¥ÕÒÁË¡£
3¡¢ Îļþ¸üеÄÕû¸öÁ÷³Ì£º
£¨1£©£ºÓÃÔ¶³ ......