Replaced top-level Makefile with a qmake .pro so the top-level Makefile is also generated now; having a top-level .pro makes it easier for folks who use Qt Creator. Also 'make install' is now supported - a custom install path prefix can be provided, if required, by passing PREFIX=/absolute/path/prefix to qmake

This commit is contained in:
Srivats P. 2010-06-03 20:52:49 +05:30
parent 4cba17e6c8
commit 4d83432a5d
6 changed files with 19 additions and 31 deletions

View File

@ -11,7 +11,7 @@ moc_*.cpp
qrc_*.cpp
# QMake generated files
*\Makefile*
Makefile*
*\object_script.*
# protobuf generated files

View File

@ -1,30 +0,0 @@
debug: QMAKE_CONFIG=-config debug
release: QMAKE_CONFIG=-config release
all:
$(MAKE) -C rpc
$(MAKE) -C common
$(MAKE) -C server
$(MAKE) -C client
release: qmake all
debug: qmake all
clean:
-$(MAKE) -C client $@
-$(MAKE) -C server $@
-$(MAKE) -C common $@
-$(MAKE) -C rpc $@
distclean:
-$(MAKE) -C client $@
-$(MAKE) -C server $@
-$(MAKE) -C common $@
-$(MAKE) -C rpc $@
qmake:
cd rpc && qmake $(QMAKE_CONFIG) && cd ..
cd common && qmake $(QMAKE_CONFIG) && cd ..
cd server && qmake $(QMAKE_CONFIG) && cd ..
cd client && qmake $(QMAKE_CONFIG) && cd ..

View File

@ -75,6 +75,7 @@ SOURCES += \
QMAKE_DISTCLEAN += object_script.*
include(../install.pri)
include(../version.pri)
# TODO(LOW): Test only

9
install.pri Normal file
View File

@ -0,0 +1,9 @@
# A custom install path prefix can be provided by passing PREFIX=/absolute/path
# to qmake; if one is not provided, we use the below defaults -
isEmpty(PREFIX) {
unix:PREFIX = "/usr/local/"
win32:PREFIX = "../"
}
target.path = $$PREFIX/bin
INSTALLS += target

7
ost.pro Normal file
View File

@ -0,0 +1,7 @@
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS = \
rpc/pbrpc.pro \
common/ostproto.pro \
server/drone.pro \
client/ostinato.pro

View File

@ -40,4 +40,5 @@ SOURCES += pcapextra.cpp
QMAKE_DISTCLEAN += object_script.*
include (../install.pri)
include (../version.pri)