tools/Makefile
branchs11-update
changeset 2855 576d5a7857b7
parent 774 d0cbca26a17c
child 2914 4f1967424876
equal deleted inserted replaced
2854:78392507fd82 2855:576d5a7857b7
    16 # fields enclosed by brackets "[]" replaced with your own identifying
    16 # fields enclosed by brackets "[]" replaced with your own identifying
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
    18 #
    18 #
    19 # CDDL HEADER END
    19 # CDDL HEADER END
    20 #
    20 #
    21 # Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
    21 # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
    22 #
    22 #
    23 
    23 
    24 include ../make-rules/shared-macros.mk
    24 include ../make-rules/shared-macros.mk
    25 
    25 
    26 download setup prep build install publish \
    26 download setup prep build install publish \
    27 validate:	links time-$(MACH32).so time-$(MACH64).so
    27 validate:	links pkglint time-$(MACH32).so time-$(MACH64).so
    28 
    28 
    29 # generate wrappers for parfait. we need to generate them
    29 # generate wrappers for parfait. we need to generate them
    30 # with the correct compiler variables from the common makefiles because
    30 # with the correct compiler variables from the common makefiles because
    31 # some things reset the environment which causes lovely infinite
    31 # some things reset the environment which causes lovely infinite
    32 # loops
    32 # loops
    33 links:
    33 links:
    34 	$(MKDIR) parfait
    34 	@$(MKDIR) $(PARFAIT_TOOLS)
    35 	@for i in cc CC gcc g++ ld ; do \
    35 	@for i in cc CC gcc g++ ld ; do \
    36 		$(MKDIR) parfait ; \
    36 		$(RM) $(PARFAIT_TOOLS)/$$i ; \
    37 		$(RM) parfait/$$i ; \
    37 		echo "#!/bin/ksh" > $(PARFAIT_TOOLS)/$$i ; \
    38 		echo "#!/bin/ksh" > parfait/$$i ; \
    38 		echo "IFS=" >> $(PARFAIT_TOOLS)/$$i ; \
    39 		echo "IFS=" >> parfait/$$i ; \
    39 		echo "export PARFAIT_NATIVESUNCC=$(SPRO_VROOT)/bin/cc" >> $(PARFAIT_TOOLS)/$$i ; \
    40 		echo "export PARFAIT_NATIVESUNCC=$(SPRO_VROOT)/bin/cc" >> parfait/$$i ; \
    40 		echo "export PARFAIT_NATIVESUNCXX=$(SPRO_VROOT)/bin/CC" >> $(PARFAIT_TOOLS)/$$i ; \
    41 		echo "export PARFAIT_NATIVESUNCXX=$(SPRO_VROOT)/bin/CC" >> parfait/$$i ; \
    41 		echo "export PARFAIT_NATIVEGCC=$(GCC_ROOT)/bin/gcc" >> $(PARFAIT_TOOLS)/$$i ; \
    42 		echo "export PARFAIT_NATIVEGCC=$(GCC_ROOT)/bin/gcc" >> parfait/$$i ; \
    42 		echo "export PARFAIT_NATIVEGXX=$(GCC_ROOT)/bin/g++" >> $(PARFAIT_TOOLS)/$$i ; \
    43 		echo "export PARFAIT_NATIVEGXX=$(GCC_ROOT)/bin/g++" >> parfait/$$i ; \
    43 		echo "export PARFAIT_NATIVELD=/usr/bin/ld" >> $(PARFAIT_TOOLS)/$$i ; \
    44 		echo "export PARFAIT_CLANG="$(PARFAIT_CLANG) >> parfait/$$i ; \
    44 		echo "exec" $(PARFAIT_ROOT)/$(MACH)/parfait-$$i '$$*' >> $(PARFAIT_TOOLS)/$$i ; \
    45 		echo "exec" $(PARFAIT_ROOT)/bin/parfait-$$i '$$*' >> parfait/$$i ; \
    45 		chmod +x $(PARFAIT_TOOLS)/$$i ; \
    46 		chmod +x parfait/$$i ; \
       
    47 	done
    46 	done
       
    47 	@$(MKDIR) $(PARFAIT_TOOLS_GCC3)
       
    48 	@for i in cc CC gcc g++ ld ; do \
       
    49 		$(RM) $(PARFAIT_TOOLS_GCC3)/$$i ; \
       
    50 		sed \
       
    51 		    -e "s,$(GCC_ROOT),$(GCC3_ROOT)," < $(PARFAIT_TOOLS)/$$i \
       
    52 		    > $(PARFAIT_TOOLS_GCC3)/$$i ; \
       
    53 		chmod +x $(PARFAIT_TOOLS_GCC3)/$$i ; \
       
    54 	done
       
    55 
       
    56 pkglint:
       
    57 	@rm -f pkglint
       
    58 	@sed -e "s,WS_TOP_XXX,$(WS_TOP)/$(MACH)," \
       
    59 	    < pkglint.sh \
       
    60 	    > pkglint
       
    61 	@chmod +x pkglint
    48 
    62 
    49 
    63 
    50 time-$(MACH64).o:			BITS=64
    64 time-$(MACH64).o:			BITS=64
    51 time-$(MACH32).o time-$(MACH64).o:	CFLAGS += -Kpic
    65 time-$(MACH32).o time-$(MACH64).o:	CFLAGS += -Kpic
    52 
    66 
    53 time-$(MACH32).o time-$(MACH64).o:	time.c
    67 time-$(MACH32).o time-$(MACH64).o:	time.c
    54 	$(CC) $(CFLAGS) -c -o [email protected] $<
    68 	@$(CC) $(CFLAGS) -c -o [email protected] $<
    55 
    69 
    56 time-%.so:	time-%.o
    70 time-%.so:	time-%.o
    57 	$(LD) -G -o [email protected] $<
    71 	@$(LD) -G -o [email protected] $<
    58 
    72 
    59 clean:
    73 clean:
    60 	$(RM) time-*.o time*.bc
    74 	@$(RM) time-*.o time*.bc
       
    75 	@$(RM) pkglint
    61 
    76 
    62 clobber:	clean
    77 clobber:	clean
    63 	$(RM) time-*.so python/pkglint/*.pyc
    78 	@$(RM) time-*.so python/pkglint/*.pyc
    64 	$(RM) -r parfait
    79 	@$(RM) -r $(PARFAIT_TOOLS) $(PARFAIT_TOOLS_GCC3) $(MACH)
    65 
    80