tar -xvf foo.tar, tar -xzvf foo.tar.gz
#libxml2 and glibmm are not neccessary to compile the main.cpp
#macro
libxml2:=../../libxml2
libxml++:=..
glibmm:=../../glibmm
#adds include directives
CC:=g++
CCINCLUDE:= -I$(libxml++)/include/libxml++-2.6 -I$(libxml++)/lib/libxml++-2.6/include "
-I$(libxml2)/include -I$(glibmm)/include
#linking
LD:=g++
LDSTDLIBS:= -L$(libxml++)/lib -L$(libxml2)/lib -L$(glibmm)/lib
LDLIBS:= -lxml++-2.6
LDLIBFLAGS:= -shared $(LDLIBS) $(LDSTDLIBS)
LDEXEFLAGS:= $(LDSTDLIBS) $(LDLIBS)
#extending library path
#export VAR:=... means make it effective in the subprocess(Makefile)
#export LD_LIBRARY_PATH:=... doesn't work because it's only effective in the subprocesses, not parentprocess(shell)
#therefore the LD_RUN_PATH which allocates dynamic libs to the exe file must be set and export to take effect in the ld cmd
LD_LIBRARY_PATH:=$(libxml++)/lib:$(LD_LIBRARY_PATH)
export LD_RUN_PATH:=$(LD_LIBRARY_PATH)
#list of source files for building the target
SRC:= main.cpp
OBJ:=$(patsubst %.cpp,%.o,$(filter %.cpp,$(SRC)))
#targets
# $^ everyone behinds the : , and $< first one behinds the :
# $(OBJ): %.o: %.cpp is another common implicit rule is for the construction of .o files out of .cpp
.PHONY: all clean
all: $(OBJ)
$(LD) $(LDEXEFLAGS) $^ -o $@
$(OBJ): %.o: %.cpp
$(CC) $(CCINCLUDE) -c $< -o $@
clean:
rm -f $(OBJ) all *~ \.*.swp
1) 文件的最大权限rwx rwx rwx (777)
2 ) u m a s k值为0 2 2 - - - -w- -w-
3) 目录权限rwx r-x r-x (755) 这就是目录创建缺省权限
4) 文件权限rw- r-- r-- (644) 这就是文件创建缺省权限
>gdb ./sysprocess
(gdb)set args -id 0 -taskcfg ub900proc
(gdb)r //run
Starting program: ../sysprocess -id 0 -taskcfg ub900proc
..
Program received signal SIGSEGV, Segmentation fault.
(gdb)backtrace //打印当前的函数调用栈的所有信息。
(gdb)frame 7 //查看信息,n是一个从0开始的整数,是栈中的层编号
(gdb)up
(gdb)down
(gdb)quit