jdk/make/common/Demo.gmk
author tbell
Tue, 23 Oct 2012 10:10:23 -0700
changeset 14091 e5c8662f325d
parent 13678 5c8001201f98
child 14342 8435a30053c1
permissions -rw-r--r--
7152336: Enable builds on Windows with MinGW/MSYS Summary: Minimal makefile changes to enable building OpenJDK using MSYS on Windows7 Reviewed-by: ohair, tbell Contributed-by: volker.simonis@gmail.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 8589
diff changeset
     2
# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    23
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
# JDK Demo building jar file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
  
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
# Some names are defined with LIBRARY inside the Defs.gmk file
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
LIBRARY=$(DEMONAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
OBJDIR=$(TEMPDIR)/$(DEMONAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
# Input:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#    DEMONAME           - name of the demo
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#    DEMO_ROOT          - path to root of all demo files
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#    DEMO_DESTDIR       - path to final demo destination directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
# Optional Input:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#    DEMO_SRCDIR        - path to source if different from DEMO_ROOT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
#    DEMO_PSRCDIR       - path to additional platform specific source
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
#    DEMO_PKGDIR        - sub directory of sources we want
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
#    DEMO_TOPFILES      - names of top-level files relative to DEMO_ROOT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
#    DEMO_MAINCLASS     - name of the main class for the jar manifest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
#    DEMO_NATIVECLASS   - name of the class with native methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
#    DEMO_DESCRIPTOR    - name of service file for jar (relative to DEMO_SRCDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#    DEMO_EXTRA_SRCDIR  - path to directory that holds extra sources to add
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
#    DEMO_EXTRA_FILES   - extra sources relative to DEMO_EXTRA_SRCDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
#    DEMO_OBJECTS       - extra native object files needed
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
#    DEMO_MANIFEST_ATTR - extra line to add to the jar manifest file
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
# Assume the source directory is the root directory if not set
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
ifndef DEMO_SRCDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
  DEMO_SRCDIR = $(DEMO_ROOT)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
ifndef DEMO_PKGDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
  DEMO_PKGDIR = .
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
# Some demos have special needs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
ifneq ($(DEMONAME),agent_util)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
  DEMO_NEEDS_AGENT_UTIL    = $(findstring agent_util,$(DEMO_OBJECTS))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
ifneq ($(DEMONAME),java_crw_demo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
  DEMO_NEEDS_JAVA_CRW_DEMO = $(findstring java_crw_demo,$(DEMO_OBJECTS))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
ifeq ($(DEMONAME),hprof)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
  DEMO_NEEDS_NPT           = true
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
# Place to hold the build area (kind of a temp area)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
DEMO_BUILD_AREA     = $(DEMOCLASSDIR)/$(PRODUCT)/$(DEMONAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
# Destination "src" directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
DEMO_BUILD_SRCDIR     = $(DEMO_BUILD_AREA)/src
7962
fbf25bae06b1 6246816: SwingSet2 should be rewritten
rupashka
parents: 7668
diff changeset
    74
fbf25bae06b1 6246816: SwingSet2 should be rewritten
rupashka
parents: 7668
diff changeset
    75
ifndef DEMO_SKIP_SRCZIP
fbf25bae06b1 6246816: SwingSet2 should be rewritten
rupashka
parents: 7668
diff changeset
    76
  DEMO_BUILD_SRCZIP     = $(DEMO_BUILD_AREA)/src.zip
fbf25bae06b1 6246816: SwingSet2 should be rewritten
rupashka
parents: 7668
diff changeset
    77
  DEMO_SOURCE_ZIP       = $(DEMO_DESTDIR)/src.zip
fbf25bae06b1 6246816: SwingSet2 should be rewritten
rupashka
parents: 7668
diff changeset
    78
endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
# Place to hold the jar image we are creating
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
DEMO_JAR_IMAGE      = $(DEMO_BUILD_AREA)/jar_image
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
# The jar manifest file we will create and use
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
DEMO_MANIFEST       = $(DEMO_BUILD_AREA)/manifest.mf
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
# The list of source files or options we will supply to javac
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
DEMO_JAVAC_INPUT    = $(DEMO_BUILD_AREA)/javac_input.txt
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
# Any name of javah file
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
DEMO_JAVAH_FILE = $(DEMO_NATIVECLASS:%=$(DEMO_BUILD_SRCDIR)/%.h)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
# Get complete list of files for this demo
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
ifdef DEMO_PSRCDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
  DEMO_ALL_FILES2  := $(shell ( $(CD) $(DEMO_PSRCDIR) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    && $(FIND) $(DEMO_PKGDIR) $(SCM_DIRS_prune) -o -type f -print ) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    | $(SED) 's@^\./@@' )
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
  DEMO_ALL_FILES   += $(DEMO_ALL_FILES2)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
ifdef DEMO_EXTRA_SRCDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
  DEMO_ALL_FILES   += $(DEMO_EXTRA_FILES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
DEMO_ALL_FILES1    := $(shell ( $(CD) $(DEMO_SRCDIR) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
  && $(FIND) $(DEMO_PKGDIR) $(SCM_DIRS_prune) -o -type f -print ) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
  | $(SED) 's@^\./@@' )
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
DEMO_ALL_FILES      += $(DEMO_ALL_FILES1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
# Just the java sources
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
DEMO_JAVA_SOURCES = $(filter %.java,$(DEMO_ALL_FILES))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
# Just the C and C++ sources
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
DEMO_C_SRC_FILES   = $(filter %.c,$(DEMO_ALL_FILES))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
DEMO_CPP_SRC_FILES = $(filter %.cpp,$(DEMO_ALL_FILES))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
# All the native source files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
DEMO_ALL_NATIVE_SOURCES  = $(DEMO_C_SRC_FILES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
DEMO_ALL_NATIVE_SOURCES += $(DEMO_CPP_SRC_FILES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
DEMO_ALL_NATIVE_SOURCES += $(filter %.h,$(DEMO_ALL_FILES))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
DEMO_ALL_NATIVE_SOURCES += $(filter %.hpp,$(DEMO_ALL_FILES))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
# If we have java sources, then define the jar file we will create
8589
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   121
ifndef DEMO_JAR_NAME
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   122
  DEMO_JAR_NAME = $(DEMONAME).jar
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   123
endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
ifneq ($(strip $(DEMO_JAVA_SOURCES)),)
8589
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   125
  DEMO_JAR            = $(DEMO_DESTDIR)/$(DEMO_JAR_NAME)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
# If we have native sources, define the native library we will create
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
ifneq ($(strip $(DEMO_ALL_NATIVE_SOURCES)),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
  # Path to native library we will create
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
  DEMO_LIBRARY = \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
      $(DEMO_DESTDIR)/lib$(ISA_DIR)/$(LIB_PREFIX)$(DEMONAME).$(LIBRARY_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
  # C and C++ compiler flags we need to add to standard flags
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
  DEMO_CPPFLAGS     += -I$(DEMO_BUILD_SRCDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
  # If the npt library is used we need to find the npt.h file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
  ifneq ($(DEMO_NEEDS_NPT),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    # The npt library is delivered as part of the JRE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    DEMO_CPPFLAGS   += -I$(SHARE_SRC)/npt -I$(PLATFORM_SRC)/npt
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
  # Is the shared agent_util code needed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
  ifneq ($(DEMO_NEEDS_AGENT_UTIL),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    DEMO_FULL_SOURCES  += $(DEMO_BUILD_SRCDIR)/agent_util.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    DEMO_FULL_SOURCES  += $(DEMO_BUILD_SRCDIR)/agent_util.h
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
  # Is the shared java_crw_demo code needed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
  ifneq ($(DEMO_NEEDS_JAVA_CRW_DEMO),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    DEMO_FULL_SOURCES  += $(DEMO_BUILD_SRCDIR)/java_crw_demo.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    DEMO_FULL_SOURCES  += $(DEMO_BUILD_SRCDIR)/java_crw_demo.h
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
  # All the native object files we need to build the library
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
  DEMO_OBJECTS += $(DEMO_C_SRC_FILES:%.c=%.$(OBJECT_SUFFIX)) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
                  $(DEMO_CPP_SRC_FILES:%.cpp=%.$(OBJECT_SUFFIX))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
  # Linking is special depending on whether we had C++ code or on windows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
  DEMO_NEEDS_CPP = $(strip $(DEMO_CPP_SRC_FILES))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
  CPPFLAGS      += $(DEMO_CPPFLAGS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
  ifeq ($(PLATFORM),windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    # Note: This is a link with cl.exe, not link.exe, options differ quite
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    #       bit between them.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    LINK.demo   = $(LINK.c)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    LDLIBS.demo = $(EXTRA_LIBS) $(LFLAGS_$(COMPILER_VERSION))
10841
32925b032690 6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents: 9351
diff changeset
   161
    DEMO_VERSION_INFO = $(OBJDIR)/$(LIBRARY).res
32925b032690 6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents: 9351
diff changeset
   162
    LDLIBS.demo += $(DEMO_VERSION_INFO)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    ifneq ($(DEMO_NEEDS_CPP),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
      LINK.demo   = $(LINK.cpp)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
      LDLIBS.demo = $(LIBCXX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
      ifeq ($(PLATFORM),solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        LDLIBS.demo += -lc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
      endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
      LINK.demo   = $(LINK.c)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
      LDLIBS.demo = $(LDLIBS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
# Files that are considered resources (need to be in the jar file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
DEMO_RESOURCES        += $(filter-out %.java,$(DEMO_ALL_FILES))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
# All destination files (top level readme files and all sources)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
#   Note: We exclude the topfiles from the src tree.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
DEMO_DEST_TOPFILES     = $(DEMO_TOPFILES:%=$(DEMO_DESTDIR)/%)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
DEMO_FILTERED_SOURCES  = $(filter-out $(DEMO_TOPFILES),$(DEMO_ALL_FILES))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
DEMO_FULL_SOURCES     += $(DEMO_FILTERED_SOURCES:%=$(DEMO_BUILD_SRCDIR)/%)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
# Default rule
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
all: build demo_info
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
# Used to populate the destination directories
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
$(DEMO_DESTDIR)/%: $(DEMO_ROOT)/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
ifneq ($(DEMO_SRCDIR),$(DEMO_ROOT))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
$(DEMO_DESTDIR)/%: $(DEMO_SRCDIR)/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_SRCDIR)/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
ifdef DEMO_PSRCDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_PSRCDIR)/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
ifdef DEMO_EXTRA_SRCDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_EXTRA_SRCDIR)/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
ifneq ($(DEMO_NEEDS_AGENT_UTIL),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_SRCDIR)/../agent_util/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
ifneq ($(DEMO_NEEDS_JAVA_CRW_DEMO),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_SRCDIR)/../java_crw_demo/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
# Jar manifest file
9351
d51c071707da 6595663: Manifest on jars contain JavaBeans entries
ohair
parents: 9035
diff changeset
   216
MAINMANIFEST  = $(JDK_TOPDIR)/make/tools/manifest.mf
d51c071707da 6595663: Manifest on jars contain JavaBeans entries
ohair
parents: 9035
diff changeset
   217
$(DEMO_MANIFEST): $(MAINMANIFEST)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
	@$(prep-target)
9351
d51c071707da 6595663: Manifest on jars contain JavaBeans entries
ohair
parents: 9035
diff changeset
   219
	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#"           \
d51c071707da 6595663: Manifest on jars contain JavaBeans entries
ohair
parents: 9035
diff changeset
   220
               -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
d51c071707da 6595663: Manifest on jars contain JavaBeans entries
ohair
parents: 9035
diff changeset
   221
               $(MAINMANIFEST) >> $@
d51c071707da 6595663: Manifest on jars contain JavaBeans entries
ohair
parents: 9035
diff changeset
   222
	$(ECHO) "Main-Class: $(DEMO_MAINCLASS)" >> $@
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
ifdef DEMO_MANIFEST_ATTR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
	$(ECHO) "$(DEMO_MANIFEST_ATTR)" >> $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
# Populating the jar image directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
$(DEMO_JAR_IMAGE)/%: $(DEMO_SRCDIR)/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
ifdef DEMO_PSRCDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
$(DEMO_JAR_IMAGE)/%: $(DEMO_PSRCDIR)/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
ifdef DEMO_EXTRA_SRCDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
$(DEMO_JAR_IMAGE)/%: $(DEMO_EXTRA_SRCDIR)/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
ifdef DEMO_DESCRIPTOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
$(DEMO_JAR_IMAGE)/META-INF/services/$(DEMO_DESCRIPTOR): \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    $(DEMO_SRCDIR)/$(DEMO_DESCRIPTOR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
# If we are creating a jar file (we have java code)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
ifdef DEMO_JAR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
# Input file for javac
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
$(DEMO_JAVAC_INPUT): $(DEMO_JAVA_SOURCES:%=$(DEMO_BUILD_SRCDIR)/%)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
	@for i in $(DEMO_JAVA_SOURCES) ; do \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
	  $(ECHO) "$(DEMO_BUILD_SRCDIR)/$$i" >> $@ ; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
	done
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
# Jar file creation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
$(DEMO_JAR): \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    $(DEMO_JAVAC_INPUT) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    $(DEMO_MANIFEST) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    $(DEMO_DESCRIPTOR:%=$(DEMO_JAR_IMAGE)/META-INF/services/%) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    $(DEMO_RESOURCES:%=$(DEMO_JAR_IMAGE)/%)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
	$(MKDIR) -p $(DEMO_JAR_IMAGE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
	$(JAVAC_CMD) -d $(DEMO_JAR_IMAGE) -sourcepath $(DEMO_BUILD_SRCDIR) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
	    @$(DEMO_JAVAC_INPUT)
8589
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   264
  ifeq ($(DEMO_INCL_SRC),true)
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   265
	$(CP) $(DEMO_JAVA_SOURCES:%=$(DEMO_BUILD_SRCDIR)/%) $(DEMO_JAR_IMAGE)
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   266
  endif
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   267
  ifeq ($(DEMO_ONLY_SRC),true)
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   268
	$(RM) -r $(DEMO_JAR_IMAGE)
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   269
	$(MKDIR) -p $(DEMO_JAR_IMAGE)
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   270
	$(CP) -r $(DEMO_BUILD_SRCDIR)/* $(DEMO_JAR_IMAGE)
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   271
    ifneq ($(DEMO_TOPFILES),)
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   272
	$(CP) $(DEMO_ROOT)/$(DEMO_TOPFILES) $(DEMO_JAR_IMAGE)
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   273
    endif
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   274
  endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
	$(BOOT_JAR_CMD) -cfm $@ $(DEMO_MANIFEST) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
	     -C $(DEMO_JAR_IMAGE) . \
916
867515b155b5 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 2
diff changeset
   277
	     $(BOOT_JAR_JFLAGS)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
	@$(java-vm-cleanup)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
7962
fbf25bae06b1 6246816: SwingSet2 should be rewritten
rupashka
parents: 7668
diff changeset
   282
ifndef DEMO_SKIP_SRCZIP
fbf25bae06b1 6246816: SwingSet2 should be rewritten
rupashka
parents: 7668
diff changeset
   283
  # Create a src.zip file
fbf25bae06b1 6246816: SwingSet2 should be rewritten
rupashka
parents: 7668
diff changeset
   284
  $(DEMO_BUILD_SRCZIP): $(DEMO_FULL_SOURCES)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
	$(CD) $(DEMO_BUILD_AREA)/src && $(ZIPEXE) -q -r ../$(@F) .
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
7962
fbf25bae06b1 6246816: SwingSet2 should be rewritten
rupashka
parents: 7668
diff changeset
   288
  # Install the destination src.zip file and create the src tree
fbf25bae06b1 6246816: SwingSet2 should be rewritten
rupashka
parents: 7668
diff changeset
   289
  $(DEMO_SOURCE_ZIP): $(DEMO_BUILD_SRCZIP)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
	$(install-file)
7962
fbf25bae06b1 6246816: SwingSet2 should be rewritten
rupashka
parents: 7668
diff changeset
   291
endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
10841
32925b032690 6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents: 9351
diff changeset
   293
ifeq ($(PLATFORM),windows)
32925b032690 6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents: 9351
diff changeset
   294
# JDK name required here
14091
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13678
diff changeset
   295
RC_FLAGS += -D "JDK_FNAME=$(LIBRARY).dll" \
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13678
diff changeset
   296
            -D "JDK_INTERNAL_NAME=$(LIBRARY)" \
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13678
diff changeset
   297
            -D "JDK_FTYPE=0x2L"
10841
32925b032690 6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents: 9351
diff changeset
   298
endif
32925b032690 6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents: 9351
diff changeset
   299
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
# Native library building
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
ifdef DEMO_LIBRARY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
  # Full paths to object files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
  DEMO_FULL_OBJECTS = $(DEMO_OBJECTS:%=$(OBJDIR)/%)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
  VPATH=
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
# Native compile rules
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
$(OBJDIR)/%.$(OBJECT_SUFFIX): $(DEMO_BUILD_SRCDIR)/%.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
	$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$@ $<
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
  ifneq ($(DEMO_NEEDS_CPP),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
$(OBJDIR)/%.$(OBJECT_SUFFIX): $(DEMO_BUILD_SRCDIR)/%.cpp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
	$(COMPILE.cpp) $(CC_OBJECT_OUTPUT_FLAG)$@ $<
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
  # Actual creation of the native shared library (C++ and C are different)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
$(DEMO_LIBRARY): $(DEMO_FULL_OBJECTS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
	@$(prep-target)
10841
32925b032690 6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents: 9351
diff changeset
   320
  ifeq ($(PLATFORM),windows)
32925b032690 6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents: 9351
diff changeset
   321
	$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(DEMO_VERSION_INFO) $(VERSIONINFO_RESOURCE)
11369
d1de4020afbd 7128320: Fix freetype sanity check to make it more generic
ohair
parents: 10841
diff changeset
   322
	$(LINK.demo) $(SHARED_LIBRARY_FLAG) -Fe$@ \
13678
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 11369
diff changeset
   323
	    $(sort $(DEMO_FULL_OBJECTS)) $(LDLIBS.demo)
11369
d1de4020afbd 7128320: Fix freetype sanity check to make it more generic
ohair
parents: 10841
diff changeset
   324
  else
d1de4020afbd 7128320: Fix freetype sanity check to make it more generic
ohair
parents: 10841
diff changeset
   325
	$(LINK.demo) $(SHARED_LIBRARY_FLAG) -o $@ \
13678
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 11369
diff changeset
   326
	    $(sort $(DEMO_FULL_OBJECTS)) $(LDLIBS.demo)
10841
32925b032690 6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows
ngmr
parents: 9351
diff changeset
   327
  endif
8008
753c38f4af83 6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents: 7668
diff changeset
   328
	@$(call binary_file_verification,$@)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
  # Generation of any javah include file, make sure objects are dependent on it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
  ifdef DEMO_NATIVECLASS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
$(DEMO_JAVAH_FILE): $(DEMO_JAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
	$(JAVAH_CMD) -d $(DEMO_BUILD_SRCDIR) -classpath $(DEMO_JAR) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
	    $(DEMO_NATIVECLASS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
	@$(java-vm-cleanup)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
$(DEMO_FULL_OBJECTS): $(DEMO_JAVAH_FILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
# Build involves populating the destination "src" tree, building the jar and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
#     native library, and creating a source bundle
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
sources:  $(DEMO_FULL_SOURCES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
	@$(ECHO) "Created $@"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
objects: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
	@$(ECHO) "Created $@"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
# Why the nested make here? It only works this way, don't know why.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
bundles: $(DEMO_BUILD_SRCZIP)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
	$(RM) -r $(DEMO_DESTDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
	$(MKDIR) -p $(DEMO_DESTDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
	$(MAKE) $(DEMO_LIBRARY) $(DEMO_JAR) $(DEMO_SOURCE_ZIP) $(DEMO_DEST_TOPFILES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
# Applets are special, no jar file, no src.zip, everything expanded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
ifdef DEMO_IS_APPLET
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
	@$(ECHO) "Expanding jar file into demos area at $(DEMO_DESTDIR)"
916
867515b155b5 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 2
diff changeset
   359
	( $(CD) $(DEMO_DESTDIR) && \
8589
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   360
	  $(BOOT_JAR_CMD) -xfv $(DEMO_JAR_NAME) \
916
867515b155b5 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 2
diff changeset
   361
	     $(BOOT_JAR_JFLAGS) && \
8589
84bd24764797 6710813: SwingSet2 source display tabs do not work since JDK 7 b20
ohair
parents: 8583
diff changeset
   362
	  $(RM) -r META-INF $(DEMO_JAR_NAME) && \
916
867515b155b5 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 2
diff changeset
   363
	  $(java-vm-cleanup) )
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
	@( $(CD) $(DEMO_DESTDIR) && $(java-vm-cleanup) )
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
	@$(ECHO) "Expanding source into demos area at $(DEMO_DESTDIR)"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
	( $(CD) $(DEMO_DESTDIR) && $(UNZIP) -o src.zip && $(RM) src.zip )
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
build: sources bundles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
# Printing out a demo information line
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
define printDemoSetting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
if [ "$2" != "" ] ; then $(PRINTF) "%-20s %s\n" "$1:" "$2"; fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
# Print out the demo information
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
demo_info:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
	@$(ECHO) "========================================================="
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
	@$(call printDemoSetting,DEMONAME,$(DEMONAME))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
	@$(call printDemoSetting,DEMO_ROOT,$(DEMO_ROOT))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
	@$(call printDemoSetting,DEMO_SRCDIR,$(DEMO_SRCDIR))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
	@$(call printDemoSetting,DEMO_DESTDIR,$(DEMO_DESTDIR))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
	@$(call printDemoSetting,DEMO_JAR,$(DEMO_JAR))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
	@$(call printDemoSetting,DEMO_MANIFEST_ATTR,$(DEMO_MANIFEST_ATTR))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
	@$(call printDemoSetting,DEMO_PSRCDIR,$(DEMO_PSRCDIR))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
	@$(call printDemoSetting,DEMO_EXTRA_SRCDIR,$(DEMO_EXTRA_SRCDIR))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
	@$(call printDemoSetting,DEMO_EXTRA_FILES,$(DEMO_EXTRA_FILES))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
	@$(call printDemoSetting,DEMO_TOPFILES,$(DEMO_TOPFILES))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
	@$(call printDemoSetting,DEMO_MAINCLASS,$(DEMO_MAINCLASS))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
	@$(call printDemoSetting,DEMO_DESCRIPTOR,$(DEMO_DESCRIPTOR))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
	@$(call printDemoSetting,DEMO_NATIVECLASS,$(DEMO_NATIVECLASS))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
	@$(call printDemoSetting,DEMO_LIBRARY,$(DEMO_LIBRARY))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
	@$(call printDemoSetting,DEMO_OBJECTS,$(DEMO_OBJECTS))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
	@$(call printDemoSetting,DEMO_SOURCE_ZIP,$(DEMO_SOURCE_ZIP))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
	@$(ECHO) "========================================================="
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
# Clean rule
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
clean clobber:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
	$(RM) -r $(DEMO_BUILD_AREA)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
	$(RM) -r $(DEMO_DESTDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
7962
fbf25bae06b1 6246816: SwingSet2 should be rewritten
rupashka
parents: 7668
diff changeset
   402
# This should not be needed, but some versions of GNU make have a bug that
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
#   sometimes deleted these files  for some strange  and unknown reason 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
#   (GNU make version 3.78.1 has the problem, GNU make version 3.80 doesn't?)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
.PRECIOUS: $(DEMO_FULL_SOURCES) $(DEMO_BUILD_SRCZIP) $(DEMO_SOURCE_ZIP)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
# List phony targets
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
.PHONY: all build clean clobber demo_info \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
	sources bundles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410