aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 5122e69c02fce50b8ea0435c1afde8ce91f59990 (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
PREFIX = /usr/local/bin
CC = gcc
CFLAGS = -Wall -g
SOURCES = easydir.c handerror.c implementation.c main.c
OBJECTS = $(SOURCES:.c=.o)
BASH = lpass_copy.sh
EXECUTABLE = lpass

.PHONY: all clean install uninstall

all: $(EXECUTABLE)

clean:
	@rm -rf $(EXECUTABLE) $(OBJECTS)

$(OBJECTS):
	@$(CC) -c $(CFLAGS) $(SOURCES)

$(EXECUTABLE): $(OBJECTS)
	@$(CC) $(CFLAGS) -o $(EXECUTABLE) $(OBJECTS)

install: all
	@echo installing files to $(PREFIX)
	@install $(EXECUTABLE) $(PREFIX)
	@chmod 755 $(PREFIX)/$(EXECUTABLE)
	@install $(BASH) $(PREFIX)
	@chmod 755 $(PREFIX)/$(BASH)

uninstall:
	@echo removing files from $(PREFIX)
	@rm -rf $(PREFIX)/$(EXECUTABLE)
	@rm -rf $(PREFIX)/$(BASH)