[build system] clean up makefiles and fix dependencies, parallel build with make -j 8 seems to work now

This commit is contained in:
Felix Ruess
2012-11-09 18:12:53 +01:00
parent 3dd43539e5
commit 8bff1b46c9
26 changed files with 444 additions and 245 deletions
+18 -7
View File
@@ -1,23 +1,34 @@
# Hey Emacs, this is a -*- makefile -*-
DATADIR = $(PAPARAZZI_HOME)/conf/maps_data
Q=@
all: $(DATADIR)/maps.google.com $(PAPARAZZI_HOME)/conf/maps.xml
all: $(PAPARAZZI_HOME)/conf/maps.xml
clean:
rm -f $(DATADIR)/maps.google.com
$(DATADIR):
mkdir $(DATADIR)
$(DATADIR)/maps.google.com: $(DATADIR) FORCE
@echo "-----------------------------------------------"
@echo "DOWNLOAD: google maps version code";
$(Q)wget -q -O $(@) http://maps.google.com/ || \
(rm -f $(@) && echo "Could not download google maps version code" && exit 1)
(rm -f $(@) && \
echo "Could not download google maps version code" && \
echo "-----------------------------------------------" && \
exit 1)
$(PAPARAZZI_HOME)/conf/maps.xml: $(DATADIR)/maps.google.com
$(Q)echo "<!DOCTYPE maps SYSTEM \"maps.dtd\">" > $(@)
$(Q)echo "" >> $(@)
$(Q)echo "<maps google_version=\""`grep -P "http://khm[0-9]+.google.com/kh/v=[0-9]+.x26" $(DATADIR)/maps.google.com | sed -E 's#.*http://khm[0-9]+.google.com/kh/v=##;s#.x26.*##'`"\"/>" >> $(@)
$(Q)echo "" >> $(@)
$(eval GOOGLE_VERSION := $(shell grep -P "http://khm[0-9]+.google.com/kh/v=[0-9]+.x26" $(DATADIR)/maps.google.com | sed -E 's#.*http://khm[0-9]+.google.com/kh/v=##;s#.x26.*##'))
@echo "Updated google maps version to $(GOOGLE_VERSION)"
@echo "-----------------------------------------------"
$(Q)echo "<!DOCTYPE maps SYSTEM \"maps.dtd\">" > /tmp/maps.xml
$(Q)echo "" >> /tmp/maps.xml
$(Q)echo "<maps google_version=\"$(GOOGLE_VERSION)\"/>" >> /tmp/maps.xml
$(Q)echo "" >> /tmp/maps.xml
$(Q)mv /tmp/maps.xml $@
FORCE:
.PHONY: all clean