MODULES += UMDToday
all:
@for modules in $(MODULES); do \
make -C $$modules; \
cp -rf ./$$modules/release/* ./release; \
done;
clean:
@for modules in $(MODULES); do \
make clean -C $$modules; \
done;
2007年7月4日 星期三
set environment variable to the command
[will@localhost config]$ cat sendmail.sh
#!/bin/sh
LIST="a b c d e"
for list in $LIST; do\
cat /home/will/log.txt | LD_LIBRARY_PATH=/usr/local/lib /home/will/smtpsend $list > /dev/null 2>&1; \
done;
my indent coding style
[will@localhost config]$ cat indent.sh
# Will.20070509: linux coding style
dos2unix $*
indent -nbad -bap -nbc -bbo -br -bli2 -bls -ncdb -nce -cp1 -cs -di2 -ndj -nfc1 -nfca -hnl -i2 -ip5 -lp -pcs -psl -nsc -nsob -l100 $*
[will@localhost config]$
# Will.20070509: linux coding style
dos2unix $*
indent -nbad -bap -nbc -bbo -br -bli2 -bls -ncdb -nce -cp1 -cs -di2 -ndj -nfc1 -nfca -hnl -i2 -ip5 -lp -pcs -psl -nsc -nsob -l100 $*
[will@localhost config]$
use shared library during runtime
[will@localhost DynamicLibrary]$ cat dl.test.c
#include <dlfcn.h>
#include <stdio.h>
main ()
{
void *libc;
void (*printf_call) ();
if (libc = dlopen ("/lib/libc.so.6", RTLD_LAZY))
{
printf_call = dlsym (libc, "printf");
(*printf_call) ("hello, world\n");
}
dlclose (libc);
}
[will@localhost DynamicLibrary]$
Make Dynamic Shared Library
gcc -fPIC -c mylib.*.c
gcc -shared -Wl,-soname,libxxx.so -o libxxx.so *.o
gcc -shared -Wl,-soname,libxxx.so -o libxxx.so *.o
訂閱:
文章 (Atom)