Merge branch 'eval-system-specific-defines', update version to 0.2.0
This merge introduces the evaluation of optional multiline defines 'forLinux', 'forDarwin' and 'forWindows', which can be used as a flexible replacement for system-specific variables as in Pd-extended's Makefile template. Example code is added to Makefile.pdlibbuilder's built-in documentation.
This commit is contained in:
commit
3946ea50de
1 changed files with 21 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.pdlibbuilder version 0.1.0, dated 2015-12-08
|
||||
# Makefile.pdlibbuilder version 0.2.0, dated 2015-12-19
|
||||
#
|
||||
# Helper makefile for Pure Data external libraries.
|
||||
# Written by Katja Vetter March-June 2015 for the public domain. No warranties.
|
||||
|
|
@ -66,6 +66,13 @@
|
|||
# - makefiledirs
|
||||
# - externalsdir
|
||||
#
|
||||
# Optional multiline defines evaluated per operating system:
|
||||
#
|
||||
# - forLinux
|
||||
# - forDarwin
|
||||
# - forWindows
|
||||
#
|
||||
#
|
||||
# Variables avaialable for (re)definition via command arguments:
|
||||
#
|
||||
# - pdbinpath (Windows only)
|
||||
|
|
@ -140,6 +147,13 @@
|
|||
# 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).
|
||||
#
|
||||
# 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:
|
||||
# Extra makefiles or directories with makefiles that should be made in sub-make
|
||||
# processes.
|
||||
|
|
@ -430,20 +444,25 @@ endif
|
|||
|
||||
|
||||
# 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)
|
||||
|
||||
ifeq ($(findstring $(uname), Linux GNU GNU/kFreeBSD), $(uname))
|
||||
system = Linux
|
||||
$(eval $(forLinux))
|
||||
endif
|
||||
|
||||
ifeq ($(uname), Darwin)
|
||||
system = Darwin
|
||||
$(eval $(forDarwin))
|
||||
endif
|
||||
|
||||
ifeq ($(findstring MINGW, $(uname)), MINGW)
|
||||
system = Windows
|
||||
$(eval $(forWindows))
|
||||
endif
|
||||
|
||||
# TODO: Cygwin, Android
|
||||
|
|
|
|||
Loading…
Reference in a new issue