1 # -*- Makefile -*- rules commonly shared among X consolidation open source dirs |
1 # -*- Makefile -*- rules commonly shared among X consolidation open source dirs |
2 # Makefile.init has definitions that are needed before the module/modtype rules |
2 # Makefile.init has definitions that are needed before the module/modtype rules |
3 # |
3 # |
4 # Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. |
4 # Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. |
5 # Use subject to license terms. |
5 # Use subject to license terms. |
6 # |
6 # |
7 # Permission is hereby granted, free of charge, to any person obtaining a |
7 # Permission is hereby granted, free of charge, to any person obtaining a |
8 # copy of this software and associated documentation files (the |
8 # copy of this software and associated documentation files (the |
9 # "Software"), to deal in the Software without restriction, including |
9 # "Software"), to deal in the Software without restriction, including |
27 # Except as contained in this notice, the name of a copyright holder |
27 # Except as contained in this notice, the name of a copyright holder |
28 # shall not be used in advertising or otherwise to promote the sale, use |
28 # shall not be used in advertising or otherwise to promote the sale, use |
29 # or other dealings in this Software without prior written authorization |
29 # or other dealings in this Software without prior written authorization |
30 # of the copyright holder. |
30 # of the copyright holder. |
31 # |
31 # |
32 # @(#)Makefile.init 1.5 08/10/06 |
32 # @(#)Makefile.init 1.6 09/01/14 |
33 # |
33 # |
34 |
34 |
35 # Use ksh93 for shell commands in Makefiles so that builds are the same |
35 # Use ksh93 for shell commands in Makefiles so that builds are the same |
36 # on Nevada (where /bin/sh is still ancient Bourne shell) and Indiana |
36 # on Nevada (where /bin/sh is still ancient Bourne shell) and Indiana |
37 # (where /bin/sh is ksh93) |
37 # (where /bin/sh is ksh93) |
85 # Our default compiler is Sun Studio, but if you want to default to GNU |
85 # Our default compiler is Sun Studio, but if you want to default to GNU |
86 # compilers, you can change this here - some modules with specific |
86 # compilers, you can change this here - some modules with specific |
87 # requirements override this in their makefiles with MODULE_COMPILER. |
87 # requirements override this in their makefiles with MODULE_COMPILER. |
88 DEFAULT_COMPILER = suncc |
88 DEFAULT_COMPILER = suncc |
89 |
89 |
|
90 # Flags used by either compiler in debug builds |
|
91 DEBUG_FLAGS_common = -g $(MODTYPE_DEBUG_FLAGS) $(MODULE_DEBUG_FLAGS) |
|
92 |
90 ## Sun Studio |
93 ## Sun Studio |
91 CC_suncc = cc |
94 CC_suncc = cc |
92 CXX_suncc = CC |
95 CXX_suncc = CC |
93 OPT_FLAGS_suncc = -xO4 -xbuiltin=%none -xlibmil -xprefetch -xdepend |
96 OPT_FLAGS_suncc = -xO4 -xbuiltin=%none -xlibmil -xprefetch -xdepend |
94 DEBUG_FLAGS_suncc = -g |
97 DEBUG_FLAGS_suncc = $(DEBUG_FLAGS_common) |
95 $(BUILD_DEBUG:yes=) DEBUG_OR_OPT_FLAGS_suncc = $(DEBUG_FLAGS_suncc) |
98 $(BUILD_DEBUG:yes=) DEBUG_OR_OPT_FLAGS_suncc = $(DEBUG_FLAGS_suncc) |
96 $(BUILD_DEBUG:yes=$(POUND_SIGN)) DEBUG_OR_OPT_FLAGS_suncc = $(OPT_FLAGS_suncc) |
99 $(BUILD_DEBUG:yes=$(POUND_SIGN)) DEBUG_OR_OPT_FLAGS_suncc = $(OPT_FLAGS_suncc) |
97 |
100 |
98 CFLAGS_suncc = $(DEBUG_OR_OPT_FLAGS_suncc) -v -mc -xstrconst |
101 CFLAGS_suncc = $(DEBUG_OR_OPT_FLAGS_suncc) -v -mc -xstrconst \ |
|
102 -features=extensions |
99 CXXFLAGS_suncc = $(DEBUG_OR_OPT_FLAGS_suncc) +w -mc -norunpath |
103 CXXFLAGS_suncc = $(DEBUG_OR_OPT_FLAGS_suncc) +w -mc -norunpath |
100 |
104 |
101 ARCH32_FLAGS_sparc_suncc = -xarch=v8plus |
105 ARCH32_FLAGS_sparc_suncc = -m32 -xarch=sparc |
102 ARCH64_FLAGS_sparc_suncc = -xarch=v9 |
106 ARCH64_FLAGS_sparc_suncc = -m64 -xarch=sparc |
103 |
107 |
104 # -xregs=no%frameptr is required on x86 when compiling at -xO4 or higher to |
108 # -xregs=no%frameptr is required on x86 when compiling at -xO4 or higher to |
105 # avoid losing stack frame pointers so you can't get stack traces or debug |
109 # avoid losing stack frame pointers so you can't get stack traces or debug |
106 ARCH32_FLAGS_i386_suncc = -xtarget=pentium -xregs=no%frameptr |
110 ARCH32_FLAGS_i386_suncc = -m32 -xtarget=pentium -xregs=no%frameptr |
107 ARCH64_FLAGS_i386_suncc = -xarch=generic64 -xregs=no%frameptr |
111 ARCH64_FLAGS_i386_suncc = -m64 -xarch=sse2 -xregs=no%frameptr |
108 |
112 |
109 # SPARC ABI requires system libraries not use application registers |
113 # SPARC ABI requires system libraries not use application registers |
110 ARCH_LIB_FLAGS_sparc_suncc = -xregs=no%appl |
114 ARCH_LIB_FLAGS_sparc_suncc = -xregs=no%appl |
111 ARCH_LIB_FLAGS_i386_suncc = |
115 ARCH_LIB_FLAGS_i386_suncc = |
112 |
116 |
114 GCC = /usr/sfw/bin/gcc |
118 GCC = /usr/sfw/bin/gcc |
115 GXX = /usr/sfw/bin/g++ |
119 GXX = /usr/sfw/bin/g++ |
116 CC_gcc = $(GCC) |
120 CC_gcc = $(GCC) |
117 CXX_gcc = $(GXX) |
121 CXX_gcc = $(GXX) |
118 OPT_FLAGS_gcc = -O3 |
122 OPT_FLAGS_gcc = -O3 |
119 DEBUG_FLAGS_gcc = -g |
123 DEBUG_FLAGS_gcc = $(DEBUG_FLAGS_common) |
120 $(BUILD_DEBUG:yes=) DEBUG_OR_OPT_FLAGS_gcc = $(DEBUG_FLAGS_gcc) |
124 $(BUILD_DEBUG:yes=) DEBUG_OR_OPT_FLAGS_gcc = $(DEBUG_FLAGS_gcc) |
121 $(BUILD_DEBUG:yes=$(POUND_SIGN)) DEBUG_OR_OPT_FLAGS_gcc = $(OPT_FLAGS_gcc) |
125 $(BUILD_DEBUG:yes=$(POUND_SIGN)) DEBUG_OR_OPT_FLAGS_gcc = $(OPT_FLAGS_gcc) |
122 CFLAGS_gcc = $(DEBUG_OR_OPT_FLAGS_gcc) \ |
126 CFLAGS_gcc = $(DEBUG_OR_OPT_FLAGS_gcc) \ |
123 -fno-omit-frame-pointer -Wall |
127 -fno-omit-frame-pointer -Wall |
124 CXXFLAGS_gcc = $(DEBUG_OR_OPT_FLAGS_gcc) \ |
128 CXXFLAGS_gcc = $(DEBUG_OR_OPT_FLAGS_gcc) \ |
238 |
242 |
239 SERVERMOD_subdir_sparc= |
243 SERVERMOD_subdir_sparc= |
240 SERVERMOD_subdir_i386=$(ARCHLIBSUBDIR) |
244 SERVERMOD_subdir_i386=$(ARCHLIBSUBDIR) |
241 SERVERMOD_subdir=$(SERVERMOD_subdir_$(MACH)) |
245 SERVERMOD_subdir=$(SERVERMOD_subdir_$(MACH)) |
242 |
246 |
|
247 # PKGCONFIG_DIR is constructed of _prefix + ARCHLIBSUBDIR + _suffix |
|
248 PKGCONFIG_DIR_prefix=/usr/lib |
|
249 PKGCONFIG_DIR_suffix=/pkgconfig |
|
250 PKGCONFIG_DIR=$(PKGCONFIG_DIR_prefix)$(ARCHLIBSUBDIR)$(PKGCONFIG_DIR_suffix) |
|
251 PKGCONFIG_DIR_32=$(PKGCONFIG_DIR_prefix)$(PKGCONFIG_DIR_suffix) |
|
252 PKGCONFIG_DIR_64=$(PKGCONFIG_DIR_prefix)/$(SUBDIR64)$(PKGCONFIG_DIR_suffix) |
|
253 |
243 # Directory used for installing tools used during build but not |
254 # Directory used for installing tools used during build but not |
244 # delivered in packages |
255 # delivered in packages |
245 TOOLS_DIR=/tools |
256 TOOLS_DIR=/tools |
246 |
257 |
247 # Directory that license files are copied to for use in building package |
258 # Directory that license files are copied to for use in building package |
284 FDO_GIT_URL=http://anongit.freedesktop.org/git |
295 FDO_GIT_URL=http://anongit.freedesktop.org/git |
285 XORG_GIT_URL=$(FDO_GIT_URL)/xorg |
296 XORG_GIT_URL=$(FDO_GIT_URL)/xorg |
286 |
297 |
287 # Target created when sources are unpacked |
298 # Target created when sources are unpacked |
288 UNPACK_FILE = .unpack_done |
299 UNPACK_FILE = .unpack_done |
289 UNPACK_TARGET = $(BUILD_DIR)/$(UNPACK_FILE) |
300 UNPACK_TARGET = $(SOURCE_DIR)/$(UNPACK_FILE) |
290 |
301 |
291 ### Dependencies |
302 ### Dependencies |
292 # Need to define more dependencies to enable simpler builds of subtree portions |
303 # Need to define more dependencies to enable simpler builds of subtree portions |
293 |
304 |
294 # Almost everything depends on the headers in xproto |
305 # Almost everything depends on the headers in xproto |
295 XPROTO_DEP=$(PROTODIR)/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig/xproto.pc |
306 XPROTO_DEP=$(PROTODIR)$(PKGCONFIG_DIR)/xproto.pc |