-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (46 loc) · 1.7 KB
/
Makefile
File metadata and controls
55 lines (46 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# =============================================================================
# Project: EnvStack - Environment Variable Management
# Makefile for building project executables on Linux
#
# Usage:
# make - Builds targets
# make clean - Removes all build artifacts
# make dryrun - Simulates installation without making changes
# make install - Installs the build artifacts using distman
#
# Requirements:
# - Python and pip installed (Linux)
# - Wine installed for Windows builds on Linux
# - distman installed for installation (pip install distman)
# =============================================================================
# Define the installation command
BUILD_DIR := build
BUILD_CMD := python -m pip install . -t $(BUILD_DIR)
# envstack command uses ./env for ENVPATH
ENVSTACK_CMD := ENVPATH=$(CURDIR)/env \
PATH=$(CURDIR)/bin:$(BUILD_DIR)/bin:$$PATH \
PYTHONPATH=$(CURDIR)/lib:$(BUILD_DIR):$$PYTHONPATH \
envstack ${PROJECT} ${ENV}
# Clean target to remove the build directory
clean:
rm -rf build
# Target to build for Linux
build: clean
$(BUILD_CMD)
rm -rf build/bin build/lib build/envstack build/bdist* build/__pycache__
# Combined target to build for both platforms
all: build
# Run the pytest suite from an editable install, matching CI behavior
test:
python -m pip install pytest
python -m pip install -e .
pytest tests -q
# Install dryrun target to simulate installation
dryrun:
$(ENVSTACK_CMD) -- dist --dryrun
# Install target to install the builds using distman
# using --force allows uncommitted changes to be disted
install: build
dist --force --yes
# Phony targets
.PHONY: all build dryrun install clean test pytest