Makefile question

Ryan Schmidt ryandesign at macports.org
Sat Dec 5 04:35:27 PST 2015


On Dec 4, 2015, at 9:15 PM, Mark Brethen wrote:

> I have source with no configure and this snippet pertaining to Mac in the makefile:
> 
> 		ifeq "$(uname)" "Darwin"
> 			# (2) Mac OS X, using GCC as the C compiler
> 			export ARCHOS    = x86_LINUX
> 			export OCAMLDIR  = /usr/local/bin
> 			export OBJEXT    = o
> 			export CASE_FILE = case_ins_mac
> 			export GLOB      = glob_unix
> 			# Very simplistic arch test
> 			ifeq "$(shell uname -m)" "x86_64"
> 				export WEIDU_ARCH = amd64
> 				export ARCH_FILE = arch_osx
> 			else ifeq "$(shell uname -m)" "i386"
> 				export WEIDU_ARCH = x86
> 				export ARCH_FILE = arch_osx
> 			else
> 				export WEIDU_ARCH = mac # PPC
> 				export ARCH_FILE = arch_legacy_osx
> 			endif
> 			export WEIDU_OS = osx
> 			export USEOPT = .opt
> 			PROJECT_CMODULES = nix
> 			export TKDIR = obj-tk
> 
> 
> OCAMLDIR needs to be set, but what about the rest?

Well the "very simplistic arch test" is of course wrong. "uname -m" tells you the arch of the kernel, which is not necessarily the arch of userland software. In any case, we don't want build systems deciding for themselves what arch(s) to user; they shall obey the arch(s) MacPorts tells them to use. Also, I assume "arch_osx" and "arch_legacy_osx" are filenames; I wonder what the difference in the contents of those files is.



More information about the macports-dev mailing list