
#What you want to use are shared libraries in Un*x/Linux land, probably,
#like /lib/libc.so ... (so = shared object)

#gcc -fPIC -O2 -c file1.c
#gcc -fPIC -O2 -c file2.c
#...
#gcc -shared -Wl,-soname,libXY.so.1 -o libXY.so.1.0 file1.o file2.o ...
#ln -s libXY.so.1.0 libXY.so.1
#ln -s libXY.so.1 libXY.so

#Linking to library:
#gcc -o executable -L/path/to/lib -lXY exec1.o exec2.o ...

# Needs GNU Make  3.74
# 
#
# Find all .h files in directory -> this will be the target moc files 
# No dependencies

MOC=moc
CC=g++
CFLAGS=-fPIC -O2

LIBNAME=libtcp.so.0.0

INCLUDE=-I/usr/local/kde/include

HEADER  =$(wildcard *.h)
MOC_OBJ	=$(patsubst %.h,%.moc,$(wildcard *.h))
OBJS	=$(patsubst %.cpp,%.o,$(wildcard *.cpp))


#all:	$(MOC_OBJ) $(OBJS)
all:	$(OBJS) 
	make kzilla.search.slave
install:
	cp kzilla.search.slave $(KDEDIR)/bin
# Compile all .h files to moc-files
$(MOC_OBJ): %.moc:%.h
	 $(MOC) -i $< -o $@

# Compile all *.cpp 
$(OBJS): %.o:%.cpp
	$(CC) $(CFLAGS) $(INCLUDE) -c $<

clean:
	rm -f *.moc
	rm -f *.o
	rm -f *~
	rm -f kzilla.search.slave

kzilla.search.slave:  kzilla.search.slave.cpp supportlib.cpp
	gcc -o kzilla.search.slave *.o
dofork:
	gcc -o fork fork.o
