#
# Pablo System: Visual/Src/System/Build/Primitives/Makefile
#       Generates object files listed in ./ObjFiles and adds them to library.
#
.PHONY : Makefile ../Makefile.common

MYTOP 		:= ..
OBJECTS 	:= $(shell cat ./ObjFiles)

LOCAL_DIR 	:= Primitives
LOCAL_SRCDIRS 	:= ../../$(LOCAL_DIR)
LOCAL_INCLUDES 	 = 

include ../Makefile.common

#
# The object file "DataCharacteristics.o" is not built from the default
# implicit rule because we need the extra endian definition for it.
# Don't expand XTRA_DEFINES until it's used so that EndianDefinition can
# be make.
#
XTRA_DEFINES = $(shell cat EndianDefinition) 

DataCharacteristics.o: DataCharacteristics.C EndianDefinition
	$(C++) $(C++FLAGS) $(XTRA_DEFINES) -c $<

ifdef TARGET_ENDIAN
EndianDefinition: endian.sh
	$(SHELL) endian.sh > EndianDefinition

endian.sh:
	echo "echo -D$(TARGET_ENDIAN)" > endian.sh 
             
else
EndianDefinition: determineEndian
	determineEndian > EndianDefinition
endif

