Commit fd98ed79 authored by Michael Ott's avatar Michael Ott
Browse files

Fix Makefiles: make directories order-only-prerequisites, cleanups

parent 9e7ecb17
......@@ -76,18 +76,15 @@ info:
@echo "where <X> is your cross copmlier prefix ( e.g. arm-linux-gnueabihf- )"
clean:
@$(foreach l,$(LIBRARIES),echo "Cleaning $(l)..." && make -C $(l) clean && echo;)
@$(foreach p,$(PROJECTS),echo "Cleaning $(p)..." && make -C $(p) clean && echo;)
@$(foreach s,$(SUB_DIRS),echo "Cleaning $(s)..." && make -C $(s) clean && echo;)
cleanall: clean
@cd $(DCDBDEPSPATH) && rm -f .prerequesites .extract-distfiles .download-distfiles
@$(foreach f,$(DISTFILESPATHS),echo "Cleaning $(f)..." && rm -rf $(DCDBDEPSPATH)/$(f) && echo;)
@$(foreach f,mosquitto cpp-driver cpp-netlib,echo "Cleaning $(f)..." && rm -rf $(DCDBDEPSPATH)/$(f)_build && echo;)
distclean: clean
@echo "Wiping dependencies..."
@rm -rf $(DCDBDEPSPATH)
@rm -rf .md5sums
mrproper: distclean
$(eval U := $(shell whoami))
......@@ -102,9 +99,6 @@ update-distfile-hashes: .md5sums
@sed -i -e 's/^DISTFILES_HASHES\ =.*/DISTFILES_HASHES\ =\ $(X)/' $(MAKEFILENAME) ;
@rm -f .md5sums
.md5sums: $(DCDBDEPSPATH)/.download-distfiles
@$(foreach f,$(DISTFILESNAMES),echo "Checksumming $(f)..." && printf "$(f);" >> .md5sums && $(MD5) $(DCDBDEPSPATH)/distfiles/$(f) | sed -e 's/.*\ //' >> .md5sums; )
all: check-cross-compile depsinstall $(foreach s,$(SUB_DIRS),$(s)-build)
install: depsinstall $(SUB_DIRS)
......@@ -126,7 +120,7 @@ $(DCDBDEPSPATH)/openssl-$(OPENSSL_VERSION)/.built: $(DCDBDEPSPATH)/openssl-$(OPE
cd $(@D) && ./Configure shared --prefix=$(DCDBDEPLOYPATH) $(OPENSSL_TARGET)
cd $(@D) && make && touch $(@)
$(DCDBDEPSPATH)/openssl-$(OPENSSL_VERSION)/.installed: $(DCDBDEPSPATH)/openssl-$(OPENSSL_VERSION)/.built $(DCDBDEPLOYPATH)
$(DCDBDEPSPATH)/openssl-$(OPENSSL_VERSION)/.installed: $(DCDBDEPSPATH)/openssl-$(OPENSSL_VERSION)/.built | $(DCDBDEPLOYPATH)
@echo "Installing OpenSSL library..."
cd $(@D) && make install && touch $(@)
......@@ -144,24 +138,26 @@ $(DCDBDEPSPATH)/mosquitto-$(MOSQUITTO_VERSION)/.built: $(DCDBDEPSPATH)/mosquitto
make -j $(MAKETHREADS) && \
touch $(@)
$(DCDBDEPSPATH)/mosquitto-$(MOSQUITTO_VERSION)/.installed: $(DCDBDEPSPATH)/mosquitto-$(MOSQUITTO_VERSION)/.built $(DCDBDEPLOYPATH)
$(DCDBDEPSPATH)/mosquitto-$(MOSQUITTO_VERSION)/.installed: $(DCDBDEPSPATH)/mosquitto-$(MOSQUITTO_VERSION)/.built | $(DCDBDEPLOYPATH)
@echo "Installing Mosquitto library..."
cd $(DCDBDEPSPATH)/mosquitto_build && make install && touch $(@)
$(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/.built: $(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/.patched
@echo "Building Boost..."
if [ "$(ARCH)" = "arm" ]; then \
@ if [ "$(ARCH)" = "arm" ]; then \
echo " using gcc : arm : $(CROSS_COMPILE)g++ ; " > $(@D)/tools/build/src/user-config.jam; \
fi
cd $(@D) && ./bootstrap.sh --prefix=$(DCDBDEPLOYPATH) \
--with-libraries=atomic,chrono,date_time,exception,filesystem,program_options,random,regex,system,thread,timer
cd $(@D) && ./bootstrap.sh --prefix=$(DCDBDEPLOYPATH) --with-libraries=atomic,chrono,date_time,exception,filesystem,program_options,random,regex,system,thread,timer && touch $(@)
$(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/.installed: $(DCDBDEPSPATH)/boost_$(BOOST_VERSION_U)/.built
cd $(@D) && ./b2 -j $(MAKETHREADS) cxxflags="$(CXX11FLAGS)" install && touch $(@)
$(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.built: $(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.patched
@echo "Building libuv..."
cd $(@D) && env CC="$(CC)" CFLAGS="$(CFLAGS)" make -j $(MAKETHREADS) && touch $(@)
$(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.installed: $(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.built $(DCDBDEPLOYPATH)
$(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.installed: $(DCDBDEPSPATH)/libuv-v$(LIBUV_VERSION)/.built | $(DCDBDEPLOYPATH)
@echo "Installing libuv..."
mkdir -p $(DCDBDEPLOYPATH)/include/uv-private
cd $(@D) && install -c include/uv.h $(DCDBDEPLOYPATH)/include/
......@@ -189,7 +185,7 @@ $(DCDBDEPSPATH)/cpp-driver-$(CPPDRV_VERSION)/.built: $(DCDBDEPSPATH)/cpp-driver-
$(@D) && \
make -j $(MAKETHREADS) && touch $(@)
$(DCDBDEPSPATH)/cpp-driver-$(CPPDRV_VERSION)/.installed: $(DCDBDEPSPATH)/cpp-driver-$(CPPDRV_VERSION)/.built $(DCDBDEPLOYPATH)
$(DCDBDEPSPATH)/cpp-driver-$(CPPDRV_VERSION)/.installed: $(DCDBDEPSPATH)/cpp-driver-$(CPPDRV_VERSION)/.built | $(DCDBDEPLOYPATH)
@echo "Installing cpp-driver..."
cd $(DCDBDEPSPATH)/cpp-driver_build && make install && touch $(@)
......@@ -208,14 +204,14 @@ $(DCDBDEPSPATH)/cpp-netlib-$(CPPNET_VERSION)/.built: $(DCDBDEPSPATH)/cpp-netlib-
$(@D) && \
make -j $(MAKETHREADS) && touch $(@)
$(DCDBDEPSPATH)/cpp-netlib-$(CPPNET_VERSION)/.installed: $(DCDBDEPSPATH)/cpp-netlib-$(CPPNET_VERSION)/.built $(DCDBDEPLOYPATH)
$(DCDBDEPSPATH)/cpp-netlib-$(CPPNET_VERSION)/.installed: $(DCDBDEPSPATH)/cpp-netlib-$(CPPNET_VERSION)/.built | $(DCDBDEPLOYPATH)
@echo "Installing cpp-netlib..."
cd $(DCDBDEPSPATH)/cpp-netlib_build && make install && touch $(@)
$(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.built: $(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.patched
@touch $(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.built
$(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.installed: $(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.built $(DCDBDEPLOYPATH)
$(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.installed: $(DCDBDEPSPATH)/apache-cassandra-$(CASSANDRA_VERSION)/.built | $(DCDBDEPLOYPATH)
@echo ""
@echo "Staging and configuring Cassandra..."
@rsync -rlptD $(@D)/ $(DCDBDEPLOYPATH)/cassandra
......
......@@ -45,7 +45,7 @@ all: $(TARGET)
$(DCDBDEPSPATH):
@mkdir -p $(DCDBDEPSPATH)
$(DCDBDEPSPATH)/distfiles: $(DCDBDEPSPATH)
$(DCDBDEPSPATH)/distfiles: | $(DCDBDEPSPATH)
@mkdir -p $(DCDBDEPSPATH)/distfiles
$(DCDBDEPLOYPATH):
......@@ -53,7 +53,7 @@ $(DCDBDEPLOYPATH):
@mkdir -p $(DCDBDEPLOYPATH)/include
@mkdir -p $(DCDBDEPLOYPATH)/lib
$(DCDBDEPSPATH)/distfiles/%: $(DCDBDEPSPATH)/distfiles
$(DCDBDEPSPATH)/distfiles/%: | $(DCDBDEPSPATH)/distfiles
@echo "Check for $(*)"
$(eval U := $(shell echo "$(DISTFILES)" | sed 's/.*$(*);//' | sed 's/ .*//'))
@if [ -e $(@) ]; then \
......@@ -65,11 +65,11 @@ $(DCDBDEPSPATH)/distfiles/%: $(DCDBDEPSPATH)/distfiles
$(FETCH) $(@) $(U); \
fi
$(DCDBDEPSPATH)/%/.extracted: $(DCDBDEPSPATH)/distfiles/$$(call getarchive,%)
$(eval F := $(notdir $(<)))
$(DCDBDEPSPATH)/%/.extracted: | $(DCDBDEPSPATH)/distfiles/$$(call getarchive,%)
$(eval F := $(notdir $(|)))
@if [ ! -e $(@) ]; then \
printf "Verifying checksum: $(F) "; \
if [ `$(MD5) $(<)|sed -e 's/.*\ //'` = $(call gethash,$(F)) ]; then \
if [ `$(MD5) $(|)|sed -e 's/.*\ //'` = $(call gethash,$(F)) ]; then \
echo " => OK!"; \
else \
echo " => FAIL!"; \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment