#############################################################################

####### Compiler, tools and options

CXX	=	$(SYSCONF_CXX) $(QT_CXX_MT)
CXXFLAGS=	$(SYSCONF_CXXFLAGS_QT) $(SYSCONF_CXXFLAGS)
CC	=	$(SYSCONF_CC) $(QT_C_MT)
CFLAGS	=	$(SYSCONF_CFLAGS)
INCPATH =	
LFLAGS	=	$(SYSCONF_LFLAGS_QT) $(SYSCONF_RPATH_QT) $(SYSCONF_LFLAGS) $(QT_LFLAGS_MT)
LIBS	=	$(SUBLIBS) $(SYSCONF_LIBS_QT) $(SYSCONF_LIBS) $(SYSCONF_LIBS_QTAPP)
MOC	=	$(SYSCONF_MOC)
UIC	=	$(SYSCONF_UIC)

####### Target

DESTDIR = ./
VER_MAJ = 1
VER_MIN = 0
VER_PATCH = 0
TARGET	= networkprotocol
TARGET1 = lib$(TARGET).so.$(VER_MAJ)

####### Files

HEADERS =	nntp.h \
		http.h \
		view.h
SOURCES =	main.cpp \
		nntp.cpp \
		http.cpp \
		view.cpp
OBJECTS =	main.o \
		nntp.o \
		http.o \
		view.o
INTERFACES =    
UICDECLS =      
UICIMPLS =      
SRCMOC	=	moc_nntp.cpp \
		moc_http.cpp \
		moc_view.cpp
OBJMOC	=	moc_nntp.o \
		moc_http.o \
		moc_view.o


####### Implicit rules

.SUFFIXES: .cpp .cxx .cc .C .c

.cpp.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cxx.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cc.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.C.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.c.o:
	$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<

####### Build rules


all: $(DESTDIR)$(TARGET)

$(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS)
	$(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)

moc: $(SRCMOC)

tmake:
	tmake networkprotocol.pro

clean:
	-rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS)
	-rm -f *~ core
	-rm -f allmoc.cpp

####### Extension Modules

listpromodules:
	@echo 

listallmodules:
	@echo 

listaddonpromodules:
	@echo 

listaddonentmodules:
	@echo 


REQUIRES=network full-config

####### Sub-libraries


###### Combined headers



####### Compile

main.o: main.cpp \
		http.h \
		nntp.h \
		view.h

nntp.o: nntp.cpp \
		nntp.h

http.o: http.cpp \
		http.h

view.o: view.cpp \
		view.h

moc_nntp.o: moc_nntp.cpp \
		nntp.h

moc_http.o: moc_http.cpp \
		http.h

moc_view.o: moc_view.cpp \
		view.h

moc_nntp.cpp: nntp.h
	$(MOC) nntp.h -o moc_nntp.cpp

moc_http.cpp: http.h
	$(MOC) http.h -o moc_http.cpp

moc_view.cpp: view.h
	$(MOC) view.h -o moc_view.cpp


