Ticket #20531: Makefile

File Makefile, 2.5 KB (added by Tristan Croll, 7 hours ago)

Added by email2trac

Line 
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.
24OS = $(patsubst CYGWIN_NT%,CYGWIN_NT,$(shell uname -s))
25# CHIMERAX_APP is the ChimeraX install folder
26
27ifeq ($(OS),CYGWIN_NT)
28ifndef RELEASE
29# Windows
30CHIMERAX_APP = "/c/Program Files/ChimeraX_Daily"
31else
32CHIMERAX_APP = "/c/Program Files/ChimeraX"
33endif
34endif
35
36ifeq ($(OS),Darwin)
37# Mac
38ifndef RELEASE
39CHIMERAX_APP = /Applications/ChimeraX_Daily.app
40else
41CHIMERAX_APP = /Applications/ChimeraX.app
42endif
43endif
44
45ifeq ($(OS),Linux)
46ifndef RELEASE
47CHIMERAX_APP = chimerax-daily
48else
49CHIMERAX_APP = chimerax
50endif
51endif
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.
58ifeq ($(OS),CYGWIN_NT)
59CHIMERAX_EXE = $(CHIMERAX_APP)/bin/ChimeraX.exe
60endif
61ifeq ($(OS),Darwin)
62CHIMERAX_EXE = $(CHIMERAX_APP)/Contents/bin/ChimeraX
63export MACOSX_DEPLOYMENT_TARGET=10.13
64endif
65ifeq ($(OS),Linux)
66CHIMERAX_EXE = $(CHIMERAX_APP)
67endif
68
69BUNDLE_BASE_NAME = $(subst ChimeraX-,,$(BUNDLE_NAME))
70SOURCE = src
71SRCS = $(SOURCE)/*.py
72
73
74:DEFAULT_GOAL := wheel
75
76#
77# Actual make dependencies!
78#
79
80wheel $(WHEEL): pyproject.toml
81 $(CHIMERAX_EXE) --nogui --safemode --cmd "devel build . ; exit"
82
83install app-install: $(WHEEL)
84 $(CHIMERAX_EXE) --nogui --safemode --cmd "devel install . ; exit"
85
86uninstall app-uninstall: $(WHEEL)
87 $(CHIMERAX_EXE) --nogui --safemode --cmd "toolshed uninstall $(BUNDLE_BASE_NAME) ; exit"
88
89docs:
90 $(CHIMERAX_EXE) -m sphinx docs/source src/docs/user
91
92test:
93 $(CHIMERAX_EXE)
94
95debug:
96 $(CHIMERAX_EXE) --debug
97
98clean:
99 $(CHIMERAX_EXE) --nogui --safemode --cmd "devel clean . ; exit"
100
101.PHONY: docs