Why the level of indirection? For example, all the spec files look like
freetype2_spec_download_url:=http://ftp.igh.cnrs.fr/pub/nongnu/freetype/freetype-2.9.1.tar.gz
freetype2_spec_archive_name:=freetype-2.9.1.tar.gz
freetype2_spec_unpack_dir_name:=freetype-2.9.1
freetype2_spec_product_name_macOS:=libfreetype.6.dylib
freetype2_spec_product_name_linux:=
freetype2_spec_product_name_windows:=libfreetype.dll
freetype2_spec_symlinks_macOS:=libfreetype*.dylib
and are included in a Makefile (in this case Makefile.freetype2) in the following style:
include ../../third-party/freetype2.spec
plugin definitions
FREETYPE2URL:=$(freetype2_spec_download_url)
FREETYPE2LIBNAME:=$(freetype2_spec_product_name_macOS)
FREETYPE2DIR:=$(THIRDPARTYDIR)/$(freetype2_spec_unpack_dir_name)
FREETYPE2ARCHIVE:=$(THIRDPARTYCACHEDIR)/$(freetype2_spec_archive_name)
FREETYPE2LIB:=$(THIRDPARTYINSTALLDIR)/$(FREETYPE2LIBNAME)
FREETYPE2SYMLINKS:=$(freetype2_spec_symlinks_macOS)
Why not just have the spec file read
FREETYPE2URL:=http://ftp.igh.cnrs.fr/pub/nongnu/freetype/freetype-2.9.1.tar.gz
FREETYPE2LIBNAME:=libfreetype.6.dylib
FREETYPE2DIR:=freetype-2.9.1
FREETYPE2ARCHIVE:=freetype-2.9.1.tar.gz
FREETYPE2SYMLINKS:=libfreetype*.dylib
(or better still:
FREETYPE2VER:=freetype-2.9.1
FREETYPE2ARCHIVE:=$(FREETYPE2VER).tar.gz
FREETYPE2URL:=http://ftp.igh.cnrs.fr/pub/nongnu/freetype/$(FREETYPE2ARCHIVE)
FREETYPE2LIBNAME:=libfreetype.6.dylib
FREETYPE2DIR:=$(FREETYPE2VER)
FREETYPE2SYMLINKS:=libfreetype*.dylib
)
and then use make's ability to redefine macros to include the above more simply as:
include ../../third-party/freetype2.spec
plugin definitions
FREETYPE2DIR:=$(THIRDPARTYDIR)/$(FREETYPE2DIR)
FREETYPE2ARCHIVE:=$(THIRDPARTYCACHEDIR)/$(FREETYPE2ARCHIVE)
FREETYPE2LIB:=$(THIRDPARTYINSTALLDIR)/$(FREETYPE2LIB)
What does the extra level of names buy us?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"PERSON","message":"@eliotmiranda in #352: Why the level of indirection? For example, all the spec files look like\r\n\r\nfreetype2_spec_download_url:=http://ftp.igh.cnrs.fr/pub/nongnu/freetype/freetype-2.9.1.tar.gz\r\nfreetype2_spec_archive_name:=freetype-2.9.1.tar.gz\r\nfreetype2_spec_unpack_dir_name:=freetype-2.9.1\r\nfreetype2_spec_product_name_macOS:=libfreetype.6.dylib\r\nfreetype2_spec_product_name_linux:=\r\nfreetype2_spec_product_name_windows:=libfreetype.dll\r\nfreetype2_spec_symlinks_macOS:=libfreetype*.dylib\r\n\r\nand are included in a Makefile (in this case Makefile.freetype2) in the following style:\r\ninclude ../../third-party/freetype2.spec\r\n\r\n# plugin definitions\r\nFREETYPE2URL:=$(freetype2_spec_download_url)\r\nFREETYPE2LIBNAME:=$(freetype2_spec_product_name_macOS)\r\nFREETYPE2DIR:=$(THIRDPARTYDIR)/$(freetype2_spec_unpack_dir_name)\r\nFREETYPE2ARCHIVE:=$(THIRDPARTYCACHEDIR)/$(freetype2_spec_archive_name)\r\nFREETYPE2LIB:=$(THIRDPARTYINSTALLDIR)/$(FREETYPE2LIBNAME)\r\nFREETYPE2SYMLINKS:=$(freetype2_spec_symlinks_macOS)\r\n\r\nWhy not just have the spec file read\r\n\r\nFREETYPE2URL:=http://ftp.igh.cnrs.fr/pub/nongnu/freetype/freetype-2.9.1.tar.gz\r\nFREETYPE2LIBNAME:=libfreetype.6.dylib\r\nFREETYPE2DIR:=freetype-2.9.1\r\nFREETYPE2ARCHIVE:=freetype-2.9.1.tar.gz\r\nFREETYPE2SYMLINKS:=libfreetype*.dylib\r\n\r\n(or better still:\r\nFREETYPE2VER:=freetype-2.9.1\r\nFREETYPE2ARCHIVE:=$(FREETYPE2VER).tar.gz\r\nFREETYPE2URL:=http://ftp.igh.cnrs.fr/pub/nongnu/freetype/$(FREETYPE2ARCHIVE)\r\nFREETYPE2LIBNAME:=libfreetype.6.dylib\r\nFREETYPE2DIR:=$(FREETYPE2VER)\r\nFREETYPE2SYMLINKS:=libfreetype*.dylib\r\n)\r\nand then use make's ability to redefine macros to include the above more simply as:\r\n\r\ninclude ../../third-party/freetype2.spec\r\n\r\n# plugin definitions\r\nFREETYPE2DIR:=$(THIRDPARTYDIR)/$(FREETYPE2DIR)\r\nFREETYPE2ARCHIVE:=$(THIRDPARTYCACHEDIR)/$(FREETYPE2ARCHIVE)\r\nFREETYPE2LIB:=$(THIRDPARTYINSTALLDIR)/$(FREETYPE2LIB)\r\n\r\nWhat does the extra level of names buy us?"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/352#issuecomment-452423273"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/352#issuecomment-452423273",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/352#issuecomment-452423273",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>