[build] improve build version stuff

- always save build version when updating anything that depends on libpprz, so it will also be updated on e.g. make tmtc
- only warn if the version number (major.minor.patch) is different, disregard the label, sha1, dirty postfixes in the string...
This commit is contained in:
Felix Ruess
2014-12-21 18:13:00 +01:00
parent d3f9e39533
commit 3f3db735ac
2 changed files with 16 additions and 8 deletions
+11 -4
View File
@@ -104,10 +104,17 @@ GEN_HEADERS = $(MESSAGES_H) $(UBX_PROTOCOL_H) $(MTK_PROTOCOL_H) $(XSENS_PROTOCOL
all: ground_segment ext lpctools
print_build_version:
_print_building:
@echo "------------------------------------------------------------"
@echo "Building Paparazzi version" $(shell ./paparazzi_version)
@echo "------------------------------------------------------------"
print_build_version:
@echo "------------------------------------------------------------"
@echo "Last build Paparazzi version" $(shell cat $(PAPARAZZI_HOME)/var/build_version.txt 2> /dev/null || echo UNKNOWN)
@echo "------------------------------------------------------------"
_save_build_version:
$(Q)test -d $(PAPARAZZI_HOME)/var || mkdir -p $(PAPARAZZI_HOME)/var
$(Q)./paparazzi_version > $(PAPARAZZI_HOME)/var/build_version.txt
@@ -120,12 +127,12 @@ conf/%.xml :conf/%_example.xml
[ -L $@ ] || [ -f $@ ] || cp $< $@
ground_segment: print_build_version update_google_version conf libpprz subdirs commands static
ground_segment: _print_building update_google_version conf libpprz subdirs commands static
ground_segment.opt: ground_segment cockpit.opt tmtc.opt
static: cockpit tmtc generators sim_static joystick static_h
libpprz:
libpprz: _save_build_version
$(MAKE) -C $(LIB)/ocaml
multimon:
@@ -311,7 +318,7 @@ run_tests:
test: all replace_current_conf_xml run_tests restore_conf_xml
.PHONY: all print_build_version update_google_version dox ground_segment ground_segment.opt \
.PHONY: all print_build_version _print_building _save_build_version update_google_version dox ground_segment ground_segment.opt \
subdirs $(SUBDIRS) conf ext libpprz multimon cockpit cockpit.opt tmtc tmtc.opt generators\
static sim_static lpctools commands \
clean cleanspaces ab_clean dist_clean distclean dist_clean_irreversible \