annotate make/com/sun/java/pack/Makefile @ 422:c51121419e30

6727683: Cleanup use of COMPILER_WARNINGS_FATAL in makefiles Reviewed-by: tbell
author ohair
date Sun, 27 Jul 2008 18:42:57 -0700
parents 37a05a11f281
children 14f50aee4989
rev   line source
duke@0 1 #
duke@0 2 # Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
duke@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 #
duke@0 5 # This code is free software; you can redistribute it and/or modify it
duke@0 6 # under the terms of the GNU General Public License version 2 only, as
duke@0 7 # published by the Free Software Foundation. Sun designates this
duke@0 8 # particular file as subject to the "Classpath" exception as provided
duke@0 9 # by Sun in the LICENSE file that accompanied this code.
duke@0 10 #
duke@0 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 15 # accompanied this code).
duke@0 16 #
duke@0 17 # You should have received a copy of the GNU General Public License version
duke@0 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 20 #
duke@0 21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@0 22 # CA 95054 USA or visit www.sun.com if you need additional information or
duke@0 23 # have any questions.
duke@0 24 #
duke@0 25
duke@0 26 #
duke@0 27 # Makefile for building Pack200
duke@0 28 #
duke@0 29
duke@0 30 BUILDDIR = ../../../..
duke@0 31 PACKAGE = com.sun.java.util.jar.pack
duke@0 32 LIBRARY = unpack
duke@0 33 PRODUCT = sun
duke@0 34 PGRM = unpack200
duke@0 35 include $(BUILDDIR)/common/Defs.gmk
duke@0 36
duke@0 37 CPLUSPLUSLIBRARY=true
duke@0 38
duke@0 39 FILES_m = mapfile-vers
duke@0 40 include $(BUILDDIR)/common/Mapfile-vers.gmk
duke@0 41
duke@0 42 #
duke@0 43 # Files to compile
duke@0 44 #
duke@0 45 AUTO_FILES_JAVA_DIRS = com/sun/java/util/jar/pack
duke@0 46
duke@0 47 include FILES_cpp.gmk
duke@0 48
duke@0 49 FILES_export = $(PKGDIR)/NativeUnpack.java
duke@0 50
duke@0 51 #
duke@0 52 # Rules
duke@0 53 include $(BUILDDIR)/common/Library.gmk
duke@0 54
duke@0 55 build: unpacker
duke@0 56
duke@0 57 vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)
duke@0 58
duke@0 59
duke@0 60
duke@0 61
duke@0 62
duke@0 63 ifeq ($(STANDALONE),true)
duke@0 64 ZIPOBJDIR = $(OUTPUTDIR)/tmp/sun/java.util.zip/zip/$(OBJDIRNAME)
duke@0 65
duke@0 66 ZIPOBJS = $(ZIPOBJDIR)/zcrc32.$(OBJECT_SUFFIX) \
duke@0 67 $(ZIPOBJDIR)/deflate.$(OBJECT_SUFFIX) \
duke@0 68 $(ZIPOBJDIR)/trees.$(OBJECT_SUFFIX) \
duke@0 69 $(ZIPOBJDIR)/zadler32.$(OBJECT_SUFFIX) \
duke@0 70 $(ZIPOBJDIR)/zutil.$(OBJECT_SUFFIX) \
duke@0 71 $(ZIPOBJDIR)/inflate.$(OBJECT_SUFFIX) \
duke@0 72 $(ZIPOBJDIR)/infblock.$(OBJECT_SUFFIX) \
duke@0 73 $(ZIPOBJDIR)/infcodes.$(OBJECT_SUFFIX) \
duke@0 74 $(ZIPOBJDIR)/inftrees.$(OBJECT_SUFFIX) \
duke@0 75 $(ZIPOBJDIR)/infutil.$(OBJECT_SUFFIX) \
duke@0 76 $(ZIPOBJDIR)/inffast.$(OBJECT_SUFFIX)
duke@0 77
duke@0 78 ZINCLUDE=-I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
duke@0 79 OTHER_CXXFLAGS += $(ZINCLUDE)
duke@0 80 LDDFLAGS += $(ZIPOBJS)
duke@0 81 else
duke@0 82 OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI
duke@0 83 OTHER_LDLIBS += $(JVMLIB)
duke@0 84 endif
duke@0 85
duke@0 86 CXXFLAGS_DBG += -DFULL
duke@0 87 CXXFLAGS_OPT += -DPRODUCT
duke@0 88 CXXFLAGS_COMMON += -DFULL
duke@0 89
duke@0 90 ifeq ($(PLATFORM), windows)
duke@0 91 CXXFLAGS_COMMON += $(MS_RUNTIME_OPTION)
duke@0 92 LDOUTPUT = -Fe
duke@0 93
duke@0 94 # J2SE name required here
duke@0 95 RC_FLAGS += /D "J2SE_FNAME=$(PGRM).exe" \
duke@0 96 /D "J2SE_INTERNAL_NAME=$(PGRM)" \
duke@0 97 /D "J2SE_FTYPE=0x1L"
duke@0 98
duke@0 99 RES = $(OBJDIR)/$(PGRM).res
duke@0 100 else
duke@0 101 LDOUTPUT = -o #Have a space
duke@0 102 LDDFLAGS += -lc
duke@0 103 OTHER_LDLIBS += $(LIBCXX)
duke@0 104 # setup the list of libraries to link in...
duke@0 105 ifeq ($(PLATFORM), linux)
duke@0 106 ifeq ("$(CC_VER_MAJOR)", "3")
duke@0 107 OTHER_LDLIBS += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
duke@0 108 endif
duke@0 109 endif #LINUX
duke@0 110 endif #PLATFORM
duke@0 111
duke@0 112 UNPACK_EXE = $(BINDIR)/unpack200$(EXE_SUFFIX)
duke@0 113
duke@0 114 UNPACK_EXE_FILES_cpp = $(filter-out jni.cpp,$(FILES_cpp))
duke@0 115
duke@0 116 UNPACK_EXE_FILES_cpp += main.cpp
duke@0 117
duke@0 118 UNPACK_EXE_FILES_o = $(addprefix $(COBJDIR)/, \
duke@0 119 $(notdir \
duke@0 120 $(patsubst %.cpp,%.$(OBJECT_SUFFIX),$(UNPACK_EXE_FILES_cpp)) \
duke@0 121 ))
duke@0 122
duke@0 123 COBJDIR = $(strip $(subst unpack,unpack-cmd,$(OBJDIR)))
duke@0 124
duke@0 125 all: build
duke@0 126
duke@0 127 build: prop
duke@0 128
duke@0 129 prop:
duke@0 130 $(MAKE) -C prop
duke@0 131
duke@0 132 unpacker:
duke@0 133 $(MAKE) $(UNPACK_EXE) STANDALONE=true LDMAPFLAGS_OPT= LDMAPFLAGS_DBG=
duke@0 134
duke@0 135 ifeq ($(PLATFORM), windows)
duke@0 136 winres:: $(RES)
duke@0 137 else
duke@0 138 winres::
duke@0 139 $(ECHO) "Resource files not required for Unix"
duke@0 140 endif
duke@0 141
duke@0 142 $(UNPACK_EXE): $(UNPACK_EXE_FILES_o) winres
duke@0 143 $(prep-target)
duke@0 144 $(LINKER) $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
duke@0 145 $(CP) $(TEMPDIR)/unpack200$(EXE_SUFFIX) $(UNPACK_EXE)
duke@0 146
duke@0 147
duke@0 148 ifeq ($(PLATFORM), windows)
duke@0 149 $(RES):: $(VERSIONINFO_RESOURCE)
duke@0 150 $(prep-target)
duke@0 151 $(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE)
duke@0 152 endif
duke@0 153
duke@0 154 $(COBJDIR)/%.$(OBJECT_SUFFIX): %.cpp
duke@0 155 $(prep-target)
duke@0 156 $(COMPILE.cc) $(CC_OBJECT_OUTPUT_FLAG)$(COBJDIR)/$*.$(OBJECT_SUFFIX) $<
duke@0 157
duke@0 158 #
duke@0 159 # Clean up.
duke@0 160 #
duke@0 161 clean::
duke@0 162 $(RM) -r $(CLASSDESTDIR)/com/sun/java/util/jar/pack $(TEMPDIR)
duke@0 163 $(RM) -r $(OUTPUTDIR)/tmp/$(PRODUCT)/$(PACKAGE)
duke@0 164 $(MAKE) -C prop clean
duke@0 165
duke@0 166 .PHONY: unpacker clean winres prop