| 1 | # The "make" targets are:
|
|---|
| 2 | # wheel: build a Python wheel in "dist" directory.
|
|---|
| 3 | # app-install: build wheel (if needed) and install in ChimeraX.
|
|---|
| 4 | # test: run ChimeraX
|
|---|
| 5 | # debug: run ChimeraX with debugging flag set
|
|---|
| 6 | # clean: remove files used in building wheel
|
|---|
| 7 | # distclean: remove files used in building wheel and license file
|
|---|
| 8 |
|
|---|
| 9 | # These parameters may be changed as needed.
|
|---|
| 10 |
|
|---|
| 11 | # ChimeraX bundle names must start with "ChimeraX_"
|
|---|
| 12 | # to avoid clashes with package names in pypi.python.org.
|
|---|
| 13 | # When uploaded to the ChimeraX toolshed, the bundle
|
|---|
| 14 | # will be displayed without the ChimeraX- prefix.
|
|---|
| 15 | # BUNDLE_NAME = ChimeraX-Clipper
|
|---|
| 16 | # BUNDLE_VERSION = 0.9.4-dev1
|
|---|
| 17 | # ChimeraX bundles should only include packages
|
|---|
| 18 | # that install as chimerax.package_name.
|
|---|
| 19 | # General Python packages should be uploaded to
|
|---|
| 20 | # pypi.python.org rather than the ChimeraX toolshed.
|
|---|
| 21 | # PKG_NAME = chimerax.clipper
|
|---|
| 22 |
|
|---|
| 23 | # Define where ChimeraX is installed.
|
|---|
| 24 | OS = $(patsubst CYGWIN_NT%,CYGWIN_NT,$(shell uname -s))
|
|---|
| 25 | # CHIMERAX_APP is the ChimeraX install folder
|
|---|
| 26 |
|
|---|
| 27 | ifeq ($(OS),CYGWIN_NT)
|
|---|
| 28 | ifndef RELEASE
|
|---|
| 29 | # Windows
|
|---|
| 30 | CHIMERAX_APP = "/c/Program Files/ChimeraX_Daily"
|
|---|
| 31 | else
|
|---|
| 32 | CHIMERAX_APP = "/c/Program Files/ChimeraX"
|
|---|
| 33 | endif
|
|---|
| 34 | endif
|
|---|
| 35 |
|
|---|
| 36 | ifeq ($(OS),Darwin)
|
|---|
| 37 | # Mac
|
|---|
| 38 | ifndef RELEASE
|
|---|
| 39 | CHIMERAX_APP = /Applications/ChimeraX_Daily.app
|
|---|
| 40 | else
|
|---|
| 41 | CHIMERAX_APP = /Applications/ChimeraX.app
|
|---|
| 42 | endif
|
|---|
| 43 | endif
|
|---|
| 44 |
|
|---|
| 45 | ifeq ($(OS),Linux)
|
|---|
| 46 | ifndef RELEASE
|
|---|
| 47 | CHIMERAX_APP = chimerax-daily
|
|---|
| 48 | else
|
|---|
| 49 | CHIMERAX_APP = chimerax
|
|---|
| 50 | endif
|
|---|
| 51 | endif
|
|---|
| 52 |
|
|---|
| 53 | # ==================================================================
|
|---|
| 54 | # Theoretically, no changes are needed below this line
|
|---|
| 55 |
|
|---|
| 56 | # Platform-dependent settings. Should not need fixing.
|
|---|
| 57 | # For Windows, we assume Cygwin is being used.
|
|---|
| 58 | ifeq ($(OS),CYGWIN_NT)
|
|---|
| 59 | CHIMERAX_EXE = $(CHIMERAX_APP)/bin/ChimeraX.exe
|
|---|
| 60 | endif
|
|---|
| 61 | ifeq ($(OS),Darwin)
|
|---|
| 62 | CHIMERAX_EXE = $(CHIMERAX_APP)/Contents/bin/ChimeraX
|
|---|
| 63 | export MACOSX_DEPLOYMENT_TARGET=10.13
|
|---|
| 64 | endif
|
|---|
| 65 | ifeq ($(OS),Linux)
|
|---|
| 66 | CHIMERAX_EXE = $(CHIMERAX_APP)
|
|---|
| 67 | endif
|
|---|
| 68 |
|
|---|
| 69 | BUNDLE_BASE_NAME = $(subst ChimeraX-,,$(BUNDLE_NAME))
|
|---|
| 70 | SOURCE = src
|
|---|
| 71 | SRCS = $(SOURCE)/*.py
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 | :DEFAULT_GOAL := wheel
|
|---|
| 75 |
|
|---|
| 76 | #
|
|---|
| 77 | # Actual make dependencies!
|
|---|
| 78 | #
|
|---|
| 79 |
|
|---|
| 80 | wheel $(WHEEL): pyproject.toml
|
|---|
| 81 | $(CHIMERAX_EXE) --nogui --safemode --cmd "devel build . ; exit"
|
|---|
| 82 |
|
|---|
| 83 | install app-install: $(WHEEL)
|
|---|
| 84 | $(CHIMERAX_EXE) --nogui --safemode --cmd "devel install . ; exit"
|
|---|
| 85 |
|
|---|
| 86 | uninstall app-uninstall: $(WHEEL)
|
|---|
| 87 | $(CHIMERAX_EXE) --nogui --safemode --cmd "toolshed uninstall $(BUNDLE_BASE_NAME) ; exit"
|
|---|
| 88 |
|
|---|
| 89 | docs:
|
|---|
| 90 | $(CHIMERAX_EXE) -m sphinx docs/source src/docs/user
|
|---|
| 91 |
|
|---|
| 92 | test:
|
|---|
| 93 | $(CHIMERAX_EXE)
|
|---|
| 94 |
|
|---|
| 95 | debug:
|
|---|
| 96 | $(CHIMERAX_EXE) --debug
|
|---|
| 97 |
|
|---|
| 98 | clean:
|
|---|
| 99 | $(CHIMERAX_EXE) --nogui --safemode --cmd "devel clean . ; exit"
|
|---|
| 100 |
|
|---|
| 101 | .PHONY: docs
|
|---|