hw7: initial HW7 commit

This commit is contained in:
2020-10-31 16:18:21 +03:00
parent fc22ddcd67
commit 78d3295f1f
3 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
GENERATES = preloader.so testfile testFIXfile
TRASH = *.o *~ o.*
all: lib test
lib:
gcc -g -fPIC -shared preloader.c -o preloader.so -ldl
test:
touch testfile
LD_PRELOAD="./preloader.so" rm testfile
[ ! -f testfile ]
touch testFIXfile
-LD_PRELOAD="./preloader.so" rm testFIXfile
[ -f testFIXfile ]
rm testFIXfile
clean:
rm -f $(TRASH)
distclean: clean
rm -rf $(GENERATES)