Evaluate optional per-system multiline defines
This commit is contained in:
parent
974b6174ce
commit
164d294788
1 changed files with 20 additions and 1 deletions
|
|
@ -66,6 +66,13 @@
|
||||||
# - makefiledirs
|
# - makefiledirs
|
||||||
# - externalsdir
|
# - externalsdir
|
||||||
#
|
#
|
||||||
|
# Optional multiline defines evaluated per operating system:
|
||||||
|
#
|
||||||
|
# - forLinux
|
||||||
|
# - forDarwin
|
||||||
|
# - forWindows
|
||||||
|
#
|
||||||
|
#
|
||||||
# Variables avaialable for (re)definition via command arguments:
|
# Variables avaialable for (re)definition via command arguments:
|
||||||
#
|
#
|
||||||
# - pdbinpath (Windows only)
|
# - pdbinpath (Windows only)
|
||||||
|
|
@ -140,6 +147,13 @@
|
||||||
# is '..', meaning the direct parent. The value is used in search paths for
|
# is '..', meaning the direct parent. The value is used in search paths for
|
||||||
# pd core components (header files, and executable in the case of Windows).
|
# pd core components (header files, and executable in the case of Windows).
|
||||||
#
|
#
|
||||||
|
# forLinux, forDarwin, forWindows:
|
||||||
|
# Shorthand for 'variable definitions for Linux only' etc. Use like:
|
||||||
|
# define forLinux
|
||||||
|
# cflags += -DLINUX
|
||||||
|
# class.sources += linuxthing.c
|
||||||
|
# endef
|
||||||
|
#
|
||||||
# makefiles and makefiledirs:
|
# makefiles and makefiledirs:
|
||||||
# Extra makefiles or directories with makefiles that should be made in sub-make
|
# Extra makefiles or directories with makefiles that should be made in sub-make
|
||||||
# processes.
|
# processes.
|
||||||
|
|
@ -423,20 +437,25 @@ endif
|
||||||
|
|
||||||
|
|
||||||
# The following systems are defined: Linux, Darwin, Windows. GNU and
|
# The following systems are defined: Linux, Darwin, Windows. GNU and
|
||||||
# GNU/kFreeBSD are treated as Linux to get the same options.
|
# GNU/kFreeBSD are treated as Linux to get the same options. System-specific
|
||||||
|
# multiline defines (optionally set in library makefile) are conditionally
|
||||||
|
# evaluated here.
|
||||||
|
|
||||||
uname := $(shell uname)
|
uname := $(shell uname)
|
||||||
|
|
||||||
ifeq ($(findstring $(uname), Linux GNU GNU/kFreeBSD), $(uname))
|
ifeq ($(findstring $(uname), Linux GNU GNU/kFreeBSD), $(uname))
|
||||||
system = Linux
|
system = Linux
|
||||||
|
$(eval $(forLinux))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(uname), Darwin)
|
ifeq ($(uname), Darwin)
|
||||||
system = Darwin
|
system = Darwin
|
||||||
|
$(eval $(forDarwin))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(findstring MINGW, $(uname)), MINGW)
|
ifeq ($(findstring MINGW, $(uname)), MINGW)
|
||||||
system = Windows
|
system = Windows
|
||||||
|
$(eval $(forWindows))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# TODO: Cygwin, Android
|
# TODO: Cygwin, Android
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue