Skip to content

Commit a31d08b

Browse files
committedJun 20, 2015
Android: use loop inside makefile to spare repetition
1 parent 14f4cd0 commit a31d08b

File tree

1 file changed

+9
-42
lines changed

1 file changed

+9
-42
lines changed
 

‎build/android/Makefile

+9-42
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ clean_curl :
615615

616616
curl_binary:
617617
@if [ ! -d "deps/curl-${CURL_VERSION_BINARY}" ] ; then \
618-
echo "curl sources missing, downloading..."; \
618+
echo "curl binary missing, downloading..."; \
619619
mkdir -p ${ROOT}/deps; \
620620
cd deps; \
621621
wget http://curl.haxx.se/gknw.net/7.34.0/dist-android/curl-7.34.0-rtmp-ssh2-ssl-zlib-static-bin-android.tar.gz || exit 1;\
@@ -696,47 +696,14 @@ clean_sqlite3:
696696

697697
$(ASSETS_TIMESTAMP) : $(IRRLICHT_LIB)
698698
@mkdir -p ${ROOT}/deps; \
699-
LAST_MODIF=$$(find ${ROOT}/../../builtin -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
700-
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
701-
touch ${ROOT}/../../builtin/timestamp; \
702-
touch ${ASSETS_TIMESTAMP}; \
703-
echo builtin changed $$LAST_MODIF; \
704-
fi; \
705-
LAST_MODIF=$$(find ${ROOT}/../../client -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
706-
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
707-
touch ${ROOT}/../../client/timestamp; \
708-
touch ${ASSETS_TIMESTAMP}; \
709-
fi; \
710-
LAST_MODIF=$$(find ${ROOT}/../../doc -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
711-
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
712-
touch ${ROOT}/../../doc/timestamp; \
713-
touch ${ASSETS_TIMESTAMP}; \
714-
fi; \
715-
LAST_MODIF=$$(find ${ROOT}/../../fonts -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
716-
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
717-
touch ${ROOT}/../../fonts/timestamp; \
718-
touch ${ASSETS_TIMESTAMP}; \
719-
fi; \
720-
LAST_MODIF=$$(find ${ROOT}/../../games -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
721-
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
722-
touch ${ROOT}/../../games/timestamp; \
723-
touch ${ASSETS_TIMESTAMP}; \
724-
fi; \
725-
LAST_MODIF=$$(find ${ROOT}/../../mods -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
726-
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
727-
touch ${ROOT}/../../mods/timestamp; \
728-
touch ${ASSETS_TIMESTAMP}; \
729-
fi; \
730-
LAST_MODIF=$$(find ${ROOT}/../../po -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
731-
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
732-
touch ${ROOT}/../../po/timestamp; \
733-
touch ${ASSETS_TIMESTAMP}; \
734-
fi; \
735-
LAST_MODIF=$$(find ${ROOT}/../../textures -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
736-
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
737-
touch ${ROOT}/../../textures/timestamp; \
738-
touch ${ASSETS_TIMESTAMP}; \
739-
fi; \
699+
for DIRNAME in {builtin,client,doc,fonts,games,mods,po,textures}; do \
700+
LAST_MODIF=$$(find ${ROOT}/../../${DIRNAME} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
701+
if [ $$(basename $$LAST_MODIF) != "timestamp" ]; then \
702+
touch ${ROOT}/../../$DIRNAME/timestamp; \
703+
touch ${ASSETS_TIMESTAMP}; \
704+
echo ${DIRNAME} changed $$LAST_MODIF; \
705+
fi; \
706+
done; \
740707
LAST_MODIF=$$(find ${IRRLICHT_DIR}/media -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
741708
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
742709
touch ${IRRLICHT_DIR}/media/timestamp; \

1 commit comments

Comments
 (1)

nerzhul commented on Jun 21, 2015

@nerzhul
Contributor

👍

Please sign in to comment.