hotspot/src/share/tools/hsdis/Makefile
author goetz
Fri, 03 Jul 2015 16:29:37 +0200
changeset 31589 e0d5c4d48464
parent 22822 696e77cc8e7b
child 35075 ca79cbf3f106
permissions -rw-r--r--
8130432: ppc64le: Fix build of hsdis Reviewed-by: dholmes, kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
     1
#
17006
b9bfa72b7dda 7104565: trim jprt build targets
drchase
parents: 13873
diff changeset
     2
# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
     4
#
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
     7
# published by the Free Software Foundation.
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
     8
#
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    13
# accompanied this code).
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    14
#
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    18
#
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3261
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3261
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3261
diff changeset
    21
# questions.
17006
b9bfa72b7dda 7104565: trim jprt build targets
drchase
parents: 13873
diff changeset
    22
#
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    23
#
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    24
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    25
# Single gnu makefile for solaris, linux and windows (windows requires cygwin and mingw)
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    26
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    27
# Default arch; it is changed below as needed.
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    28
ARCH		= i386
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    29
OS		= $(shell uname)
22822
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
    30
AR		= ar
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    31
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    32
## OS = SunOS ##
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    33
ifeq		($(OS),SunOS)
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    34
CPU             = $(shell uname -p)
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    35
ARCH1=$(CPU:i586=i386)
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    36
ARCH=$(ARCH1:i686=i386)
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    37
OS		= solaris
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    38
CC 		= cc
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    39
CFLAGS		+= -KPIC
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    40
ifdef LP64
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    41
ifeq ($(ARCH),sparc)
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    42
ARCH            = sparcv9
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    43
endif
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    44
ifeq ($(ARCH),i386)
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    45
ARCH            = amd64
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    46
endif
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    47
endif
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    48
CFLAGS/sparcv9	+= -xarch=v9
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    49
CFLAGS/amd64	+= -m64
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    50
CFLAGS		+= $(CFLAGS/$(ARCH))
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    51
DLDFLAGS	+= -G
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    52
LDFLAGS         += -ldl
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    53
OUTFLAGS	+= -o $@
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    54
LIB_EXT		= .so
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    55
else
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    56
## OS = Linux ##
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    57
ifeq		($(OS),Linux)
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    58
ifneq           ($(MINGW),)
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    59
LIB_EXT		= .dll
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    60
CPPFLAGS += -I$(TARGET_DIR)/include
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    61
LDFLAGS += -L$(TARGET_DIR)/lib
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    62
OS=windows
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    63
ifneq           ($(findstring x86_64-,$(MINGW)),)
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    64
ARCH=amd64
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    65
else
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    66
ARCH=i386
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    67
endif
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    68
CC 		= $(MINGW)-gcc
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    69
CONFIGURE_ARGS= --host=$(MINGW) --target=$(MINGW)
17006
b9bfa72b7dda 7104565: trim jprt build targets
drchase
parents: 13873
diff changeset
    70
else   #linux
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    71
CPU             = $(shell uname -m)
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    72
ARCH1=$(CPU:x86_64=amd64)
31589
e0d5c4d48464 8130432: ppc64le: Fix build of hsdis
goetz
parents: 22822
diff changeset
    73
ARCH2=$(ARCH1:i686=i386)
e0d5c4d48464 8130432: ppc64le: Fix build of hsdis
goetz
parents: 22822
diff changeset
    74
ARCH=$(ARCH2:ppc64le=ppc64)
13873
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
    75
ifdef LP64
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
    76
CFLAGS/sparcv9	+= -m64
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
    77
CFLAGS/amd64	+= -m64
22822
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
    78
CFLAGS/ppc64	+= -m64
13873
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
    79
else
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
    80
ARCH=$(ARCH1:amd64=i386)
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    81
CFLAGS/i386	+= -m32
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    82
CFLAGS/sparc	+= -m32
13873
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
    83
endif
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    84
CFLAGS		+= $(CFLAGS/$(ARCH))
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    85
CFLAGS		+= -fPIC
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    86
OS		= linux
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    87
LIB_EXT		= .so
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    88
CC 		= gcc
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    89
endif
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    90
CFLAGS		+= -O
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    91
DLDFLAGS	+= -shared
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
    92
LDFLAGS         += -ldl
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
    93
OUTFLAGS	+= -o $@
22822
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
    94
else
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
    95
## OS = AIX ##
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
    96
ifeq		($(OS),AIX)
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
    97
OS              = aix
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
    98
ARCH            = ppc64
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
    99
CC              = xlc_r
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
   100
CFLAGS          += -DAIX -g -qpic=large -q64
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
   101
CFLAGS/ppc64    += -q64
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
   102
AR              = ar -X64
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
   103
DLDFLAGS        += -qmkshrobj -lz
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
   104
OUTFLAGS        += -o $@
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
   105
LIB_EXT		= .so
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
   106
else
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
   107
