]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/kaldi.git/blobdiff - src/makefiles/default_rules.mk
[build] Cosmetic fix in Makefile
[processor-sdk/kaldi.git] / src / makefiles / default_rules.mk
index 34abd9059245e7966e05247e5dd95ac53c71a146..510c9bca90590f1f083d239cf57b9a100b2b62ed 100644 (file)
@@ -17,6 +17,7 @@ ifeq ($(KALDI_FLAVOR), dynamic)
   else  # Platform not supported
     $(error Dynamic libraries not supported on this platform. Run configure with --static flag.)
   endif
+  XDEPENDS =
 else
   ifdef LIBNAME
     LIBFILE = $(LIBNAME).a
@@ -30,16 +31,16 @@ $(LIBFILE): $(OBJFILES)
        $(AR) -cru $(LIBNAME).a $(OBJFILES)
        $(RANLIB) $(LIBNAME).a
 ifeq ($(KALDI_FLAVOR), dynamic)
-ifeq ($(shell uname), Darwin)
+  ifeq ($(shell uname), Darwin)
        $(CXX) -dynamiclib -o $@ -install_name @rpath/$@ $(LDFLAGS) $(OBJFILES) $(LDLIBS)
        rm -f $(KALDILIBDIR)/$@; ln -s $(shell pwd)/$@ $(KALDILIBDIR)/$@
-else ifeq ($(shell uname), Linux)
-       # Building shared library from static (static was compiled with -fPIC)
+  else ifeq ($(shell uname), Linux)
+        # Building shared library from static (static was compiled with -fPIC)
        $(CXX) -shared -o $@ -Wl,--no-undefined -Wl,--as-needed  -Wl,-soname=$@,--whole-archive $(LIBNAME).a -Wl,--no-whole-archive $(LDFLAGS) $(LDLIBS)
        rm -f $(KALDILIBDIR)/$@; ln -s $(shell pwd)/$@ $(KALDILIBDIR)/$@
-else  # Platform not supported
+  else  # Platform not supported
        $(error Dynamic libraries not supported on this platform. Run configure with --static flag.)
-endif
+  endif
 endif
 
 # By default (GNU) make uses the C compiler $(CC) for linking object files even
@@ -47,16 +48,18 @@ endif
 # use the C++ compiler $(CXX) instead.
 LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH)
 
-ifeq ($(KALDI_FLAVOR), dynamic)
-$(BINFILES): $(LIBFILE)
-else
 $(BINFILES): $(LIBFILE) $(XDEPENDS)
+
+# When building under CI, CI_NOLINKBINARIES is set to skip linking of binaries.
+ifdef CI_NOLINKBINARIES
+$(BINFILES): %: %.o
+       touch $@
 endif
 
 # Rule below would expand to, e.g.:
 # ../base/kaldi-base.a:
-#      make -c ../base kaldi-base.a
-# -c option to make is same as changing directory.
+#      make -C ../base kaldi-base.a
+# -C option to make is same as changing directory.
 %.a:
        $(MAKE) -C ${@D} ${@F}
 
@@ -69,11 +72,7 @@ clean:
 distclean: clean
        -rm -f .depend.mk
 
-ifeq ($(KALDI_FLAVOR), dynamic)
-$(TESTFILES): $(LIBFILE)
-else
 $(TESTFILES): $(LIBFILE) $(XDEPENDS)
-endif
 
 test_compile: $(TESTFILES)
 
@@ -94,7 +93,7 @@ test: test_compile
              rm -rf core;              \
            fi;                         \
          else                          \
-           echo " $${time_taken}s... SUCCESS";         \
+           echo " $${time_taken}s... SUCCESS $$x";             \
            rm -f $$x.testlog;          \
          fi;                           \
        done;                           \