aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: adaf090bb29fe75b035ea4936312df5e72aa85b0 (plain)
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
# Compiler and source definitions
CC = csc
CFLAGS = -O3
SRC = desmoctl.scm
BIN = build/desmoctl

# Default PREFIX for install, can be overridden
PREFIX ?= /usr/bin/

# Default target - do nothing
all:
	@echo "Available targets:"
	@echo "  static    - Build the binary with static linking."
	@echo "  dynamic   - Build the binary without static linking."
	@echo "  install   - Copy the binary to the install PREFIX."
	@echo "  deps      - Install dependencies from requirements.list."
	@echo "  clean     - Remove built binary and other generated files."
	@echo ""
	@echo "Specify a target to make."

# Rule for building the binary with static linking
static: CFLAGS += -static
static: $(BIN)

# Rule for building the binary without static linking
dynamic: $(BIN)

# Rule for building the binary
$(BIN): $(SRC)
	mkdir -p build
	$(CC) $(CFLAGS) -o $(BIN) $(SRC)
	chmod +x $(BIN)

# Install target
install:
	cp $(BIN) $(PREFIX)

# Dependency installation target
deps:
	chicken-install -from-list requirements.list

# Clean target
clean:
	rm -rf build

.PHONY: all static dynamic install deps clean