Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

pro*c makefile ±àд

¸Ãmakefile Ö»ÊÇÔÚlinux ÖвâÊÔ¹ý£¬ Èô²ÉÓÃhu-ux Ö»ÒªÒÔÏÂmakefileÖеÄgcc ¸ÄΪaCC  µ«
hu-ux δ²âÊÔ
1¡¢Ê×ÏÈÈ·¶¨pro*c ¹¤³ÌĿ¼½á¹¹
proc/bin
proc/include
proc/lib
proc/src
        src/libsrc
        src/project_src
        .........
ÒÔÏÂmakefile Ïà¹ØÎļþ¶¼ÊÇ·ÅÔڵײãÎļþ¼ÐÏ£¬ÐèҪн¨Ô´´úÂëÎļþ¼ÐÇëÔÚsrc Îļþ¼ÐÏ´´½¨
¶ÔÓ¦µÄmakefile
PRJHOME=../..
.SUFFIXES:.c .pc .o
CC=gcc
CFLAG=-c
PROC=proc
PFLAG=mode=ansi
#PPOOL=cpool=yes
#PTHREAD=threads=yes
LIBDIR=-L${PRJHOME}/lib
INCLDIR=-I${PRJHOME}/include
ORA_INCL=-I${ORACLE_HOME}/precomp/public
ORA_LIB=-L${ORACLE_HOME}/lib -lclntsh
.c.o:
${CC} ${CFLAG} -o $@ $< ${INCLDIR}
.pc.o:
${PROC} ${PFLAG} $< include=${PRJHOME}/include
${CC} ${CFLAG} -o $@ ${<:.pc=.c} ${INCLDIR} ${ORA_INCL}
rm -f ${<:.pc=.c}
LIBS=
EXEC=${CC} -o $@ $^ ${INCLDIR} ${LIBDIR} ${LIBS} ${ORA_INCL} ${ORA_LIB};\
rm -f *.o \
rm -f tp?????? \
rm -f *.lis \
mv $@ ${PRJHOME}/bin;
BINS= ${LINE_NAME} \
all: $(BINS)
PC_SRC0= ${LINE_NAME}.pc
OBJ0=$(PC_SRC0:.pc=.o)
${LINE_NAME}:${OBJ0}
${EXEC}
clean:
rm -f *.o
rm -f tp??????
rm -f *.lis


¶ÔÓ¦µÄmakeproc
#!/bin/sh
if [ $# == 1 ] && [ $1 == 'clean' ]
then
rm -f *.c
rm -f tp??????
rm -f *.lis
rm -f *.o
exit 0
fi
typeset -i A=0 B=0
if [ $# != 0 ]
then
for i in `echo $@`
do
LINE_NAME=$i
export LINE_NAME
make >>log_make.log
if [ $? = 0 ]
then
A=A+1
echo -e "[`date '+%Y-%m-%d %T'`][$LINE_NAME]:±àÒë³É¹¦"
else
B=B+1
echo -e "[`date '+%Y-%m-%d %T'`][$LINE_NAME]:±àÒëʧ°Ü"
fi
done
else
while read LINE
do
LINE_NAME=$LINE
if [ -z ${LINE_NAME} ]
then
continue
fi
if [ `echo ${LINE_NAME:0:1}` == '#' ]
then
continue
fi
export LINE_NAME
make >>log_make.log
if [ $? = 0 ]
then
A=A+1
echo -e "[`date '+%Y-%m-%d %T'`][$LINE_NAME]:±àÒë³É¹¦"
else
B=B+1
echo -e "[`date '+%Y-%m-%d %T'`][$LINE_NAME]:±àÒëʧ°Ü"


Ïà¹ØÎĵµ£º

C/C++ static µÄ×÷ÓÃ

ת×Ô£ºhttp://blog.csdn.net/xiaocai0001/archive/2006/04/14/662921.aspx
static¹Ø¼ü×ÖÊÇC, C++Öж¼´æÔڵĹؼü×Ö, ËüÖ÷ÒªÓÐÈýÖÖʹÓ÷½Ê½, ÆäÖÐÇ°Á½ÖÖÔÚC/C++ÓïÑÔÖÐʹÓÃ, µÚÈýÖÖÖ»ÔÚC++ÖÐʹÓÃ(C,C++ÖоßÌåϸ΢²Ù×÷²»¾¡Ïàͬ, ±¾ÎÄÒÔC++Ϊ׼).
(1)¾Ö²¿¾²Ì¬±äÁ¿
(2)Íⲿ¾²Ì¬±äÁ¿/º¯Êý
(3)¾²Ì¬Êý¾Ý³ÉÔ±/³ÉÔ±º¯Êý
ÏÂÃæ¾ÍÕâÈ ......

organizing code files in C & C++

http://www.gamedev.net/reference/programming/features/orgfiles/page2.asp
ͨ¹ýËĸöpitfall½²½âÍ·ÎļþµÄÓÉÀ´ºÍºÃ´¦£¬ÒÔ¼°Ê¹ÓÃÍ·Îļþ¶¨Òåinline func and template.
Remember that, as far as the compiler is concerned, there is absolutely no difference between a header file and a source file.
The key idea ......

C's egg pain

1.ÊäÈëÒ»¶Î×Öĸ¼ÓÊý×ֵľä×Ó£¬È»ºóÊä³öÆäÖÐÓм¸×éÊý×Ö£¬²¢ÇÒÊä³ö¸÷×éÊý×Ö£¬²¢¶ÔÆäÇóƽ¾ùÖµ£¨È¡Õû¼´¿É£©
#include<stdio.h>
#include<math.h>
int main()
{
int i,x=0,t=0,n=0,p=0;
char a[90]={0};
scanf("%s",a);
printf("Found:");
for(i=0;i<90;i++)
{
if(a[i]&g ......

ÉîÈëÈÏʶTurbo C±àÒëÆ÷[ת]

1 ±àÒëÆ÷ ÓÐË­ÕæÕýµÄÀí½â¹ýÒ»¸ö±àÒëÆ÷ÄØ£¿Ðí¶àÈËÈÏΪTCºÜ¼òµ¥ºÜÂäºó£¬µ«ÊǼ´±ãÊÇÕâÑù¼òµ¥µÄ¹¤¾ß£¬µ½µ×Óм¸¸öÈËÕæÕýµÄÉîÈëÀí½âÁËÄØ£¿Ò»¸ö¼òµ¥µÄ±àÒëÆ÷¶¼²»ÄÜÀí½â£¬ÈçºÎÄܳÉΪ¸ßÊÖ£¬ÈçºÎÄÜÉîÈëµÄʹÓøü¼Ó¸ß¼¶µÄ¹¤¾ßÄØ£¿²»ÒªÒÔΪ×Ô¼ºÊ¹ÓõÄÊÇVC¾ÍºÜÁ˲»Æð£¬ÒòΪʹÓÃÕâÑùɵ¹Ï»¯µÄ¹¤¾ßÖ»ÄÜÈÃÄã¿´²»µ½ÊÂÎïµÄ±¾ÖÊ¡£½ÓÏÂÀ´ÎÒÃǾÍÀ´ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