59 lines
2.1 KiB
Makefile
59 lines
2.1 KiB
Makefile
|
all:
|
|||
|
@echo "Usage: make <commande>"
|
|||
|
@echo ""
|
|||
|
@echo "Commandes disponibles:"
|
|||
|
@echo "- worm_inc : version modifi<66>e des programmes, avec insertion de detect_init()"
|
|||
|
@echo " et biblioth<74>que de d<>tection de pannes li<6C>e statiquement"
|
|||
|
@echo "- worm_shared : version modifi<66>e des programmes, avec insertion de detect_init()"
|
|||
|
@echo " et biblioth<74>que de d<>tection de pannes li<6C>e dynamiquement"
|
|||
|
@echo "- worm_preload: version non modifi<66>e des programmes, avec pr<70>chargement de la "
|
|||
|
@echo " biblioth<74>que de d<>tection de pannes, et execution de celle-ci."
|
|||
|
|
|||
|
worm_inc: clean server
|
|||
|
gcc -ggdb -o worms_mod libdetect.c worms_mod.c -lcurses -lrt -lpthread -Wall
|
|||
|
gcc -ggdb -o test_mod libdetect.c test_mod.c -lrt -lpthread -Wall
|
|||
|
@echo -e "\n* Pour executer, taper: "
|
|||
|
@echo -e "*\n* ./worms_mod"
|
|||
|
@echo -e "*\n* ou "
|
|||
|
@echo -e "*\n* ./test_mod\n*"
|
|||
|
|
|||
|
worm_shared: clean server
|
|||
|
gcc -fPIC -Wall -ggdb -c libdetect.c
|
|||
|
gcc -g -shared -Wl,-soname,libdetect.so.0 \
|
|||
|
-o libdetect.so.0.0 libdetect.o -lc
|
|||
|
/sbin/ldconfig -n .
|
|||
|
ln -sf libdetect.so.0 libdetect.so
|
|||
|
gcc -Wall -ggdb -o test_shr test_mod.c -L. -lrt -lpthread -ldetect
|
|||
|
gcc -Wall -ggdb -o worms_shr worms_mod.c -L. -lcurses -lrt -lpthread -ldetect
|
|||
|
@echo -e "\n* Pour executer, taper: "
|
|||
|
@echo -e "*\n* LD_LIBRARY_PATH="." ./worms_shr"
|
|||
|
@echo -e "*\n* ou "
|
|||
|
@echo -e "*\n* LD_LIBRARY_PATH="." ./test_shr\n*"
|
|||
|
|
|||
|
# run with:
|
|||
|
# LD_LIBRARY_PATH="." ./command
|
|||
|
|
|||
|
|
|||
|
worm_preload: clean server
|
|||
|
gcc -fPIC -Wall -ggdb -c libdetect.c -D_GYR_PRELOAD
|
|||
|
gcc -g -shared -Wl,-soname,libdetect.so.0 \
|
|||
|
-o libdetect.so.0.0 libdetect.o -lc
|
|||
|
/sbin/ldconfig -n .
|
|||
|
ln -sf libdetect.so.0 libdetect.so
|
|||
|
gcc -ggdb -o worms worms.c -lcurses -lrt -lpthread -Wall
|
|||
|
gcc -ggdb -o test test.c -lrt -lpthread -Wall
|
|||
|
@echo -e "\n* Pour executer, taper: "
|
|||
|
@echo -e "*\n* LD_LIBRARY_PATH="." LD_PRELOAD=libdetect.so ./worms"
|
|||
|
@echo -e "*\n* ou "
|
|||
|
@echo -e "*\n* LD_LIBRARY_PATH="." LD_PRELOAD=libdetect.so ./test\n*"
|
|||
|
|
|||
|
server:
|
|||
|
gcc -ggdb -o detector-server detector-server.c -Wall
|
|||
|
|
|||
|
clean:
|
|||
|
rm -f *.so*
|
|||
|
rm -f *.o
|
|||
|
rm -f detector-server
|
|||
|
rm -f test test_mod test_shr
|
|||
|
rm -f worms worms_mod worms_shr
|