corba/make/common/Library.gmk
author xdono
Tue, 28 Jul 2009 12:12:36 -0700
changeset 3291 805a72a26925
parent 3124 005f9574da2c
child 5555 b2b5ed3f0d0d
permissions -rw-r--r--
6862919: Update copyright year Summary: Update copyright for files that have been modified in 2009, up to 07/09 Reviewed-by: tbell, ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
#
3291
805a72a26925 6862919: Update copyright year
xdono
parents: 3124
diff changeset
     2
# Copyright 1995-2009 Sun Microsystems, Inc.  All Rights Reserved.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02bb8761fcce Initial load
duke
parents:
diff changeset
     4
#
02bb8761fcce Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
02bb8761fcce Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
02bb8761fcce Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.  Sun designates this
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
02bb8761fcce Initial load
duke
parents:
diff changeset
     9
# by Sun in the LICENSE file that accompanied this code.
02bb8761fcce Initial load
duke
parents:
diff changeset
    10
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
02bb8761fcce Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02bb8761fcce Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02bb8761fcce Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
02bb8761fcce Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
02bb8761fcce Initial load
duke
parents:
diff changeset
    16
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
02bb8761fcce Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
02bb8761fcce Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02bb8761fcce Initial load
duke
parents:
diff changeset
    20
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
02bb8761fcce Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
02bb8761fcce Initial load
duke
parents:
diff changeset
    23
