diff options
author | Andres Mejia <amejia004@gmail.com> | 2012-06-21 21:30:18 -0400 |
---|---|---|
committer | Andres Mejia <amejia004@gmail.com> | 2012-09-05 15:07:37 -0400 |
commit | 314ffb3ddc2df9e612933d7638e62cd807526048 (patch) | |
tree | 1f4b39291fd54e62eb9f95989940f285b3897a08 /Makefile.in | |
parent | c0b4151fd73dde98c51437b79c4e5f6b2d420775 (diff) |
[GSOC] Build a single 'main' test program.
This main program will be linked with all libraries in similar fashion as
xbmc.bin and libxbmc.so.
This required modifications to the build system so that the main() function
for xbmc.bin does not get linked with the main() function for the
testsuite program. This has the side effect of allowing xbmc.bin and
libxbmc.so to be built from a single build.
Diffstat (limited to 'Makefile.in')
-rw-r--r-- | Makefile.in | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/Makefile.in b/Makefile.in index 2b25695a01..dfe5c7b209 100644 --- a/Makefile.in +++ b/Makefile.in @@ -90,8 +90,8 @@ DIRECTORY_ARCHIVES=$(DVDPLAYER_ARCHIVES) \ xbmc/xbmc.a \ -NWAOBJSXBMC= xbmc/commons/commons.a \ - xbmc/threads/threads.a \ +NWAOBJSXBMC= xbmc/threads/threads.a \ + xbmc/commons/commons.a ifeq (@USE_WEB_SERVER@,1) @@ -242,8 +242,18 @@ endif FINAL_TARGETS+=Makefile externals GTEST_DIR = lib/gtest +GTEST_INCLUDES = -I$(GTEST_DIR)/include +GTEST_LIBS = $(GTEST_DIR)/lib/.libs/libgtest.a + CHECK_DIRS = xbmc/utils/test \ - xbmc/threads/test + xbmc/threads/test \ + xbmc/test +CHECK_LIBS = xbmc/utils/test/utilsTest.a \ + xbmc/threads/test/threadTest.a \ + xbmc/test/xbmc-test.a +CHECK_PROGRAMS = xbmc-test + +CLEAN_FILES += $(CHECK_PROGRAMS) all : $(FINAL_TARGETS) @echo '-----------------------' @@ -417,14 +427,17 @@ else $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ -Wl,--whole-archive $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--no-whole-archive -Wl,--no-undefined $(NWAOBJSXBMC) $(LIBS) endif -xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) +xbmc.bin: xbmc/main/main.a $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) ifeq ($(findstring osx,@ARCH@), osx) - $(SILENT_LD) $(CXX) $(LDFLAGS) -o xbmc.bin -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS) -rdynamic + $(SILENT_LD) $(CXX) $(LDFLAGS) -o xbmc.bin -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) xbmc/main/main.a $(LIBS) -rdynamic else - $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o xbmc.bin -Wl,--whole-archive $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--no-whole-archive $(NWAOBJSXBMC) $(LIBS) -rdynamic + $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o xbmc.bin -Wl,--whole-archive $(DYNOBJSXBMC) $(OBJSXBMC) xbmc/main/main.a -Wl,--no-whole-archive $(NWAOBJSXBMC) $(LIBS) -rdynamic endif +xbmc/main/main.a: force + $(MAKE) -C xbmc/main + xbmc-xrandr: xbmc-xrandr.c ifneq (1,@USE_XRANDR@) # xbmc-xrandr.c gets picked up by the default make rules @@ -577,17 +590,26 @@ clean-externals: clean-codecs clean-eventclients clean-xbmctex clean-libs \ ifeq (1,@GTEST_CONFIGURED@) check: testsuite - for d in $(CHECK_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d $@; fi; done + for check_program in $(CHECK_PROGRAMS); do $(CURDIR)/$$check_program; done -testsuite: testframework - for d in $(CHECK_DIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d $@; fi; done +testsuite: $(CHECK_PROGRAMS) -testframework: $(GTEST_DIR)/lib/.libs/libgtest.a $(GTEST_DIR)/lib/.libs/libgtest_main.a +testframework: $(GTEST_LIBS) -$(GTEST_DIR)/lib/.libs/libgtest.a $(GTEST_DIR)/lib/.libs/libgtest_main.a: $(GTEST_DIR)/Makefile +$(GTEST_LIBS): $(GTEST_DIR)/Makefile $(GTEST_DIR)/Makefile: force $(MAKE) -C $(GTEST_DIR) + +$(CHECK_LIBS): force + @$(MAKE) $(if $(V),,-s) -C $(@D) + +xbmc-test: $(CHECK_LIBS) $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(GTEST_LIBS) +ifeq ($(findstring osx,@ARCH@), osx) + $(SILENT_LD) $(CXX) $(LDFLAGS) $(GTEST_INCLUDES) -o $@ -Wl,-all_load,-ObjC $(CHECK_LIBS) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(GTEST_LIBS) $(LIBS) -rdynamic +else + $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) $(GTEST_INCLUDES) -o $@ -Wl,--whole-archive $(CHECK_LIBS) $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--no-whole-archive $(NWAOBJSXBMC) $(GTEST_LIBS) $(LIBS) -rdynamic +endif else # Give a message that the framework is not configured, but don't fail. check testsuite testframework: |