tools/Makefile
changeset 774 d0cbca26a17c
parent 16 33aaaec59991
child 975 44e81e837f1f
child 2855 576d5a7857b7
--- a/tools/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/tools/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -18,13 +18,34 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2010, Oracle and/or it's affiliates.  All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../make-rules/shared-macros.mk
 
-download setup prep build install publish validate:	time-$(MACH32).so \
-							time-$(MACH64).so
+download setup prep build install publish \
+validate:	links 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
+	@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 ; \
+	done
+
 
 time-$(MACH64).o:			BITS=64
 time-$(MACH32).o time-$(MACH64).o:	CFLAGS += -Kpic
@@ -36,7 +57,9 @@
 	$(LD) -G -o [email protected] $<
 
 clean:
-	$(RM) time-*.o
+	$(RM) time-*.o time*.bc
 
 clobber:	clean
-	$(RM) time-*.so
+	$(RM) time-*.so python/pkglint/*.pyc
+	$(RM) -r parfait
+