owlps/owlps-positioning/Makefile

121 lines
3.1 KiB
Makefile

.PHONY : all obj test doc clean purge install uninstall style check
TEST_DIR = tests
TEST_XX = $(TEST_DIR)/tests.cc
TEST_OBJ = $(TEST_DIR)/tests.o
TEST_TARGET = $(TEST_DIR)/tests
DOXYGEN_DIR = doc
DOXYFILE = Doxyfile
# Répertoire d'installation
PREFIX = /usr/local
INSTALL_DIR = $(PREFIX)/bin
# Commandes d'installation et de désinstallation
RM = rm -fv
RM_RECURSIVE = \rm -fr
CP = cp -v
# Autres outils
STYLE = astyle --style=gnu --formatted
CPPCHECK = cppcheck --enable=all
DOXYGEN = doxygen
GXX = g++-4.4
#DEBUG = -g
TESTSGXXFLAGS = -I$(TEST_DIR) -I.
GXXFLAGS = $(DEBUG) -Wall -Wextra $(STLPORTGXXFLAGS)
LD = $(GXX)
LDFLAGS = -lm -lrt -lboost_program_options
#LIBS = -lpq
TARGET = owlps-positioning
#HEADER = owlps-positioning.hh
OBJ = posutil.o stock.o timestamp.o point3d.o referencepoint.o \
waypoint.o building.o area.o wifidevice.o accesspoint.o \
mobile.o measurement.o calibrationmeasurement.o request.o \
inputcsv.o configuration.o userinterface.o
all: $(TARGET)
%: %.o
$(LD) $(LDFLAGS) -o $@ $^
%.o: %.cc $(HEADER)
$(GXX) $(GXXFLAGS) -c $<
$(TEST_DIR)/%_test.o: %.o
$(GXX) $(GXXFLAGS) $(TESTSGXXFLAGS) -c $<
posutil.o: posutil.hh
stock.o: stock.hh
configuration.o: configuration.hh
userinterface.o: userinterface.hh configuration.o
timestamp.o: timestamp.hh
point3d.o: point3d.hh
referencepoint.o : referencepoint.hh point3d.o
waypoint.o: waypoint.hh point3d.o building.o
building.o: building.hh
area.o: area.hh building.o point3d.o
wifidevice.o: wifidevice.hh posutil.o
accesspoint.o: accesspoint.hh wifidevice.o point3d.o
mobile.o: mobile.hh wifidevice.o
measurement.o: measurement.hh accesspoint.o
calibrationmeasurement.o: calibrationmeasurement.hh measurement.o referencepoint.o
request.o: request.hh timestamp.o measurement.o
inputcsv.o: inputcsv.hh inputmedium.hh request.o stock.o
#libowlps-positioning.o: libowlps-positioning.hh
#positioning.o: point.hh referencepoint.hh accesspoint.hh area.hh measurement.hh libowlps-positioning.hh
#server.o: server.hh positioning.hh point.hh measurement.hh treatment.hh libowlps-positioning.hh
#owlps-positioning.o: server.hh
#treatment.o: treatment.hh point.hh measurement.hh referencepoint.hh accesspoint.hh libowlps-positioning.hh
obj: $(OBJ)
$(TARGET): $(OBJ)
$(TEST_XX): $(OBJ:%.o=$(TEST_DIR)/%_test.hh) $(TEST_DIR)/valuetraits.hh
$(TEST_DIR)/cxxtestgen.pl --error-printer \
--include=$(TEST_DIR)/valuetraits.hh \
-o $@ $^
$(TEST_OBJ): $(TEST_XX) $(OBJ)
$(GXX) $(GXXFLAGS) $(TESTSGXXFLAGS) -o $@ -c $<
$(TEST_TARGET): $(TEST_OBJ)
$(LD) $(LDFLAGS) -o $@ $^ $(OBJ)
test: $(TEST_TARGET)
@$(TEST_TARGET)
doc:
@$(DOXYGEN) $(DOXYFILE)
clean:
@$(RM) *~ *.o *.gch *.orig
@$(RM) $(TEST_OBJ) $(TEST_XX) $(TEST_DIR)/*~ $(TEST_DIR)/*.o \
$(TEST_DIR)/*.orig
purge: clean
@$(RM) $(TARGET)
@$(RM) $(TEST_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) \
$(OBJ:.o=.hh) \
$(OBJ:.o=.cc) \
inputmedium.hh \
$(OBJ:%.o=$(TEST_DIR)/%_test.hh)
check:
@$(CPPCHECK) $(OBJ:.o=.hh) $(OBJ:.o=.cc) inputmedium.hh