Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/lavabit/magma.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLadar Levison <ladar@lavabit.com>2018-11-30 20:31:52 +0300
committerLadar Levison <ladar@lavabit.com>2018-11-30 20:31:52 +0300
commit502323e7135a867a704ead0cbd8607ff0638d69c (patch)
tree0084407a8e5f5656a16a36b76c7e16d3b6b27ccc
parent298ef45beb6e4bfc764d2404d587f5e65db6ae14 (diff)
Improving the make dependency logic.
-rw-r--r--Makefile19
-rwxr-xr-xdev/scripts/builders/build.lib.sh18
2 files changed, 19 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index 4e54bd95..06c1266d 100644
--- a/Makefile
+++ b/Makefile
@@ -206,7 +206,6 @@ ifeq ($(patsubst undefined,default,$(origin QUICK)),default)
QUICK = yes
endif
-
# C Compiler Options
CFLAGS ?=
CFLAGS_WARNINGS = -Wall -Werror -Winline -Wformat-security -Warray-bounds
@@ -220,7 +219,7 @@ CPPFLAGS_COMBINED = -std=c++0x $(CPPFLAGS_WARNINGS) -Wno-unused-para
# Linker Options
LDFLAGS ?=
-LDFLAGS_COMBINED = -rdynamic
+LDFLAGS_COMBINED = -rdynamic $(LDFLAGS)
# Archiver Options
ARFLAGS ?= rcs
@@ -433,7 +432,7 @@ endif
$(RUN)$(LD) $(LDFLAGS_COMBINED) -o '$@' $(MAGMA_OBJFILES) -Wl,--start-group $(MAGMA_DYNAMIC) $(MAGMA_STATIC) -Wl,--end-group
# Construct the magma unit test executable.
-$(MAGMA_CHECK_PROGRAM): $(MAGMA_SHARED_LIBRARY) $(MAGMA_CHECK_OBJFILES) $(filter-out .objs/src/magma.o, $(MAGMA_OBJFILES)) | $(MAGMA_CHECK_STATIC)
+$(MAGMA_CHECK_PROGRAM): $(MAGMA_SHARED_LIBRARY) $(MAGMA_CHECK_OBJFILES) $(filter-out .objs/src/magma.o, $(MAGMA_OBJFILES)) $(MAGMA_CHECK_STATIC)
ifeq ($(VERBOSE),no)
@echo 'Constructing' $(RED)$@$(NORMAL)
endif
@@ -505,7 +504,7 @@ ifeq ($(VERBOSE),no)
endif
$(RUN)$(LD) $(LDFLAGS_COMBINED) -o '$@' $(DIME_CHECK_OBJFILES) -Wl,--start-group,--whole-archive $(DIME_CHECK_STATIC) -Wl,--no-whole-archive,--end-group $(DIME_CHECK_DYNAMIC)
-$(OBJDIR)/check/dime/%.o: check/dime/%.cpp $(MAGMA_SHARED_LIBRARY)
+$(OBJDIR)/check/dime/%.o: check/dime/%.cpp $(MAGMA_SHARED_LIBRARY) $(DIME_CHECK_STATIC)
ifeq ($(VERBOSE),no)
@echo 'Building' $(YELLOW)$<$(NORMAL)
endif
@@ -551,7 +550,7 @@ endif
# The recipes needed to build the various statically linked dependencies. They do not actually depend on the Magma shared library,
# but include the dependency here to keep make from trying to build both at the same time.
-$(TOPDIR)/lib/local/lib/libz$(STATLIBEXT): dev/scripts/builders/build.lib.params.sh | $(MAGMA_SHARED_LIBRARY)
+$(TOPDIR)/lib/local/lib/libz$(STATLIBEXT): $(MAGMA_SHARED_LIBRARY)
ifeq ($(VERBOSE),no)
@echo 'Building' $(YELLOW)libz$(STATLIBEXT)$(NORMAL)
@QUICK=$(QUICK) dev/scripts/builders/build.lib.sh zlib &> /dev/null
@@ -560,9 +559,9 @@ else
@QUICK=$(QUICK) dev/scripts/builders/build.lib.sh zlib
endif
-$(TOPDIR)/lib/local/lib/libssl$(STATLIBEXT): $(TOPDIR)/lib/local/lib/libcrypto$(STATLIBEXT) $(TOPDIR)/lib/local/lib/libz$(STATLIBEXT) | $(MAGMA_SHARED_LIBRARY)
+$(TOPDIR)/lib/local/lib/libssl$(STATLIBEXT): $(TOPDIR)/lib/local/lib/libcrypto$(STATLIBEXT) $(TOPDIR)/lib/local/lib/libz$(STATLIBEXT) $(MAGMA_SHARED_LIBRARY)
-$(TOPDIR)/lib/local/lib/libcrypto$(STATLIBEXT): $(TOPDIR)/lib/local/lib/libz$(STATLIBEXT)
+$(TOPDIR)/lib/local/lib/libcrypto$(STATLIBEXT): $(TOPDIR)/lib/local/lib/libz$(STATLIBEXT) $(MAGMA_SHARED_LIBRARY)
ifeq ($(VERBOSE),no)
@echo 'Building' $(YELLOW)libssl$(STATLIBEXT) libcrypto$(STATLIBEXT)$(NORMAL)
@QUICK=$(QUICK) dev/scripts/builders/build.lib.sh openssl &> /dev/null
@@ -571,7 +570,7 @@ else
@QUICK=$(QUICK) dev/scripts/builders/build.lib.sh openssl
endif
-$(TOPDIR)/lib/local/lib/libutf8proc$(STATLIBEXT): $(TOPDIR)/lib/local/lib/libssl$(STATLIBEXT) $(TOPDIR)/lib/local/lib/libcrypto$(STATLIBEXT) $(TOPDIR)/lib/local/lib/libz$(STATLIBEXT) | $(MAGMA_SHARED_LIBRARY)
+$(TOPDIR)/lib/local/lib/libutf8proc$(STATLIBEXT): $(MAGMA_SHARED_LIBRARY) $(TOPDIR)/lib/local/lib/libssl$(STATLIBEXT) $(TOPDIR)/lib/local/lib/libcrypto$(STATLIBEXT) $(TOPDIR)/lib/local/lib/libz$(STATLIBEXT)
ifeq ($(VERBOSE),no)
@echo 'Building' $(YELLOW)libutf8proc$(STATLIBEXT)$(NORMAL)
$(shell [ "`which curl &> /dev/null; echo $$?`" != 0 ] && QUICK=yes dev/scripts/builders/build.lib.sh curl &> /dev/null)
@@ -582,7 +581,7 @@ else
@QUICK=$(QUICK) dev/scripts/builders/build.lib.sh utf8proc
endif
-$(TOPDIR)/lib/sources/googtest/lib/.libs/libgtest$(STATLIBEXT): dev/scripts/builders/build.lib.params.sh | $(MAGMA_SHARED_LIBRARY)
+$(TOPDIR)/lib/sources/googtest/lib/.libs/libgtest$(STATLIBEXT): $(MAGMA_SHARED_LIBRARY)
ifeq ($(VERBOSE),no)
@echo 'Building' $(YELLOW)googtest$(STATLIBEXT)$(NORMAL)
@QUICK=$(QUICK) dev/scripts/builders/build.lib.sh googtest &> /dev/null
@@ -591,7 +590,7 @@ else
@QUICK=$(QUICK) dev/scripts/builders/build.lib.sh googtest
endif
-$(TOPDIR)/lib/local/lib/libcheck$(STATLIBEXT): dev/scripts/builders/build.lib.params.sh | $(MAGMA_SHARED_LIBRARY)
+$(TOPDIR)/lib/local/lib/libcheck$(STATLIBEXT): $(MAGMA_SHARED_LIBRARY)
ifeq ($(VERBOSE),no)
@echo 'Building' $(YELLOW)libcheck$(STATLIBEXT)$(NORMAL)
@QUICK=$(QUICK) dev/scripts/builders/build.lib.sh checker &> /dev/null
diff --git a/dev/scripts/builders/build.lib.sh b/dev/scripts/builders/build.lib.sh
index 022f43cb..0da30e33 100755
--- a/dev/scripts/builders/build.lib.sh
+++ b/dev/scripts/builders/build.lib.sh
@@ -2512,6 +2512,16 @@ combine() {
"$M_OBJECTS"/png/*.o "$M_OBJECTS"/jpeg/*.o "$M_OBJECTS"/freetype/*.o "$M_OBJECTS"/gd/*.o \
"$M_OBJECTS"/dkim/*.o "$M_OBJECTS"/dspam/*.o "$M_OBJECTS"/jansson/*.o \
-lm -lrt -ldl -lnsl -lresolv -lpthread -lstdc++ &>> "$M_LOGS/combine.txt"; error
+
+ # This will update the time stamps for the various standalone dependencies, which should prevent make from rebuilding them.
+ find "$M_LOCAL/include" -type f -exec touch -r "$M_SO" -d '+1 minutes' {} \;
+ find "$M_LDPATH" -type f -iname "libz.a" -or -iname "libz.lib" -exec touch -r "$M_SO" -d '+2 minutes' {} \;
+ find "$M_LDPATH" -type f -iname "libcrypto.a" -or -iname "libcrypto.lib" -exec touch -r "$M_SO" -d '+4 minutes' {} \;
+ find "$M_LDPATH" -type f -iname "libssl.a" -or -iname "libssl.lib" -exec touch -r "$M_SO" -d '+6 minutes' {} \;
+ find "$M_LDPATH" -type f -iname "libutf8proc.a" -or -iname "libutf8proc.lib" -exec -r "$M_SO" -d '+8 minutes' {} \;
+ find "$M_LDPATH" -type f -iname "libcheck.a" -or -iname "libcheck.lib" -exec touch -r "$M_SO" -d '+10 minutes' {} \;
+ find "$M_SOURCES/googtest/lib/.libs/" -type f -iname "libgtest.a" -or -iname "libgtest.lib" -exec touch -r "$M_SO" -d '+12 minutes' {} \;
+
date +"%n%nFinished creating the shared object at %r on %x%n"
;;
esac
@@ -2520,14 +2530,6 @@ combine() {
echo ""
fi
- # We touch the various standalone dependencies so make doesn't try and rebuild them.
- find "$M_SOURCES/googtest/lib/.libs/" -type f -iname "libgtest.a" -or -iname "libgtest.lib" -exec touch -c {} \;
- find "$M_LDPATH" -type f -iname "libutf8proc.a" -or -iname "libutf8proc.lib" -exec touch -c {} \;
- find "$M_LDPATH" -type f -iname "libcrypto.a" -or -iname "libcrypto.lib" -exec touch -c {} \;
- find "$M_LDPATH" -type f -iname "libcheck.a" -or -iname "libcheck.lib" -exec touch -c {} \;
- find "$M_LDPATH" -type f -iname "libssl.a" -or -iname "libssl.lib" -exec touch -c {} \;
- find "$M_LDPATH" -type f -iname "libz.a" -or -iname "libz.lib" -exec touch -c {} \;
-
exit 0
}