-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
79 lines (66 loc) · 2.03 KB
/
Copy pathmakefile
File metadata and controls
79 lines (66 loc) · 2.03 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# SPDX-FileCopyrightText: 2025-2026 André A. Gomes
# SPDX-License-Identifier: MIT
# Set default Lisp implementation
LISP ?= sbcl
# List of all supported Lisp implementations
LISP_IMPLEMENTATIONS := sbcl ccl abcl clisp clasp ecl
# Set flags based on Lisp implementation
ifeq ($(LISP), sbcl)
LISP_FLAGS ?= --no-userinit --non-interactive
else ifeq ($(LISP), ccl)
LISP_FLAGS ?= --no-init --batch --quiet
else ifeq ($(LISP), ecl)
LISP_FLAGS ?= --norc --nodebug
else ifeq ($(LISP), abcl)
LISP_FLAGS ?= --no-init --batch
else ifeq ($(LISP), clisp)
LISP_FLAGS ?= -norc --quiet
else ifeq ($(LISP), clasp)
LISP_FLAGS ?= --norc --non-interactive
else
$(error Unsupported Lisp implementation: $(LISP))
endif
# CLISP uses -x instead of --eval
ifeq ($(LISP), clisp)
EVAL_FLAG ?= -x
else
EVAL_FLAG ?= --eval
endif
ifeq ($(filter $(LISP), ccl ecl), $(LISP))
QUIT_FORM := $(EVAL_FLAG) '(quit)'
else
QUIT_FORM :=
endif
MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
ASD := $(MAKEFILE_DIR)/cleopter.asd
SYSTEM := cleopter
LISP_RUN := $(LISP) $(LISP_FLAGS) \
$(EVAL_FLAG) '(require "asdf")' \
$(EVAL_FLAG) '(asdf:load-asd "$(ASD)")'
.PHONY: help check check-all build-example clean
help:
@echo "Available targets:"
@echo " check - Run tests with $(LISP)"
@echo " check-all - Run tests with $(LISP_IMPLEMENTATIONS)"
@echo " build-example - Build the example"
@echo " clean - Remove build-example artifacts"
@echo ""
@echo "Variables:"
@echo " LISP=$(LISP) (options: $(LISP_IMPLEMENTATIONS))"
check:
$(LISP_RUN) $(EVAL_FLAG) '(asdf:test-system :$(SYSTEM) :force t)' $(QUIT_FORM)
check-all:
@for lisp in $(LISP_IMPLEMENTATIONS); do \
echo "\n=== Testing with $$lisp ===\n"; \
$(MAKE) LISP=$$lisp check; \
done
ifeq ($(filter $(LISP), sbcl ccl), $(LISP))
build-example:
$(LISP_RUN) $(EVAL_FLAG) '(asdf:make :$(SYSTEM)/example :force t)'
else
build-example:
@echo "Warning: build-example target not supported for $(LISP)"
@echo "Supported implementations: SBCL, CCL"
endif
clean:
rm -rf $(MAKEFILE_DIR)/example/bin