Commits

Anonymous committed 41aeb1f

Fix MACH32/MACH64 so more than one architecture can build in the same workspace

  • Participants
  • Parent commits 0839bb4

Comments (0)

Files changed (8)

components/file/Makefile

 PKGMOGRIFY_TRANSFORMS +=	$(WS_TOP)/transforms/libtool-drop
 
 # common targets
-build:		$(COMPONENT_SRC)/build-32/.built \
-		$(COMPONENT_SRC)/build-64/.built
+build:		$(BUILD_32_and_64)
 
-install:	$(COMPONENT_SRC)/build-32/.installed \
-		$(COMPONENT_SRC)/build-64/.installed
+install:	$(INSTALL_32_and_64)
 
 BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)

components/lcms/Makefile

 COMPONENT_PREP_ACTION=	$(RM) $(@D)/include/icc34.h
 
 # common targets
-build:		$(COMPONENT_SRC)/build-32/.built \
-		$(COMPONENT_SRC)/build-64/.built
+build:		$(BUILD_32_and_64)
 
-install:	$(COMPONENT_SRC)/build-32/.installed \
-		$(COMPONENT_SRC)/build-64/.installed
+install:	$(INSTALL_32_and_64)
 
 BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)

components/pycups/Makefile

 PYTHON_ENV +=	CFLAGS=-DVERSION=\\\"$(COMPONENT_VERSION)\\\"
 
 # common targets
-build:		$(COMPONENT_SRC)/build-32/.built \
-		$(COMPONENT_SRC)/build-64/.built
+build:		$(BUILD_32_and_64)
 
-install:	$(COMPONENT_SRC)/build-32/.installed \
-		$(COMPONENT_SRC)/build-64/.installed
+install:	$(INSTALL_32_and_64)
 
 BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)

make-rules/configure.mk

 # and define "build", "install" targets appropriate to building your component.
 # Ex:
 #
-# 	build:		$(COMPONENT_SRC)/build-32/.built \
-#	 		$(COMPONENT_SRC)/build-64/.built
+# 	build:		$(COMPONENT_SRC)/build-$(MACH32)/.built \
+#	 		$(COMPONENT_SRC)/build-$(MACH64)/.built
 # 
-#	install:	$(COMPONENT_SRC)/build-32/.installed \
-#	 		$(COMPONENT_SRC)/build-64/.installed
+#	install:	$(COMPONENT_SRC)/build-$(MACH32)/.installed \
+#	 		$(COMPONENT_SRC)/build-$(MACH64)/.installed
 #
 # Any additional pre/post configure, build, or install actions can be specified
 # in your make file by setting them in on of the following macros:
 CONFIGURE_OPTIONS.64 = --bindir=/usr/bin/$(MACH64)
 CONFIGURE_OPTIONS.64 += --libdir=/usr/lib/$(MACH64)
 
-$(COMPONENT_SRC)/build-32/.configured:	BITS=32
-$(COMPONENT_SRC)/build-64/.configured:	BITS=64
+$(COMPONENT_SRC)/build-$(MACH32)/.configured:	BITS=32
+$(COMPONENT_SRC)/build-$(MACH64)/.configured:	BITS=64
 
 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
 

make-rules/ips.mk

 # and define an "install" target appropriate to building your component.
 # Ex:
 #
-#	install:	$(COMPONENT_SRC)/build-32/.installed \
-#	 		$(COMPONENT_SRC)/build-64/.installed
+#	install:	$(COMPONENT_SRC)/build-$(MACH32)/.installed \
+#	 		$(COMPONENT_SRC)/build-$(MACH64)/.installed
 #
 # This set of rules makes the "publish" target the default target for make(1)
 #
 PKGMOGRIFY_TRANSFORMS +=	$(WS_TOP)/transforms/devel
 PKGMOGRIFY_TRANSFORMS +=	$(WS_TOP)/transforms/docs
 
+MANIFEST =	manifest-$(MACH)
+
 .DEFAULT:	publish
 
 publish:	$(COMPONENT_SRC)/.published
 $(PROTO_DIR)/$(COPYRIGHT_FILE):	$(COMPONENT_COPYRIGHT)
 	$(CP) $< $@
 
-$(COMPONENT_SRC)/manifest:	install
+$(COMPONENT_SRC)/$(MANIFEST):	install
 	pkgsend generate $(PROTO_DIR) >$@
 
