equal
deleted
inserted
replaced
1 # |
1 # |
2 # Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. |
2 # Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 # |
4 # |
5 # This code is free software; you can redistribute it and/or modify it |
5 # This code is free software; you can redistribute it and/or modify it |
6 # under the terms of the GNU General Public License version 2 only, as |
6 # under the terms of the GNU General Public License version 2 only, as |
7 # published by the Free Software Foundation. |
7 # published by the Free Software Foundation. |
64 else |
64 else |
65 ARCH=i386 |
65 ARCH=i386 |
66 endif |
66 endif |
67 CC = $(MINGW)-gcc |
67 CC = $(MINGW)-gcc |
68 CONFIGURE_ARGS= --host=$(MINGW) --target=$(MINGW) |
68 CONFIGURE_ARGS= --host=$(MINGW) --target=$(MINGW) |
69 else |
69 else #linux |
70 CPU = $(shell uname -m) |
70 CPU = $(shell uname -m) |
71 ARCH1=$(CPU:x86_64=amd64) |
71 ARCH1=$(CPU:x86_64=amd64) |
72 ARCH=$(ARCH1:i686=i386) |
72 ARCH=$(ARCH1:i686=i386) |
|
73 ifdef LP64 |
|
74 CFLAGS/sparcv9 += -m64 |
|
75 CFLAGS/amd64 += -m64 |
|
76 else |
|
77 ARCH=$(ARCH1:amd64=i386) |
73 CFLAGS/i386 += -m32 |
78 CFLAGS/i386 += -m32 |
74 CFLAGS/sparc += -m32 |
79 CFLAGS/sparc += -m32 |
75 CFLAGS/sparcv9 += -m64 |
80 endif |
76 CFLAGS/amd64 += -m64 |
|
77 CFLAGS += $(CFLAGS/$(ARCH)) |
81 CFLAGS += $(CFLAGS/$(ARCH)) |
78 CFLAGS += -fPIC |
82 CFLAGS += -fPIC |
79 OS = linux |
83 OS = linux |
80 LIB_EXT = .so |
84 LIB_EXT = .so |
81 CC = gcc |
85 CC = gcc |
83 CFLAGS += -O |
87 CFLAGS += -O |
84 DLDFLAGS += -shared |
88 DLDFLAGS += -shared |
85 LDFLAGS += -ldl |
89 LDFLAGS += -ldl |
86 OUTFLAGS += -o $@ |
90 OUTFLAGS += -o $@ |
87 ## OS = Windows ## |
91 ## OS = Windows ## |
88 else # !SunOS, !Linux => Windows |
92 else # !SunOS, !Linux => Darwin or Windows |
|
93 ifeq ($(OS),Darwin) |
|
94 CPU = $(shell uname -m) |
|
95 ARCH1=$(CPU:x86_64=amd64) |
|
96 ARCH=$(ARCH1:i686=i386) |
|
97 ifdef LP64 |
|
98 CFLAGS/sparcv9 += -m64 |
|
99 CFLAGS/amd64 += -m64 |
|
100 else |
|
101 ARCH=$(ARCH1:amd64=i386) |
|
102 CFLAGS/i386 += -m32 |
|
103 CFLAGS/sparc += -m32 |
|
104 endif # LP64 |
|
105 CFLAGS += $(CFLAGS/$(ARCH)) |
|
106 CFLAGS += -fPIC |
|
107 OS = macosx |
|
108 LIB_EXT = .dylib |
|
109 CC = gcc |
|
110 CFLAGS += -O |
|
111 # CFLAGS += -DZ_PREFIX |
|
112 DLDFLAGS += -shared |
|
113 DLDFLAGS += -lz |
|
114 LDFLAGS += -ldl |
|
115 OUTFLAGS += -o $@ |
|
116 else #Windows |
89 OS = windows |
117 OS = windows |
90 CC = gcc |
118 CC = gcc |
91 #CPPFLAGS += /D"WIN32" /D"_WINDOWS" /D"DEBUG" /D"NDEBUG" |
119 #CPPFLAGS += /D"WIN32" /D"_WINDOWS" /D"DEBUG" /D"NDEBUG" |
92 CFLAGS += /nologo /MD /W3 /WX /O2 /Fo$(@:.dll=.obj) /Gi- |
120 CFLAGS += /nologo /MD /W3 /WX /O2 /Fo$(@:.dll=.obj) /Gi- |
93 CFLAGS += LIBARCH=\"$(LIBARCH)\"" |
121 CFLAGS += LIBARCH=\"$(LIBARCH)\" |
94 DLDFLAGS += /dll /subsystem:windows /incremental:no \ |
122 DLDFLAGS += /dll /subsystem:windows /incremental:no \ |
95 /export:decode_instruction |
123 /export:decode_instruction |
96 OUTFLAGS += /link /out:$@ |
124 OUTFLAGS += /link /out:$@ |
97 LIB_EXT = .dll |
125 LIB_EXT = .dll |
|
126 endif # Darwin |
98 endif # Linux |
127 endif # Linux |
99 endif # SunOS |
128 endif # SunOS |
100 |
129 |
101 LIBARCH = $(ARCH) |
130 LIBARCH = $(ARCH) |
102 ifdef LP64 |
131 ifdef LP64 |
116 BINUTILSDIR = $(shell cd build/binutils;pwd) |
145 BINUTILSDIR = $(shell cd build/binutils;pwd) |
117 else |
146 else |
118 BINUTILSDIR = $(shell cd $(BINUTILS);pwd) |
147 BINUTILSDIR = $(shell cd $(BINUTILS);pwd) |
119 endif |
148 endif |
120 |
149 |
121 CPPFLAGS += -I$(BINUTILSDIR)/include -I$(BINUTILS)/bfd -I$(TARGET_DIR)/bfd |
150 CPPFLAGS += -I$(BINUTILSDIR)/include -I$(BINUTILSDIR)/bfd -I$(TARGET_DIR)/bfd |
122 CPPFLAGS += -DLIBARCH_$(LIBARCH) -DLIBARCH=\"$(LIBARCH)\" -DLIB_EXT=\"$(LIB_EXT)\" |
151 CPPFLAGS += -DLIBARCH_$(LIBARCH) -DLIBARCH=\"$(LIBARCH)\" -DLIB_EXT=\"$(LIB_EXT)\" |
123 |
152 |
124 TARGET_DIR = build/$(OS)-$(JDKARCH) |
153 TARGET_DIR = build/$(OS)-$(JDKARCH) |
125 TARGET = $(TARGET_DIR)/hsdis-$(LIBARCH)$(LIB_EXT) |
154 TARGET = $(TARGET_DIR)/hsdis-$(LIBARCH)$(LIB_EXT) |
126 |
155 |