[Positioning] Clean Makefile

This commit is contained in:
Matteo Cypriani 2010-02-11 10:37:15 +01:00
parent 9cf4daca3b
commit c341f852b7
1 changed files with 23 additions and 33 deletions

View File

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