tools/Makefile
branchs11-update
changeset 2855 576d5a7857b7
parent 774 d0cbca26a17c
child 2914 4f1967424876
--- a/tools/Makefile	Wed Dec 18 04:50:56 2013 -0800
+++ b/tools/Makefile	Wed Dec 18 10:04:53 2013 -0800
@@ -18,48 +18,63 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../make-rules/shared-macros.mk
 
 download setup prep build install publish \
-validate:	links time-$(MACH32).so time-$(MACH64).so
+validate:	links pkglint time-$(MACH32).so time-$(MACH64).so
 
 # generate wrappers for parfait. we need to generate them
 # with the correct compiler variables from the common makefiles because
 # some things reset the environment which causes lovely infinite
 # loops
 links:
-	$(MKDIR) parfait
+	@$(MKDIR) $(PARFAIT_TOOLS)
 	@for i in cc CC gcc g++ ld ; do \
-		$(MKDIR) parfait ; \
-		$(RM) parfait/$$i ; \
-		echo "#!/bin/ksh" > parfait/$$i ; \
-		echo "IFS=" >> parfait/$$i ; \
-		echo "export PARFAIT_NATIVESUNCC=$(SPRO_VROOT)/bin/cc" >> parfait/$$i ; \
-		echo "export PARFAIT_NATIVESUNCXX=$(SPRO_VROOT)/bin/CC" >> parfait/$$i ; \
-		echo "export PARFAIT_NATIVEGCC=$(GCC_ROOT)/bin/gcc" >> parfait/$$i ; \
-		echo "export PARFAIT_NATIVEGXX=$(GCC_ROOT)/bin/g++" >> parfait/$$i ; \
-		echo "export PARFAIT_CLANG="$(PARFAIT_CLANG) >> parfait/$$i ; \
-		echo "exec" $(PARFAIT_ROOT)/bin/parfait-$$i '$$*' >> parfait/$$i ; \
-		chmod +x parfait/$$i ; \
+		$(RM) $(PARFAIT_TOOLS)/$$i ; \
+		echo "#!/bin/ksh" > $(PARFAIT_TOOLS)/$$i ; \
+		echo "IFS=" >> $(PARFAIT_TOOLS)/$$i ; \
+		echo "export PARFAIT_NATIVESUNCC=$(SPRO_VROOT)/bin/cc" >> $(PARFAIT_TOOLS)/$$i ; \
+		echo "export PARFAIT_NATIVESUNCXX=$(SPRO_VROOT)/bin/CC" >> $(PARFAIT_TOOLS)/$$i ; \
+		echo "export PARFAIT_NATIVEGCC=$(GCC_ROOT)/bin/gcc" >> $(PARFAIT_TOOLS)/$$i ; \
+		echo "export PARFAIT_NATIVEGXX=$(GCC_ROOT)/bin/g++" >> $(PARFAIT_TOOLS)/$$i ; \
+		echo "export PARFAIT_NATIVELD=/usr/bin/ld" >> $(PARFAIT_TOOLS)/$$i ; \
+		echo "exec" $(PARFAIT_ROOT)/$(MACH)/parfait-$$i '$$*' >> $(PARFAIT_TOOLS)/$$i ; \
+		chmod +x $(PARFAIT_TOOLS)/$$i ; \
 	done
+	@$(MKDIR) $(PARFAIT_TOOLS_GCC3)
+	@for i in cc CC gcc g++ ld ; do \
+		$(RM) $(PARFAIT_TOOLS_GCC3)/$$i ; \
+		sed \
+		    -e "s,$(GCC_ROOT),$(GCC3_ROOT)," < $(PARFAIT_TOOLS)/$$i \
+		    > $(PARFAIT_TOOLS_GCC3)/$$i ; \
+		chmod +x $(PARFAIT_TOOLS_GCC3)/$$i ; \
+	done
+
+pkglint:
+	@rm -f pkglint
+	@sed -e "s,WS_TOP_XXX,$(WS_TOP)/$(MACH)," \
+	    < pkglint.sh \
+	    > pkglint
+	@chmod +x pkglint
 
 
 time-$(MACH64).o:			BITS=64
 time-$(MACH32).o time-$(MACH64).o:	CFLAGS += -Kpic
 
 time-$(MACH32).o time-$(MACH64).o:	time.c
-	$(CC) $(CFLAGS) -c -o [email protected] $<
+	@$(CC) $(CFLAGS) -c -o [email protected] $<
 
 time-%.so:	time-%.o
-	$(LD) -G -o [email protected] $<
+	@$(LD) -G -o [email protected] $<
 
 clean:
-	$(RM) time-*.o time*.bc
+	@$(RM) time-*.o time*.bc
+	@$(RM) pkglint
 
 clobber:	clean
-	$(RM) time-*.so python/pkglint/*.pyc
-	$(RM) -r parfait
+	@$(RM) time-*.so python/pkglint/*.pyc
+	@$(RM) -r $(PARFAIT_TOOLS) $(PARFAIT_TOOLS_GCC3) $(MACH)