owlps/owlps-positioner/Makefile

403 lines
10 KiB
Makefile
Raw Normal View History

include ../common.mk
# Directories & files
SRC_DIR = src
OBJ_DIR = obj
TESTS_DIR = tests
DOXYGEN_DIR = doc
DOXYFILE = Doxyfile
2010-02-11 10:37:15 +01:00
# Other tools
STYLE = astyle --style=gnu --indent=spaces=2 --formatted
CPPCHECK = cppcheck --quiet --enable=all
DOXYGEN = OWLPS_VERSION=$(OWLPS_VERSION) doxygen >/dev/null
Reconstitution du dépôt, étape 5 (et dernière) Le commentaire de révision initial figure ci-dessous. Les différences par rapport à ce commit sont : - Dans code/infrastructure-centred/owlps-client/ : importation des modifs de Julien dans la dernière version du client (Julien avait utilisé comme base une ancienne version). - Dans code/infrastructure-centred/owlps-listener/ : idem. - Dans code/owlps-positioning/ : ° Suppression de client (déplacé dans les archives). ° Makefile : ajout d'une pseudo-cible .PHONY. - code/writeInDb/ : ° Le binaire n'est pas versionné. ° Application de astyle --style=gnu. | r93 | jgraeffly | 2009-05-27 14:51:40 +0200 (mer 27 mai 2009) | 23 lines | Chemins modifiés : | R /code/infrastructure-centred/owlps-aggregator/owlps-aggregator.h | R /code/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c | R /code/infrastructure-centred/owlps-client/owlps-client.c | R /code/infrastructure-centred/owlps-listener/owlps-listener.h | R /code/infrastructure-centred/owlps-listener/owlps-listenerd.c | R /code/libowlps/owlps.h | R /code/owlps-positioning/Makefile | D /code/owlps-positioning/client | A /code/owlps-positioning/libowlps-positioning.cc | A /code/owlps-positioning/libowlps-positioning.hh | R /code/owlps-positioning/owlps-positioning.cc | A /code/owlps-positioning/owlps-positioning.cfg | R /code/owlps-positioning/owlps-positioning.hh | R /code/owlps-positioning/positioning.cc | R /code/owlps-positioning/positioning.hh | R /code/owlps-positioning/server.cc | R /code/owlps-positioning/server.hh | R /code/owlps-positioning/treatment.cc | R /code/owlps-positioning/treatment.hh | A /code/writeInDb | A /code/writeInDb/writeindb | A /code/writeInDb/writeindb.cc | A /code/writeInDb/writeindb.hh | | - Mise à jour du positioner : | Prise en charge de la BdD pour utilisation ainsi que pour la | sauvegarde des résultats | Envoi du résultat au client | Prise en compte du fichier de configuration ainsi que des | lignes de commande avec la library boost | | - Mise à jour de l'aggregator : | Pris en compte de la BdD pour la sauvegarde des requetes de | calibration ou de localisation | Envoi des demandes de localisation uniquement vers le | positioner | Ajout des options utilisables en ligne de commande et dans le | fichier de conf | | - Mise à jour du listener : | Ajout de l'envoi de l'adresse IP du mobile | | - Mise à jour du mobile : | Ajout de la socket de récupération de la réponse du serveur la | réponse est sous forme de 3 float (x, y, z) et non d'un Point. | | - Mise à jour de owlps.h : | Ajout des ports par défaut du positioner ainsi que du mobile. | | - Ajout de writeInDb : | Programme permettant de mettre les données contenu dans un | fichier dans la BdD git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@94 785a6c6c-259e-4ff1-8b91-dc31627914f0
2009-05-29 17:02:20 +02:00
# Flags for the tests
TESTSCXXFLAGS = -I$(TESTS_DIR) -I$(SRC_DIR) -I.
## Additional libraries ##
LDFLAGS += -lstdc++ -lm -lboost_program_options -pthread -lowlps
2012-01-25 15:42:40 +01:00
ifeq "$(OS)" "Linux"
LDFLAGS += -lrt
endif
ifeq "$(OS)" "GNU/kFreeBSD"
LDFLAGS += -lrt
endif
TARGET = owlps-positionerd
OBJ_TARGET = $(OBJ_DIR)/$(TARGET).o
SOURCE_TARGET = $(SRC_DIR)/$(TARGET).cc
OBJ_LIST = \
posutil.o \
autocalibration.o \
stock.o \
timestamp.o \
direction.o \
point3d.o \
referencepoint.o \
waypoint.o \
building.o \
area.o \
wifidevice.o \
accesspoint.o \
mobile.o \
measurement.o \
request.o \
calibrationrequest.o \
resultlist.o \
2010-03-03 16:06:41 +01:00
result.o \
minmax.o \
interlinknetworks.o \
fbcm.o \
frbhmbasic.o \
nss.o \
realposition.o \
configuration.o \
userinterface.o \
inputdatareader.o \
accesspointsreadercsv.o \
mobilesreadercsv.o \
topologyreadercsv.o \
textfilereader.o \
csvfilereader.o \
textfilewriter.o \
output.o \
outputterminal.o \
outputcsv.o \
outputudpsocket.o \
2011-07-14 22:07:48 +02:00
outputtcpsocketevaal.o \
positioning.o \
input.o \
inputcsv.o \
inputudpsocket.o \
inputlogcsv.o
OBJ_NOTEST_LIST = \
posexcept.o \
trilaterationalgorithm.o \
cartographyalgorithm.o \
outputnetworksocket.o \
inputmedium.o
INTERFACES_LIST = \
inputlogmedium.hh \
outputmedium.hh \
trilaterationmethod.hh \
positioningalgorithm.hh
OBJ = $(OBJ_LIST:%=$(OBJ_DIR)/%)
OBJ_NOTEST = $(OBJ_NOTEST_LIST:%=$(OBJ_DIR)/%)
INTERFACES = $(INTERFACES_LIST:%=$(SRC_DIR)/%)
SOURCE = \
$(OBJ:$(OBJ_DIR)/%.o=$(SRC_DIR)/%.hh) \
$(OBJ:$(OBJ_DIR)/%.o=$(SRC_DIR)/%.cc) \
$(OBJ_NOTEST:$(OBJ_DIR)/%.o=$(SRC_DIR)/%.hh) \
$(OBJ_NOTEST:$(OBJ_DIR)/%.o=$(SRC_DIR)/%.cc) \
$(INTERFACES)
TESTS_XX = $(TESTS_DIR)/tests.cc
TESTS_OBJ = $(TESTS_DIR)/tests.o
TESTS_TARGET = $(TESTS_DIR)/tests
TESTUTIL_OBJ = $(TESTS_DIR)/testutil.o
TESTSETUP_OBJ = $(TESTS_DIR)/testsetup.o
SOURCE_TESTS = $(OBJ:$(OBJ_DIR)/%.o=$(TESTS_DIR)/%_test.hh)
OBJ_TESTS = $(TESTUTIL_OBJ) $(TESTSETUP_OBJ)
INCLUDES_TESTS = $(TESTS_DIR)/valuetraits.hh
dynamic: $(TARGET)
static: $(TARGET).static
all: dynamic static
2010-02-11 10:37:15 +01:00
# Generic targets
$(TESTS_DIR)/%.o: $(TESTS_DIR)/%.cc $(TESTS_DIR)/%.hh
$(CXX) $(CXXFLAGS) $(TESTSCXXFLAGS) -o $@ -c $<
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cc $(SRC_DIR)/%.hh
$(MKDIR) $(OBJ_DIR) && $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $<
%: $(OBJ_DIR)/%.o
$(CXX) $(STRIPFLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
%.static: $(OBJ_DIR)/%.o
$(CXX) $(STRIPFLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -static
$(STRIP) $@
2010-02-11 10:37:15 +01:00
# Dependencies
$(OBJ_DIR)/autocalibration.o: \
$(OBJ_DIR)/stock.o \
$(OBJ_DIR)/configuration.o \
$(OBJ_DIR)/posexcept.o
$(OBJ_DIR)/point3d.o: \
2011-07-13 15:00:54 +02:00
$(OBJ_DIR)/posutil.o \
$(OBJ_DIR)/posexcept.o
$(OBJ_DIR)/posutil.o: \
$(OBJ_DIR)/stock.o \
$(OBJ_DIR)/posexcept.o
$(OBJ_DIR)/owlps-positionerd.o: \
$(OBJ_DIR)/posexcept.o
$(OBJ_DIR)/owlps-positionerd.o: \
$(OBJ_DIR)/userinterface.o \
$(OBJ_DIR)/inputdatareader.o \
$(OBJ_DIR)/stock.o \
$(OBJ_DIR)/positioning.o
$(OBJ_DIR)/userinterface.o: \
$(OBJ_DIR)/configuration.o
$(OBJ_DIR)/inputdatareader.o: \
$(OBJ_DIR)/accesspointsreadercsv.o \
$(OBJ_DIR)/mobilesreadercsv.o \
$(OBJ_DIR)/topologyreadercsv.o \
$(OBJ_DIR)/configuration.o \
$(OBJ_DIR)/posexcept.o
$(OBJ_DIR)/accesspointsreadercsv.o: \
$(OBJ_DIR)/csvfilereader.o \
$(OBJ_DIR)/accesspoint.o \
$(OBJ_DIR)/stock.o
$(OBJ_DIR)/mobilesreadercsv.o: \
$(OBJ_DIR)/csvfilereader.o \
$(OBJ_DIR)/mobile.o \
$(OBJ_DIR)/stock.o
$(OBJ_DIR)/topologyreadercsv.o: \
$(OBJ_DIR)/csvfilereader.o \
$(OBJ_DIR)/area.o \
$(OBJ_DIR)/waypoint.o \
$(OBJ_DIR)/stock.o
$(OBJ_DIR)/referencepoint.o: \
$(OBJ_DIR)/point3d.o \
$(OBJ_DIR)/measurement.o \
$(OBJ_DIR)/stock.o
$(OBJ_DIR)/waypoint.o: \
$(OBJ_DIR)/point3d.o \
$(OBJ_DIR)/building.o
$(OBJ_DIR)/area.o: \
$(OBJ_DIR)/building.o \
$(OBJ_DIR)/point3d.o
$(OBJ_DIR)/wifidevice.o: \
$(OBJ_DIR)/posutil.o
$(OBJ_DIR)/accesspoint.o: \
$(OBJ_DIR)/wifidevice.o \
$(OBJ_DIR)/posutil.o \
$(OBJ_DIR)/point3d.o
$(OBJ_DIR)/mobile.o: \
$(OBJ_DIR)/wifidevice.o
$(OBJ_DIR)/measurement.o: \
$(OBJ_DIR)/accesspoint.o \
$(OBJ_DIR)/posexcept.o
$(OBJ_DIR)/request.o: \
$(OBJ_DIR)/timestamp.o \
$(OBJ_DIR)/measurement.o
$(OBJ_DIR)/calibrationrequest.o: \
$(OBJ_DIR)/request.o \
$(OBJ_DIR)/referencepoint.o \
$(OBJ_DIR)/direction.o
$(OBJ_DIR)/result.o: \
$(OBJ_DIR)/stock.o \
$(OBJ_DIR)/configuration.o \
$(OBJ_DIR)/area.o \
$(OBJ_DIR)/request.o
$(OBJ_DIR)/resultlist.o: \
$(OBJ_DIR)/result.o
$(OBJ_DIR)/textfilereader.o: \
$(OBJ_DIR)/posexcept.o
$(OBJ_DIR)/csvfilereader.o: \
$(OBJ_DIR)/textfilereader.o
$(OBJ_DIR)/textfilewriter.o: \
$(OBJ_DIR)/posexcept.o
$(OBJ_DIR)/inputmedium.o: \
$(OBJ_DIR)/calibrationrequest.o \
$(OBJ_DIR)/posexcept.o \
$(OBJ_DIR)/configuration.o \
$(OBJ_DIR)/stock.o
$(OBJ_DIR)/inputcsv.o: \
$(OBJ_DIR)/inputmedium.o \
$(OBJ_DIR)/csvfilereader.o \
$(OBJ_DIR)/request.o \
$(OBJ_DIR)/calibrationrequest.o \
$(OBJ_DIR)/configuration.o \
$(OBJ_DIR)/stock.o
$(OBJ_DIR)/inputudpsocket.o: \
$(OBJ_DIR)/inputmedium.o \
$(OBJ_DIR)/posexcept.o \
$(OBJ_DIR)/request.o \
$(OBJ_DIR)/calibrationrequest.o \
$(OBJ_DIR)/configuration.o \
$(OBJ_DIR)/stock.o
$(OBJ_DIR)/inputlogcsv.o: \
2010-03-03 16:06:41 +01:00
$(SRC_DIR)/inputlogmedium.hh \
$(OBJ_DIR)/request.o
$(OBJ_DIR)/input.o: \
$(OBJ_DIR)/inputcsv.o \
$(OBJ_DIR)/inputudpsocket.o \
$(OBJ_DIR)/inputlogcsv.o \
$(OBJ_DIR)/calibrationrequest.o \
$(OBJ_DIR)/configuration.o \
$(OBJ_DIR)/posexcept.o \
$(OBJ_DIR)/stock.o
$(OBJ_DIR)/outputterminal.o: \
$(SRC_DIR)/outputmedium.hh \
$(OBJ_DIR)/resultlist.o \
$(OBJ_DIR)/result.o
$(OBJ_DIR)/outputcsv.o: \
$(SRC_DIR)/outputmedium.hh \
$(OBJ_DIR)/textfilewriter.o \
$(OBJ_DIR)/resultlist.o \
$(OBJ_DIR)/result.o
$(OBJ_DIR)/outputnetworksocket.o: \
$(SRC_DIR)/outputmedium.hh \
$(OBJ_DIR)/resultlist.o \
$(OBJ_DIR)/result.o
$(OBJ_DIR)/outputudpsocket.o: \
$(OBJ_DIR)/outputnetworksocket.o \
$(OBJ_DIR)/request.o \
$(OBJ_DIR)/resultlist.o \
$(OBJ_DIR)/result.o \
$(OBJ_DIR)/posexcept.o
2011-07-14 22:07:48 +02:00
$(OBJ_DIR)/outputtcpsocketevaal.o: \
$(OBJ_DIR)/outputnetworksocket.o \
$(OBJ_DIR)/request.o \
$(OBJ_DIR)/resultlist.o \
$(OBJ_DIR)/result.o \
$(OBJ_DIR)/area.o \
$(OBJ_DIR)/posexcept.o \
$(OBJ_DIR)/stock.o
2011-03-15 15:27:42 +01:00
$(OBJ_DIR)/outputcsv.o: \
$(SRC_DIR)/outputmedium.hh \
$(OBJ_DIR)/result.o
$(OBJ_DIR)/output.o: \
$(OBJ_DIR)/outputterminal.o \
$(OBJ_DIR)/outputcsv.o \
$(OBJ_DIR)/outputudpsocket.o \
2011-07-14 22:07:48 +02:00
$(OBJ_DIR)/outputtcpsocketevaal.o \
$(OBJ_DIR)/configuration.o \
$(OBJ_DIR)/posexcept.o
$(OBJ_DIR)/trilaterationalgorithm.o: \
$(SRC_DIR)/positioningalgorithm.hh \
$(OBJ_DIR)/minmax.o \
$(OBJ_DIR)/mobile.o \
$(OBJ_DIR)/configuration.o \
$(OBJ_DIR)/posexcept.o
$(OBJ_DIR)/cartographyalgorithm.o: \
$(SRC_DIR)/positioningalgorithm.hh \
$(OBJ_DIR)/referencepoint.o
$(OBJ_DIR)/minmax.o: \
$(SRC_DIR)/trilaterationmethod.hh \
$(OBJ_DIR)/point3d.o \
$(OBJ_DIR)/accesspoint.o
$(OBJ_DIR)/interlinknetworks.o: \
$(OBJ_DIR)/trilaterationalgorithm.o
$(OBJ_DIR)/fbcm.o: \
$(OBJ_DIR)/trilaterationalgorithm.o \
$(OBJ_DIR)/configuration.o \
$(OBJ_DIR)/stock.o
$(OBJ_DIR)/frbhmbasic.o: \
$(OBJ_DIR)/nss.o \
$(OBJ_DIR)/fbcm.o
$(OBJ_DIR)/nss.o: \
$(OBJ_DIR)/cartographyalgorithm.o
$(OBJ_DIR)/realposition.o: \
$(SRC_DIR)/positioningalgorithm.hh \
$(OBJ_DIR)/result.o \
$(OBJ_DIR)/calibrationrequest.o \
$(OBJ_DIR)/referencepoint.o
$(OBJ_DIR)/positioning.o: \
$(OBJ_DIR)/inputdatareader.o \
$(OBJ_DIR)/input.o \
$(OBJ_DIR)/realposition.o \
$(OBJ_DIR)/fbcm.o \
$(OBJ_DIR)/frbhmbasic.o \
$(OBJ_DIR)/interlinknetworks.o \
$(OBJ_DIR)/nss.o \
$(OBJ_DIR)/resultlist.o \
$(OBJ_DIR)/output.o \
$(OBJ_DIR)/configuration.o \
$(OBJ_DIR)/posexcept.o
2010-02-11 10:37:15 +01:00
# Specific targets
$(TARGET): $(OBJ) $(OBJ_NOTEST) $(OBJ_TARGET)
$(TARGET).static: $(OBJ) $(OBJ_NOTEST) $(OBJ_TARGET)
$(OBJ_TARGET): $(SOURCE_TARGET)
$(CXX) $(CXXFLAGS) -o $@ -c $<
$(TESTS_XX): $(SOURCE_TESTS) $(OBJ)
$(TESTS_DIR)/cxxtestgen.pl --error-printer \
--include=$(TESTS_DIR)/valuetraits.hh \
--include=$(TESTUTIL_OBJ:.o=.hh) \
-o $@ $(SOURCE_TESTS)
$(TESTS_OBJ): $(TESTS_XX) $(INCLUDES_TESTS)
$(CXX) $(CXXFLAGS) $(TESTSCXXFLAGS) -o $@ -c $<
$(TESTS_TARGET): $(TESTS_OBJ) $(OBJ_TESTS) $(OBJ) $(OBJ_NOTEST)
$(LD) $(LDFLAGS) -o $@ $^
test_forced: $(TESTS_TARGET)
@$(TESTS_TARGET)
test:
@echo "Unit tests are currently unmaintained. If you are sure"
@echo "you want to try them, use the target 'test_forced'."
doc:
@$(DOXYGEN) $(DOXYFILE)
clean:
@$(RM) *~ */*~ *.orig */*.orig
@$(RM_RECURSIVE) $(OBJ_DIR)
@$(RM) $(TESTS_XX) $(TESTS_DIR)/*.o
purge: clean
@$(RM) $(TARGET)
@$(RM) $(TARGET).static
@$(RM) $(TESTS_TARGET)
@$(RM_RECURSIVE) $(DOXYGEN_DIR)
install: $(TARGET)
@$(CP) $(TARGET) $(INSTALL_DIR) && \
chmod 755 $(INSTALL_DIR)/$(TARGET) && \
chown root:root $(INSTALL_DIR)/$(TARGET)
uninstall:
@$(RM) $(INSTALL_DIR)/$(TARGET)
style:
@$(STYLE) \
$(SOURCE) \
$(TESTS_DIR)/*.hh \
$(TESTS_DIR)/*.cc
check:
@$(CPPCHECK) \
$(SOURCE) \
$(TARGET).cc
2011-03-04 16:09:23 +01:00
help:
@echo "/!\ This program requires GCC >=4.4 /!\\"
@echo
@echo "Needed libraries:"
@echo " libboost-dev"
@echo " libboost-program-options-dev"
@echo
@echo "Optional programs nedded for specific targets:"
@echo " doxygen"
@echo " CxxTest suite"
@echo " astyle (Artistic Style)"
@echo " cppcheck"
@echo
@echo "Targets:"
@echo " all (default target): Compiles OwlPS Positioner."
@echo " doc: Generates documentation from source files (doxygen \
is required)."
@echo " install: Installs OwlPS Positioner."
@echo " uninstall: Uninstalls OwlPS Positioner."
@echo ""
@echo " test: Run unit tests (CxxTest suite is required)."
@echo " style: Reindent source files (astyle is required)."
@echo " check: Run automated checs on the source code (cppcheck \
is required)."
@echo
@echo " clean: Delete the temporary files."
@echo " purge: Delete all generated files."
@echo
@echo "Note: Files are installed under $(PREFIX)."
@echo "Tune the PREFIX variable in the Makefile to change that."