hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [02/15] incubator-hawq git commit: HAWQ-911. Optimize and refactor makefiles for feature test framework.
Date Mon, 18 Jul 2016 10:12:26 GMT
HAWQ-911. Optimize and refactor makefiles for feature test framework.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/cf7793f0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/cf7793f0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/cf7793f0

Branch: refs/heads/2.0.0.0-incubating
Commit: cf7793f0d17299a049a2a61ffa2ed8cedd6194a0
Parents: 8083da2
Author: xunzhang <xunzhangthu@gmail.com>
Authored: Sat Jul 9 23:15:00 2016 +0800
Committer: rlei <rlei@pivotal.io>
Committed: Mon Jul 18 18:06:07 2016 +0800

----------------------------------------------------------------------
 src/test/feature/Makefile     | 12 ++++++++----
 src/test/feature/lib/Makefile | 11 +++++++----
 2 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/cf7793f0/src/test/feature/Makefile
----------------------------------------------------------------------
diff --git a/src/test/feature/Makefile b/src/test/feature/Makefile
index e97716c..adc6acc 100644
--- a/src/test/feature/Makefile
+++ b/src/test/feature/Makefile
@@ -13,16 +13,20 @@ override LIBS := $(LIBS) -lgtest -lpq -lxml2 -ltest
 override LDFLAGS += -L/usr/local/lib -L/usr/lib -L$(abs_top_srcdir)/src/test/feature/ -L$(abs_top_srcdir)/src/test/feature/lib/
-L$(abs_top_srcdir)/src/interfaces/libpq -L$(gtest_lib_path) -L$(gmock_lib_path)
 
 PROG = test_main.cpp $(wildcard */*.cpp)
+OBJS = $(patsubst %.cpp,%.o,$(PROG))
 RM = rm -rf
 
 .PHONY: all sharelib sharelibclean distclean clean doc
 
-all: sharelib
+all: $(OBJS) sharelib
 	$(MAKE) -C lib all
-	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(PROG) $(LDFLAGS) $(LIBS) -o feature-test
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -o feature-test
+
+%.o: %.cpp
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $? -o $@
 
 sharelib:
-	cd UDF/lib || exit 1; $(MAKE) || exit 2; $(MAKE) clean || exit 3
+	cd UDF/lib || exit 1; $(MAKE) || exit 2
 
 sharelibclean:
 	cd UDF/lib || exit 1; $(RM) *.o *.so || exit 2
@@ -35,4 +39,4 @@ clean distclean: sharelibclean
 	$(RM) feature-test.dSYM
 	$(RM) doc
 	$(MAKE) -C lib clean
-	
+	$(RM) $(OBJS)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/cf7793f0/src/test/feature/lib/Makefile
----------------------------------------------------------------------
diff --git a/src/test/feature/lib/Makefile b/src/test/feature/lib/Makefile
index 3e990d8..73acdfd 100644
--- a/src/test/feature/lib/Makefile
+++ b/src/test/feature/lib/Makefile
@@ -8,18 +8,21 @@ gtest_lib_path = $(top_builddir)/depends/thirdparty/googletest/build/googlemock
 gmock_lib_path = $(top_builddir)/depends/thirdparty/googletest/build/googlemock/gtest
 
 override CXX = g++
-override CXXFLAGS = -Wall -O0 -g -c -std=c++11
+override CXXFLAGS = -Wall -O0 -g -std=c++11
 override CPPFLAGS := -I/usr/include -I/usr/local/include -I/usr/include/libxml2 -I$(top_builddir)/src/interfaces/libpq
-I$(top_builddir)/src/interfaces -I$(top_builddir)/src/include -I$(gtest_include) -I$(gmock_include)
 override LIBS := $(LIBS) -lpq -lxml2
 override LDFLAGS += -L/usr/local/lib -L/usr/lib -L$(gtest_lib_path) -L$(gmock_lib_path)
 
 PROG = $(abspath $(wildcard *.cpp))
+OBJS := $(patsubst %.cpp,%.o,$(PROG))
 AR = ar -r
 RM = rm -rf
 
-all:
-	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(PROG) 
-	$(AR) libtest.a  *.o
+all: $(OBJS)
+	$(AR) libtest.a $?
+
+%.o: %.cpp
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $? -o $@
 
 distclean clean:
 	$(RM) libtest.a


Mime
View raw message