-$(COMPONENT_SRC)/manifest.mog:	$(COMPONENT_SRC)/manifest $(PROTO_DIR)/$(COPYRIGHT_FILE)
+$(COMPONENT_SRC)/$(MANIFEST).mog:	$(COMPONENT_SRC)/$(MANIFEST) $(PROTO_DIR)/$(COPYRIGHT_FILE)
 	echo "set name=pkg.fmri value=pkg:/$(PUBLISHER)/$(COMPONENT_NAME)@$(COMPONENT_VERSION),$(BUILD_VERSION)" >$@
 	echo "set name=pkg.description value=\"$(COMPONENT_DESCRIPTION)\"" >>$@
 	echo "set name=pkg.name value=\"$(COMPONENT_DESCRIPTION)\"" >>$@
 	echo "license $(COPYRIGHT_FILE) license=$(COPYRIGHT_FILE)" >>$@
 	pkgmogrify $(PKGMOGRIFY_MACROS:%=-D %) $(PKGMOGRIFY_TRANSFORMS) $< >>$@
 
-$(COMPONENT_SRC)/manifest.fdeps:	$(COMPONENT_SRC)/manifest.mog
+$(COMPONENT_SRC)/$(MANIFEST).fdeps:	$(COMPONENT_SRC)/$(MANIFEST).mog
 	pkgdepend generate -m $< $(PROTO_DIR) >$@
 
-$(COMPONENT_SRC)/manifest.fdeps.res:	$(COMPONENT_SRC)/manifest.fdeps
+$(COMPONENT_SRC)/$(MANIFEST).fdeps.res:	$(COMPONENT_SRC)/$(MANIFEST).fdeps
 	pkgdepend resolve -m $<
 
-$(COMPONENT_SRC)/.published:	$(COMPONENT_SRC)/manifest.fdeps.res
+$(COMPONENT_SRC)/.published:	$(COMPONENT_SRC)/$(MANIFEST).fdeps.res
 	pkgsend -s $(PKG_REPO) publish --fmri-in-manifest \
 		-d $(PROTO_DIR) $<
 	$(TOUCH) $@

make-rules/prep.mk

 CLEAN_PATHS += $(COMPONENT_SRC)
 CLOBBER_PATHS += $(COMPONENT_ARCHIVE)
 
-#PATCHES =	$(shell ls *.patch) #find . -type f -name '*.patch'
 PATCHES =	$(shell find . -type f -name '*.patch' | \
 			 sed -e 's;^\./;;' | sort)
-STAMPS =	$(PATCHES:%=$(COMPONENT_SRC)/.patched.%)
+STAMPS =	$(PATCHES:%=$(COMPONENT_SRC)/.%ed)
 
-$(COMPONENT_SRC)/.patched.%:	%
+$(COMPONENT_SRC)/.%ed:	%
 	$(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $<
 	$(TOUCH) $@
 

make-rules/setup.py.mk

 # Copyright (c) 2010, Oracle and/or it's affiliates.  All rights reserved.
 #
 
-$(COMPONENT_SRC)/build-32/.built:	BITS=32
-$(COMPONENT_SRC)/build-64/.built:	BITS=64
-$(COMPONENT_SRC)/build-32/.installed:	BITS=32
-$(COMPONENT_SRC)/build-64/.installed:	BITS=64
+$(COMPONENT_SRC)/build-$(MACH32)/.built:	BITS=32
+$(COMPONENT_SRC)/build-$(MACH64)/.built:	BITS=32
+$(COMPONENT_SRC)/build-$(MACH32)/.installed:	BITS=32
+$(COMPONENT_SRC)/build-$(MACH64)/.installed:	BITS=64
 
 
 # build the configured source

make-rules/shared-macros.mk

 MAKE_RULES =	$(WS_TOP)/components/make-rules
 
 PKG_REPO =	file://$(WS_TOP)/repo
-PROTO_DIR =	$(shell pwd)/$(COMPONENT_SRC)/installed-prototype
+PROTO_DIR =	$(shell pwd)/$(COMPONENT_SRC)/installed-prototype-$(MACH)
 
 CONSTANT_TIME =	LD_PRELOAD=$(TOOLS)/time.o
 
-MACH64 =	$(shell isainfo -k)
+# set MACH from uname -p to either sparc or i386
+MACH =		$(shell uname -p)
+
+# set MACH32 from MACH to either sparcv7 or i86
+MACH32_1 =	$(MACH:sparc=sparcv7)
+MACH32 =	$(MACH32_1:i386=i86)
+
+# set MACH64 from MACH to either sparcv9 or amd64
+MACH64_1 =	$(MACH:sparc=sparcv9)
+MACH64 =	$(MACH64_1:i386=amd64)
+
+BUILD_32 =		$(COMPONENT_SRC)/build-$(MACH32)/.built
+BUILD_64 =		$(COMPONENT_SRC)/build-$(MACH64)/.built
+BUILD_32_and_64 =	$(BUILD_32) $(BUILD_64)
+
+INSTALL_32 =		$(COMPONENT_SRC)/build-$(MACH32)/.installed
+INSTALL_64 =		$(COMPONENT_SRC)/build-$(MACH64)/.installed
+INSTALL_32_and_64 =	$(INSTALL_32) $(INSTALL_64)
 
 SPRO_ROOT =	/opt/sunstudio12.1
 GCC_ROOT =	/usr/gnu