File: info2code.mk

package info (click to toggle)
openmsx 0.5.1-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,976 kB
  • ctags: 10,295
  • sloc: cpp: 63,525; xml: 37,105; sh: 1,403; python: 681; tcl: 207; makefile: 64
file content (40 lines) | stat: -rw-r--r-- 1,607 bytes parent folder | download
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)\";" >> $@