diff --git a/macbuild/ReadMe.txt b/macbuild/ReadMe.txt index 080317a54..cb2b7749f 100644 --- a/macbuild/ReadMe.txt +++ b/macbuild/ReadMe.txt @@ -1,25 +1,39 @@ -<< Draft Version 0.001>> +<< Draft Version 0.002>> -This directory "macbuild" contains different files required to build KLayout -version 0.25 or later for different Max OSX including: - * Yosemite (10.10) - * El Capitan (10.11) - * Sierra (10.12) - * High Sierra (10.13) +1. Introduction: + This directory "macbuild" contains different files required for building KLayout + version 0.25 or later for different Max OSX including: + * Yosemite (10.10) + * El Capitan (10.11) + * Sierra (10.12) + * High Sierra (10.13) -By default, Qt framework is Qt5 from Mac Ports (https://www.macports.org/) which -is usually located under: - /opt/local/libexec/qt5/ + By default, Qt framework is Qt5 from Mac Ports (https://www.macports.org/) which + is usually located under: + /opt/local/libexec/qt5/ -Also by default, supported script languages, i.e,, Ruby and Python, are those -standard ones bundled with the OS. -However, you are able to choose other options like Python from Anaconda. - -bla bla bla ... + Also by default, supported script languages, i.e, Ruby and Python, are those + standard ones bundled with the OS. + However, you are able to choose other options like Python from Anaconda. + : + : (to be updated) + : + : -To use the top script "build4mac.py" make a symbolic link from the parent directory like: - build4mac.py -> macbuild/build4mac.py -then execute the Python script to build with appropriate options if required. +2. How to use: + (1) Make a symbolic link from the parent directory (where 'build.sh' exists) to + 'build4mac.py', that is, + build4mac.py -> macbuild/build4mac.py + + (2) Invoke 'build4mac.py' with appropriate options, for example, for debug-build: + $ cd /where/'build.sh'/exists + $ ./build4mac.py -d + + (3) Confirm successful build. + + (4) Run 'build4mac.py' again with the same options used in (2) PLUS "-y" + to deploy executables and libraries under "klayout.app" bundle. + $ ./build4mac.py -d -y [End of File] diff --git a/macbuild/build4mac.py b/macbuild/build4mac.py index ca48f0452..83397e420 100755 --- a/macbuild/build4mac.py +++ b/macbuild/build4mac.py @@ -10,6 +10,8 @@ from __future__ import print_function # to use print() of Python 3 in Python >= 2.7 import sys import os +import shutil +import glob import platform import optparse import subprocess @@ -19,13 +21,14 @@ import subprocess #------------------------------------------------------------------------------- mydir = os.path.dirname(os.path.abspath(__file__)) sys.path.append( mydir + "/macbuild" ) -from build4mac_env import * +from build4mac_env import * +from build4mac_util import * #------------------------------------------------------------------------------- ## To set global variables including present directory and platform info. #------------------------------------------------------------------------------- def SetGlobals(): - global PresentDir # present directory + global ProjectDir # project directory where "build.sh" exists global Usage # string on usage global BuildBash # the main build Bash script global Platform # platform @@ -35,7 +38,8 @@ def SetGlobals(): global NoQtBindings # True if not creating Qt bindings for Ruby scripts global MakeOptions # options passed to `make` global DebugMode # True if debug mode build - global CheckComOnly # True if check the command line only + global CheckComOnly # True if only for checking the command line parameters to "build.sh" + global Deployment # True if deploying the binaries for a package # auxiliary variables on platform global System # 6-tuple from platform.uname() global Node # - do - @@ -63,10 +67,15 @@ def SetGlobals(): Usage += " [-m|--make