-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (27 loc) · 916 Bytes
/
Makefile
File metadata and controls
33 lines (27 loc) · 916 Bytes
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
BUILD_DIR ?= build
PREFIX ?= /usr/local
CMAKE ?= cmake
CMAKE_BUILD_TYPE ?= Release
ARGS ?=
.PHONY: build run install clean help
build:
$(CMAKE) -S . -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
$(CMAKE) --build $(BUILD_DIR)
run: build
$(BUILD_DIR)/zippy $(ARGS)
install: build
install -d $(PREFIX)/bin
install $(BUILD_DIR)/zippy $(PREFIX)/bin/zippy
@echo "Installed to $(PREFIX)/bin/zippy"
@echo "Add to PATH (bash): export PATH=\"$(PREFIX)/bin:\$$PATH\""
clean:
rm -rf $(BUILD_DIR)
help:
@echo "Targets:"
@echo " build Configure and build the C++ project"
@echo " run Build and run locally (set ARGS=\"./path\")"
@echo " install Install to PREFIX/bin (default: /usr/local/bin)"
@echo " clean Remove the CMake build directory"
@echo " help Show this message"
@echo
@echo "Vars: CMAKE, BUILD_DIR, CMAKE_BUILD_TYPE, PREFIX, ARGS"