# have any questions.
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
# Generic makefile for building shared libraries.
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
include $(TOPDIR)/make/common/Classes.gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
# It is important to define these *after* including Classes.gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
# in order to override the values defined inthat makefile.
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
ACTUAL_LIBRARY_NAME = $(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
ACTUAL_LIBRARY_DIR = $(LIB_LOCATION)
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
ACTUAL_LIBRARY = $(ACTUAL_LIBRARY_DIR)/$(ACTUAL_LIBRARY_NAME)
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
library:: $(ACTUAL_LIBRARY)
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
FILES_o   = $(patsubst %.c,   %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_c))))
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
FILES_o  += $(patsubst %.s,   %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_s))))
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
FILES_o  += $(patsubst %.cpp, %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_cpp))))
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
ifeq ($(INCREMENTAL_BUILD),true)
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
FILES_d   = $(patsubst %.c,   %.$(DEPEND_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_c))))
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
FILES_d  += $(patsubst %.cpp, %.$(DEPEND_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_cpp))))
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
endif # INCREMENTAL_BUILD
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
ifeq ($(PLATFORM),solaris)
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
# List of all lint files, one for each .c file (only for C)
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
FILES_ln   = $(patsubst %.c,   %.$(LINT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_c))))
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
# C++ libraries must be linked with CC.
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
ifdef CPLUSPLUSLIBRARY
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
LINKER=$(LINK.cc)
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
else
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
LINKER=$(LINK.c)
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
# We either need to import (copy) libraries in, or build them
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
$(ACTUAL_LIBRARY):: $(INIT) $(TEMPDIR) $(LIBDIR) $(BINDIR) $(EXTDIR) classheaders
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
# COMPILE_APPROACH: Different approaches to compile up the native object
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
#   files as quickly as possible.
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
#   The setting of parallel works best on Unix, batch on Windows.
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
COMPILE_FILES_o = $(OBJDIR)/.files_compiled
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
$(COMPILE_FILES_o): $(FILES_d) $(FILES_o)
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
	@$(ECHO) "$<" >> $@
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
clean::
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
	$(RM) $(COMPILE_FILES_o)
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
# COMPILE_APPROACH=parallel: Will trigger compilations (just compilations) to
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
#   happen in parallel. Greatly decreases Unix build time, even on single CPU
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
#   machines, more so on multiple CPU machines. Default is 2 compiles
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
#   at a time, but can be adjusted with ALT_PARALLEL_COMPILE_JOBS.
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
#   Note that each .d file will also be dependent on it's .o file, see
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
#   Rules.gmk.
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
#   Note this does not depend on Rules.gmk to work like batch (below)
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
#   and this technique doesn't seem to help Windows build time nor does
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
#   it work very well, it's possible the Windows Visual Studio compilers
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
#   don't work well in a parallel situation, this needs investigation.
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
ifeq ($(COMPILE_APPROACH),parallel)
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
.PHONY: library_parallel_compile
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
library_parallel_compile:
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
	@$(ECHO) "Begin parallel compiles: $(shell $(PWD))"
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
	@$(MAKE) -j $(PARALLEL_COMPILE_JOBS) $(COMPILE_FILES_o)
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
	@$(ECHO) "Done with parallel compiles: $(shell $(PWD))"
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
$(ACTUAL_LIBRARY):: library_parallel_compile
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
# COMPILE_APPROACH=batch: Will trigger compilations (just compilations) to
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
#   happen in batch mode. Greatly decreases Windows build time.
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
#   See logic in Rules.gmk for how compiles happen, the $(MAKE) in
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
#   library_batch_compile below triggers the actions in Rules.gmk.
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
#   Note that each .d file will also be dependent on it's .o file, see
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
#   Rules.gmk.
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
ifeq ($(COMPILE_APPROACH),batch)
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
.PHONY: library_batch_compile
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
library_batch_compile:
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
	@$(ECHO) "Begin BATCH compiles: $(shell $(PWD))"
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
	$(MAKE) $(COMPILE_FILES_o)
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
	$(MAKE) batch_compile
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
	@$(ECHO) "Done with BATCH compiles: $(shell $(PWD))"
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
	$(MAKE) COMPILE_APPROACH=normal $(COMPILE_FILES_o)
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
$(ACTUAL_LIBRARY):: library_batch_compile
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
ifeq ($(PLATFORM), windows)
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
# Library building rules.
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
$(LIBRARY).lib:: $(OBJDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
# build it into $(OBJDIR) so that the other generated files get put 
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
# there, then copy just the DLL (and MAP file) to the requested directory.
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
$(ACTUAL_LIBRARY):: $(OBJDIR)/$(LIBRARY).lcf
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
	@$(prep-target)
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
	@$(MKDIR) -p $(OBJDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
	$(LINK) -dll -out:$(OBJDIR)/$(@F) \
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
	  -map:$(OBJDIR)/$(LIBRARY).map \
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
	  $(LFLAGS) @$(OBJDIR)/$(LIBRARY).lcf \
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
	  $(OTHER_LCF) $(JAVALIB) $(LDLIBS)
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
	$(CP) $(OBJDIR)/$(@F) $@
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
	$(CP) $(OBJDIR)/$(LIBRARY).map $(@D)
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
	$(CP) $(OBJDIR)/$(LIBRARY).pdb $(@D)
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
$(OBJDIR)/$(LIBRARY).lcf: $(OBJDIR)/$(LIBRARY).res $(COMPILE_FILES_o) $(FILES_m)
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
	@$(prep-target)
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
	@$(MKDIR) -p $(TEMPDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
	@$(ECHO) $(FILES_o) > $@ 
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
ifndef LOCAL_RESOURCE_FILE
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
	@$(ECHO) $(OBJDIR)/$(LIBRARY).res >> $@
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
	@$(ECHO) Created $@ 
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
3124
005f9574da2c 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 4
diff changeset
   161
RC_FLAGS += /D "JDK_FNAME=$(LIBRARY).dll" \
005f9574da2c 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 4
diff changeset
   162
            /D "JDK_INTERNAL_NAME=$(LIBRARY)" \
005f9574da2c 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 4
diff changeset
   163
            /D "JDK_FTYPE=0x2L"
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
$(OBJDIR)/$(LIBRARY).res: $(VERSIONINFO_RESOURCE)
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
ifndef LOCAL_RESOURCE_FILE
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
	@$(prep-target)
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
	$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE)
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
# Install a .lib file if required.
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
ifeq ($(INSTALL_DOT_LIB), true)
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
$(ACTUAL_LIBRARY):: $(LIBDIR)/$(LIBRARY).lib
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
clean:: 
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
	-$(RM) $(LIBDIR)/$(LIBRARY).lib
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
$(LIBDIR)/$(LIBRARY).lib:: $(OBJDIR)/$(LIBRARY).lib
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
	$(install-file)
02bb8761fcce Initial load
duke
parents:
diff changeset
   182
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
$(LIBDIR)/$(LIBRARY).dll:: $(OBJDIR)/$(LIBRARY).dll
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
	$(install-file)
02bb8761fcce Initial load
duke
parents:
diff changeset
   185
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
endif # INSTALL_DOT_LIB
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
02bb8761fcce Initial load
duke
parents:
diff changeset
   188
else # PLATFORM
02bb8761fcce Initial load
duke
parents:
diff changeset
   189
02bb8761fcce Initial load
duke
parents:
diff changeset
   190
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
# On Solaris, use mcs to write the version into the comment section of
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
# the shared library.  On other platforms set this to false at the
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
# make command line.
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
$(ACTUAL_LIBRARY):: $(COMPILE_FILES_o) $(FILES_m) $(FILES_reorder)
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
	@$(prep-target)
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
	@$(ECHO) "STATS: LIBRARY=$(LIBRARY), PRODUCT=$(PRODUCT), _OPT=$(_OPT)"
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
	@$(ECHO) "Rebuilding $@ because of $?"
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
	$(LINKER) $(SHARED_LIBRARY_FLAG) -o $@ $(FILES_o) $(LDLIBS)
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
ifeq ($(WRITE_LIBVERSION),true)
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
	$(MCS) -d -a "$(FULL_VERSION)" $@
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
endif # WRITE_LIBVERSION
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
endif # PLATFORM
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
# Cross check all linted files against each other
02bb8761fcce Initial load
duke
parents:
diff changeset
   208
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
ifeq ($(PLATFORM),solaris)
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
lint.errors : $(FILES_ln)
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
	$(LINT.c) $(FILES_ln) $(LDLIBS) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
# Class libraries with JNI native methods get a include to the package.
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
ifdef PACKAGE
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
vpath %.c $(SHARE_SRC)/native/$(PKGDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
OTHER_INCLUDES += -I$(SHARE_SRC)/native/common -I$(PLATFORM_SRC)/native/common
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
OTHER_INCLUDES += -I$(SHARE_SRC)/native/$(PKGDIR) \
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
		  -I$(PLATFORM_SRC)/native/$(PKGDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
# Clean/clobber rules
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
clean::
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
	$(RM) -r $(ACTUAL_LIBRARY)
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
02bb8761fcce Initial load
duke
parents:
diff changeset
   231
clobber:: clean
02bb8761fcce Initial load
duke
parents:
diff changeset
   232
02bb8761fcce Initial load
duke
parents:
diff changeset
   233
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   234
# INCREMENTAL_BUILD means that this workspace will be built over and over
02bb8761fcce Initial load
duke
parents:
diff changeset
   235
#   possibly incrementally. This means tracking the object file dependencies
02bb8761fcce Initial load
duke
parents:
diff changeset
   236
#   on include files so that sources get re-compiled when the include files
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
#   change. When building from scratch and doing a one time build (like
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
#   release engineering or nightly builds) set INCREMENTAL_BUILD=false.
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
ifeq ($(INCREMENTAL_BUILD),true)
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
# Workaround: gnumake sometimes says files is empty when it shouldn't
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
#    was:  files := $(foreach file, $(wildcard $(OBJDIR)/*.$(DEPEND_SUFFIX)), $(file))
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null)
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   250
# Only include these files if we have any.
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
ifneq ($(strip $(files)),)
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
include $(files)
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
endif # files
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
endif # INCREMENTAL_BUILD
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
# Default dependencies
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
all: build
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
02bb8761fcce Initial load
duke
parents:
diff changeset
   266
build: library
02bb8761fcce Initial load
duke
parents:
diff changeset
   267
02bb8761fcce Initial load
duke
parents:
diff changeset
   268
debug:
02bb8761fcce Initial load
duke
parents:
diff changeset
   269
	$(MAKE) VARIANT=DBG build
02bb8761fcce Initial load
duke
parents:
diff changeset
   270
02bb8761fcce Initial load
duke
parents:
diff changeset
   271
fastdebug:
02bb8761fcce Initial load
duke
parents:
diff changeset
   272
	$(MAKE) VARIANT=DBG FASTDEBUG=true build
02bb8761fcce Initial load
duke
parents:
diff changeset
   273
02bb8761fcce Initial load
duke
parents:
diff changeset
   274
.PHONY: all build debug fastdebug
02bb8761fcce Initial load
duke
parents:
diff changeset
   275