Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a common makefile for D, P, Q, SQ #188

Closed
wants to merge 12 commits into from
2 changes: 1 addition & 1 deletion clean.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

.DEFAULT_GOAL := clean

D = /
include common.mk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use full path: include $(TEST_ROOT)/TKG/common.mk and move this inclusion after ifndef TEST_ROOT block. Apply this change to all places should solve the build failure.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use full path: include $(TEST_ROOT)/TKG/common.mk and move this inclusion after ifndef TEST_ROOT block. Apply this change to all places should solve the build failure.

Alright. But in makeGen.mk and settings.mk the path include $(TEST_ROOT)/TKG/common.mk can be placed anywhere since it doesn't have ifndef TEST_ROOT isn't it @renfeiw ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, you need to add this block. In the future, we can move this block of code to the top level makefile, but for now let's duplicate it in makeGen.mk and settings.mk


ifndef TEST_ROOT
TEST_ROOT := $(shell pwd)$(D)..
Expand Down
4 changes: 4 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
D = /
2001asjad marked this conversation as resolved.
Show resolved Hide resolved
P = :
2001asjad marked this conversation as resolved.
Show resolved Hide resolved
Q = "
SQ = '
4 changes: 2 additions & 2 deletions compile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

.DEFAULT_GOAL := compile

D = /
include common.mk

ifndef TEST_ROOT
TEST_ROOT := $(shell pwd)$(D)..
Expand All @@ -34,4 +34,4 @@ compile:
($(COMPILE_CMD) 2>&1; echo $$? ) | tee $(Q)$(COMPILATION_LOG)$(Q); \
$(MOVE_TDUMP)

.PHONY: compile
.PHONY: compile
4 changes: 1 addition & 3 deletions makeGen.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ help:
CURRENT_DIR := $(shell pwd)
OPTS=

D=/
P=:
Q="
include common.mk

TKG_JAR = .$(D)bin$(D)TestKitGen.jar
JSON_SIMPLE = .$(D)lib$(D)json-simple.jar
Expand Down
3 changes: 1 addition & 2 deletions moveDmp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
# limitations under the License.
##############################################################################

D = /
Q = "
include common.mk

ifndef TEST_ROOT
TEST_ROOT := $(shell pwd)$(D)..
Expand Down
2 changes: 1 addition & 1 deletion runtest.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

.DEFAULT_GOAL := test

D = /
include common.mk

SUBDIRS = ..

Expand Down
11 changes: 5 additions & 6 deletions settings.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ EXECUTABLE_SUFFIX =
RUN_SCRIPT = sh
RUN_SCRIPT_STRING = "sh -c"
SCRIPT_SUFFIX=.sh
Q="
SQ='
P=:
AND_IF_SUCCESS=&&
PROPS_DIR=props_unix
TOTALCOUNT := 0

include common.mk

-include $(TEST_ROOT)$(D)TKG$(D)autoGenEnv.mk
include $(TEST_ROOT)$(D)TKG$(D)envSettings.mk
-include $(TEST_ROOT)$(D)TKG$(D)utils.mk
Expand Down Expand Up @@ -84,7 +83,7 @@ ifndef JVM_VERSION

ifeq (hotspot, $(JDK_IMPL))
JVM_VERSION = $(OPENJDK_VERSION)
else
else
JVM_VERSION = $(OPENJDK_VERSION)-$(JDK_IMPL)
endif

Expand All @@ -95,7 +94,7 @@ ifneq (,$(findstring win,$(SPEC)))
P=;
D=\\
EXECUTABLE_SUFFIX=.exe
RUN_SCRIPT="cmd /c"
RUN_SCRIPT="cmd /c"
RUN_SCRIPT_STRING=$(RUN_SCRIPT)
SCRIPT_SUFFIX=.bat
PROPS_DIR=props_win
Expand Down Expand Up @@ -195,7 +194,7 @@ KEEP_REPORTDIR?=true
ifeq ($(KEEP_REPORTDIR), false)
RM_REPORTDIR=$(RM) -r $(REPORTDIR);
endif
ifeq ($(TEST_ITERATIONS), 1)
ifeq ($(TEST_ITERATIONS), 1)
TEST_STATUS=if [ $$? -eq 0 ] ; then $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_PASSED$(Q); $(ECHO) $(Q)$(Q); $(CD) $(TEST_ROOT); $(RM_REPORTDIR) else $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_FAILED$(Q); $(ECHO) $(Q)$(Q); fi
else
TEST_STATUS=if [ $$? -eq 0 ] ; then $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_PASSED(ITER_$$itercnt)$(Q); $(ECHO) $(Q)$(Q); $(CD) $(TEST_ROOT); $(RM_REPORTDIR) if [ $$itercnt -eq $(TEST_ITERATIONS) ] ; then $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_PASSED$(Q); $(ECHO) $(Q)$(Q); fi else $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_FAILED(ITER_$$itercnt)$(Q); $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_FAILED$(Q); $(ECHO) $(Q)$(Q); exit 1; fi
Expand Down