-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (32 loc) · 999 Bytes
/
Copy pathMakefile
File metadata and controls
52 lines (32 loc) · 999 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
CC = gcc
CFLAGS = -Wall -Wextra -std=c11 -Iinclude
TARGET = activate-cli
SRC = src/main.c src/dir_list.c src/scan.c src/activate.c src/io.c
OBJ = $(SRC:.c=.o)
# Installation paths
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share
COMPDIR = $(DATADIR)/bash-completion/completions
# Staging directory (used by packages)
DESTDIR ?=
WRAPPER = scripts/activate
COMPLETION = scripts/completion
$(TARGET): $(OBJ)
$(CC) $(OBJ) -o $(TARGET)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
install: $(TARGET)
@echo "Installing to $(DESTDIR)$(PREFIX)"
install -d $(DESTDIR)$(BINDIR)
install -m 755 $(TARGET) $(DESTDIR)$(BINDIR)/activate-cli
install -m 755 $(WRAPPER) $(DESTDIR)$(BINDIR)/activate
install -d $(DESTDIR)$(COMPDIR)
install -m 644 $(COMPLETION) $(DESTDIR)$(COMPDIR)/activate
uninstall:
rm -f $(DESTDIR)$(BINDIR)/activate-cli
rm -f $(DESTDIR)$(BINDIR)/activate
rm -f $(DESTDIR)$(COMPDIR)/activate
clean:
rm -f $(OBJ) $(TARGET)
.PHONY: clean install uninstall