## OS = Darwin ##
13873
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   108
ifeq ($(OS),Darwin)
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   109
CPU             = $(shell uname -m)
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   110
ARCH1=$(CPU:x86_64=amd64)
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   111
ARCH=$(ARCH1:i686=i386)
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   112
ifdef LP64
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   113
CFLAGS/sparcv9  += -m64
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   114
CFLAGS/amd64    += -m64
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   115
else
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   116
ARCH=$(ARCH1:amd64=i386)
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   117
CFLAGS/i386     += -m32
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   118
CFLAGS/sparc    += -m32
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   119
endif # LP64
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   120
CFLAGS          += $(CFLAGS/$(ARCH))
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   121
CFLAGS          += -fPIC
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   122
OS              = macosx
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   123
LIB_EXT         = .dylib
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   124
CC              = gcc
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   125
CFLAGS          += -O
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   126
# CFLAGS        += -DZ_PREFIX
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   127
DLDFLAGS        += -shared
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   128
DLDFLAGS        += -lz
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   129
LDFLAGS         += -ldl
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   130
OUTFLAGS        += -o $@
22822
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
   131
else
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
   132
## OS = Windows ##
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   133
OS		= windows
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   134
CC		= gcc
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   135
CFLAGS		+=  /nologo /MD /W3 /WX /O2 /Fo$(@:.dll=.obj) /Gi-
13873
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   136
CFLAGS		+= LIBARCH=\"$(LIBARCH)\"
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   137
DLDFLAGS	+= /dll /subsystem:windows /incremental:no \
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   138
			/export:decode_instruction
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   139
OUTFLAGS	+= /link /out:$@
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   140
LIB_EXT		= .dll
13873
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   141
endif   # Darwin
22822
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
   142
endif   # AIX
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   143
endif	# Linux
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   144
endif	# SunOS
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   145
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   146
LIBARCH		= $(ARCH)
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   147
ifdef		LP64
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   148
LIBARCH64/sparc	= sparcv9
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   149
LIBARCH64/i386	= amd64
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   150
LIBARCH64	= $(LIBARCH64/$(ARCH))
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   151
ifneq		($(LIBARCH64),)
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   152
LIBARCH		= $(LIBARCH64)
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   153
endif   # LIBARCH64/$(ARCH)
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   154
endif   # LP64
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   155
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   156
JDKARCH=$(LIBARCH:i386=i586)
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   157
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   158
ifeq            ($(BINUTILS),)
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   159
# Pop all the way out of the workspace to look for binutils.
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   160
# ...You probably want to override this setting.
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   161
BINUTILSDIR	= $(shell cd build/binutils;pwd)
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   162
else
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   163
BINUTILSDIR	= $(shell cd $(BINUTILS);pwd)
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   164
endif
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   165
13873
7b72e3873785 6879063: SA should use hsdis for disassembly
minqi
parents: 5547
diff changeset
   166
CPPFLAGS	+= -I$(BINUTILSDIR)/include -I$(BINUTILSDIR)/bfd -I$(TARGET_DIR)/bfd
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   167
CPPFLAGS	+= -DLIBARCH_$(LIBARCH) -DLIBARCH=\"$(LIBARCH)\" -DLIB_EXT=\"$(LIB_EXT)\"
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   168
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   169
TARGET_DIR	= build/$(OS)-$(JDKARCH)
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   170
TARGET		= $(TARGET_DIR)/hsdis-$(LIBARCH)$(LIB_EXT)
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   171
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   172
SOURCE		= hsdis.c
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   173
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   174
LIBRARIES =	$(TARGET_DIR)/bfd/libbfd.a \
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   175
		$(TARGET_DIR)/opcodes/libopcodes.a \
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   176
		$(TARGET_DIR)/libiberty/libiberty.a
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   177
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   178
DEMO_TARGET	= $(TARGET_DIR)/hsdis-demo
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   179
DEMO_SOURCE	= hsdis-demo.c
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   180
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   181
.PHONY:  all clean demo both
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   182
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   183
all:  $(TARGET)
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   184
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   185
both: all all64
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   186
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   187
%64:
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   188
	$(MAKE) LP64=1 ${@:%64=%}
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   189
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   190
demo: $(TARGET) $(DEMO_TARGET)
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   191
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   192
$(LIBRARIES): $(TARGET_DIR) $(TARGET_DIR)/Makefile
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   193
	if [ ! -f $@ ]; then cd $(TARGET_DIR); make all-opcodes; fi
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   194
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   195
$(TARGET_DIR)/Makefile:
22822
696e77cc8e7b 8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
simonis
parents: 17006
diff changeset
   196
	(cd $(TARGET_DIR); CC=$(CC) CFLAGS="$(CFLAGS)" AR="$(AR)" $(BINUTILSDIR)/configure --disable-nls $(CONFIGURE_ARGS))
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   197
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   198
$(TARGET): $(SOURCE) $(LIBS) $(LIBRARIES) $(TARGET_DIR)
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   199
	$(CC) $(OUTFLAGS) $(CPPFLAGS) $(CFLAGS) $(SOURCE) $(DLDFLAGS) $(LIBRARIES)
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   200
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   201
$(DEMO_TARGET): $(DEMO_SOURCE) $(TARGET) $(TARGET_DIR)
2564
85c3ae53ca1c 6684007: PrintAssembly plugin not available for linux or windows
never
parents: 347
diff changeset
   202
	$(CC) $(OUTFLAGS) -DTARGET_DIR=\"$(TARGET_DIR)\" $(CPPFLAGS) -g $(CFLAGS/$(ARCH)) $(DEMO_SOURCE) $(LDFLAGS)
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   203
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   204
$(TARGET_DIR):
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   205
	[ -d $@ ] || mkdir -p $@
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   206
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   207
clean:
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents:
diff changeset
   208
	rm -rf $(TARGET_DIR)