(file) Return to objects-unix.mak CVS log (file) (dir) Up to [Pegasus] / pegasus / mak

File: [Pegasus] / pegasus / mak / objects-unix.mak (download)
Revision: 1.11, Tue Aug 24 18:43:11 2004 UTC (19 years, 8 months ago) by david.dillard
Branch: MAIN
CVS Tags: pegasus25BeforeLicenseUpdate, SLPPERFINST-root, SLPPERFINST-branch, RELEASE_2_4_1-BETA1, RELEASE_2_4_0-RC3, RELEASE_2_4_0-RC2, RELEASE_2_4_0, RELEASE_2_4-root, PEP217_PRE_BRANCH, PEP217_POST_BRANCH, PEP217_BRANCH, PEP213_SIZE_OPTIMIZATIONS, CHUNKTESTDONE_PEP140
Branch point for: RELEASE_2_4-branch
Changes since 1.10: +10 -11 lines
BUG#: 1912
TITLE: Improved detection of GCC and version for temp object creation.

DESCRIPTION: Previously, determination of the use of GCC was done by specific platform or OS (which had the potential to be wrong in some cases).  In addition, the version of GCC was ignored when deciding if temporary objects had to be generated or not.  The determination of the use of GCC is now always correct and the version of GCC is now taken into account when making the decision.

################################################################################
##
## An ugly trick is used here to overcome a bug in g++ v2.9.5. G++ fails to
## cleanup object files that are placed in directories other than the
## current one (using the -o option). To overcome this bug, we use -o.tmp.o 
## and then move the file to the object directory.  Note, this is only done for
## v2.9.5 of g++.
##
################################################################################

ifeq ($(findstring _GNU, $(PEGASUS_PLATFORM)), _GNU)
GCC_VERSION=$(word 3, $(shell $(CXX) --version))
ifneq ($(GCC_VERSION), 2.9.5)
    _NO_TMP_O=yes
endif
else
    _NO_TMP_O=yes
endif

_TMP_O = $(PEGASUS_PLATFORM).o


ifeq ($(_NO_TMP_O), yes)
$(OBJ_DIR)/%.o: %.cpp $(ERROR)
	$(CXX) -c -o $@ $(FLAGS) $(LOCAL_DEFINES) $(DEFINES) $(SYS_INCLUDES) $(INCLUDES) $*.cpp
	@ $(TOUCH) $@
	@ $(ECHO)
else
$(OBJ_DIR)/%.o: %.cpp $(ERROR)
	$(CXX) -c -o $(_TMP_O) $(FLAGS) $(LOCAL_DEFINES) $(DEFINES) $(SYS_INCLUDES) $(INCLUDES) $*.cpp
	@ $(COPY) $(_TMP_O) $@
	@ $(RM) $(_TMP_O)
	@ $(TOUCH) $@
	@ $(ECHO)
endif

ifeq ($(_NO_TMP_O), yes)
$(OBJ_DIR)/%.o: %.c $(ERROR)
	$(CC) -c -o $@ $(FLAGS) $(LOCAL_DEFINES) $(DEFINES) $(SYS_INCLUDES) $(INCLUDES) $*.c
	@ $(TOUCH) $@
	@ $(ECHO)
else
$(OBJ_DIR)/%.o: %.c $(ERROR)
	$(CC) -c -o $(_TMP_O) $(FLAGS) $(LOCAL_DEFINES) $(DEFINES) $(SYS_INCLUDES) $(INCLUDES) $*.c
	@ $(COPY) $(_TMP_O) $@
	@ $(RM) $(_TMP_O)
	@ $(TOUCH) $@
	@ $(ECHO)
endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2