########### # include # refresh.mk ########### # to refresh a library on demand : # 1) add this to GNUmakefile : # include SoftRelTools/refresh.mk # 2) add a .refresh file to directory containing GNUmakefile # 3) update .refresh file to trigger a rebuild (in future) # Scream and abort if the workdir/LIBNAME has only slashes, # to avoid removing root # It is ok for workdir/LIBNAME to be absent, due to gmake clean include: $(workdir)/.refresh.$(notdir $(LIB)) $(workdir)/.refresh.$(notdir $(LIB)): .refresh ;\ if [ -n "`echo $(workdir)/$(LIBNAME) | tr -d /`" ] ;\ then \ touch $(workdir)/.refresh.$(notdir $(LIB)) ;\ if [ -d $(workdir)/$(LIBNAME) ] ;\ then \ echo "Refreshing $(LIB) " ;\ /bin/rm -f $(LIB) ;\ /bin/rm -f $(workdir)/*.{o,d} ;\ chmod -R 755 $(workdir)/$(LIBNAME) ;\ /bin/rm -r $(workdir)/$(LIBNAME) ;\ /bin/mkdir -p $(workdir)/$(LIBNAME) ;\ fi ;\ else \ echo " " ;\ echo " Catastrophic error in refresh.mk for $(LIB) " ;\ echo " workdir is $(workdir) " ;\ echo " LIBNAME is $(LIBNAME) " ;\ echo " " ;\ fi