make/common/TestFilesCompilation.gmk
changeset 49070 d7859531621b
parent 41260 4f71f07b30d1
child 49137 50f5ea3292f1
equal deleted inserted replaced
49069:e37b804ae0b1 49070:d7859531621b
     1 #
     1 #
     2 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
     2 # Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     5 # This code is free software; you can redistribute it and/or modify it
     6 # under the terms of the GNU General Public License version 2 only, as
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.  Oracle designates this
     7 # published by the Free Software Foundation.  Oracle designates this
    59   ifeq ($$($1_TYPE), LIBRARY)
    59   ifeq ($$($1_TYPE), LIBRARY)
    60     $1_PREFIX = lib
    60     $1_PREFIX = lib
    61     $1_OUTPUT_SUBDIR := lib
    61     $1_OUTPUT_SUBDIR := lib
    62     $1_CFLAGS := $(CFLAGS_TESTLIB) $(CFLAGS_WARNINGS_ARE_ERRORS)
    62     $1_CFLAGS := $(CFLAGS_TESTLIB) $(CFLAGS_WARNINGS_ARE_ERRORS)
    63     $1_LDFLAGS := $(LDFLAGS_TESTLIB) $(call SET_SHARED_LIBRARY_ORIGIN)
    63     $1_LDFLAGS := $(LDFLAGS_TESTLIB) $(call SET_SHARED_LIBRARY_ORIGIN)
       
    64     $1_COMPILATION_TYPE := LIBRARY
    64   else ifeq ($$($1_TYPE), PROGRAM)
    65   else ifeq ($$($1_TYPE), PROGRAM)
    65     $1_PREFIX = exe
    66     $1_PREFIX = exe
    66     $1_OUTPUT_SUBDIR := bin
    67     $1_OUTPUT_SUBDIR := bin
    67     $1_CFLAGS := $(CFLAGS_TESTEXE) $(CFLAGS_WARNINGS_ARE_ERRORS)
    68     $1_CFLAGS := $(CFLAGS_TESTEXE) $(CFLAGS_WARNINGS_ARE_ERRORS)
    68     $1_LDFLAGS := $(LDFLAGS_TESTEXE)
    69     $1_LDFLAGS := $(LDFLAGS_TESTEXE)
       
    70     $1_COMPILATION_TYPE := EXECUTABLE
    69   else
    71   else
    70     $$(error Unknown type: $$($1_TYPE))
    72     $$(error Unknown type: $$($1_TYPE))
    71   endif
    73   endif
    72 
    74 
    73   # Locate all files with the matching prefix
    75   # Locate all files with the matching prefix
    76 
    78 
    77   # Setup a compilation for each and every one of them
    79   # Setup a compilation for each and every one of them
    78   $$(foreach file, $$($1_FILE_LIST),\
    80   $$(foreach file, $$($1_FILE_LIST),\
    79     $$(eval name := $$(strip $$(patsubst $$($1_PREFIX)%, %, $$(basename $$(notdir $$(file)))))) \
    81     $$(eval name := $$(strip $$(patsubst $$($1_PREFIX)%, %, $$(basename $$(notdir $$(file)))))) \
    80     $$(eval $$(call SetupNativeCompilation, BUILD_TEST_$$(name), \
    82     $$(eval $$(call SetupNativeCompilation, BUILD_TEST_$$(name), \
    81         $$($1_TYPE) := $$(name), \
    83         NAME := $$(name), \
       
    84         TYPE := $$($1_COMPILATION_TYPE), \
    82         SRC := $$(patsubst %/,%,$$(dir $$(file))), \
    85         SRC := $$(patsubst %/,%,$$(dir $$(file))), \
    83         INCLUDE_FILES := $$(notdir $$(file)), \
    86         INCLUDE_FILES := $$(notdir $$(file)), \
    84         OBJECT_DIR := $$($1_OUTPUT_DIR)/support/$$($1_PREFIX)$$(name), \
    87         OBJECT_DIR := $$($1_OUTPUT_DIR)/support/$$($1_PREFIX)$$(name), \
    85         OUTPUT_DIR := $$($1_OUTPUT_DIR)/$$($1_OUTPUT_SUBDIR), \
    88         OUTPUT_DIR := $$($1_OUTPUT_DIR)/$$($1_OUTPUT_SUBDIR), \
    86         LANG := C, \
    89         LANG := C, \