CFLAGS=-Wall  -g
CXXFLAGS=-Wall -g

all: libfakeroot.so.0.0 fakeroot 

debug: all fakedebug clean_msg semtest get send

send.o: fakeroot.h send.c

get.o: fakeroot.h get.c

fakedebug: fakedebug.o libfakeroot.so
	gcc -g -o fakedebug fakedebug.o -L. -lfakeroot

libfakeroot.o: libfakeroot.c fakeroot.h
	gcc -D_REENTRANT -g $(CFLAGS) -c -o libfakeroot.o -fPIC libfakeroot.c

libfakeroot.so.0.0:libfakeroot.o fakeroot.h
	gcc -g -shared -Wl,-soname,libfakeroot.so.0 -o libfakeroot.so.0.0 libfakeroot.o -ldl -lc

libfakeroot.so: libfakeroot.so.0.0
	ln -s libfakeroot.so.0.0 libfakeroot.so 


fakeroot.o: fakeroot.cc fakeroot.h

fakeroot:fakeroot.o
	g++ -g -o fakeroot fakeroot.o -lstdc++

test   : 
	make -C test

clean  : 
	rm -rf *.o fakeroot libfakeroot.so.0.0 2 core get semtest hoi clean_msg fakedebug libfakeroot.so* send 
	make -C test clean



