1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
# $Id: info2code.mk,v 1.10 2005/01/26 02:47:55 mthuurne Exp $
#
# Write build info to C++ constants, so source can access it.
# Advantages of this approach:
# - file dates used for dependency checks (as opposed to "-D" compile flag)
# - inactive code is still checked by compiler (as opposed to "#if")
$(CONFIG_HEADER): $(MAKE_PATH)/info2code.mk $(MAKE_PATH)/custom.mk
@echo "Creating $@..."
@mkdir -p $(@D)
@echo "// Automatically generated by build process." > $@
@echo "" >> $@
@echo "#ifndef __BUILD_INFO_HH__" >> $@
@echo "#define __BUILD_INFO_HH__" >> $@
@echo "" >> $@
@echo "#include <string>" >> $@
@echo "" >> $@
@echo "namespace openmsx {" >> $@
@echo "" >> $@
# Use a macro iso a boolean to prevent compilation errors on non x86 machines
@if [ "$(OPENMSX_TARGET_CPU)" = "x86" ] ; then \
echo "#define ASM_X86" >> $@ ; \
fi
# Don't call it "BIG_ENDIAN", because some system header may #define that.
@echo "static const bool OPENMSX_BIGENDIAN = $(BIG_ENDIAN);" >> $@
@echo "static const std::string DATADIR = \"$(INSTALL_SHARE_DIR)\";" >> $@
@echo "" >> $@
@echo "} // namespace openmsx" >> $@
@echo "" >> $@
@echo "#endif //__BUILD_INFO_HH__" >> $@
$(VERSION_HEADER): ChangeLog $(MAKE_PATH)/info2code.mk $(MAKE_PATH)/version.mk
@echo "Creating $@..."
@mkdir -p $(@D)
@echo "// Automatically generated by build process." > $@
@echo "" >> $@
@echo "const bool Version::RELEASE = $(RELEASE_FLAG);" >> $@
@echo "const std::string Version::VERSION = \"$(PACKAGE_VERSION)\";" >> $@
@echo "const std::string Version::CHANGELOG_REVISION = \"$(CHANGELOG_REVISION)\";" >> $@
|