aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2020-10-31 17:45:29 +0000
committerJoursoir <chat@joursoir.net>2020-10-31 17:45:29 +0000
commit64ef51a8ce6bc148ba493e350e2cac4cba470201 (patch)
tree4418c4133b16341975cfe4d29df8da6ce27abcff /Makefile
parent38a3be4a3eeacec75a534fef6951b9484b4d7098 (diff)
downloadlock-password-64ef51a8ce6bc148ba493e350e2cac4cba470201.tar.gz
lock-password-64ef51a8ce6bc148ba493e350e2cac4cba470201.tar.bz2
lock-password-64ef51a8ce6bc148ba493e350e2cac4cba470201.zip
some features:
remake README.md for new code architecture; add help command; add man page;
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile24
1 files changed, 16 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 5122e69..c0e734f 100755
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,11 @@
PREFIX = /usr/local/bin
CC = gcc
CFLAGS = -Wall -g
-SOURCES = easydir.c handerror.c implementation.c main.c
-OBJECTS = $(SOURCES:.c=.o)
+MAN_PATH = /usr/share/man/man1
+SOURCES = src/easydir.c src/handerror.c src/implementation.c src/main.c
+OBJECTS = easydir.o handerror.o implementation.o main.o
+MAN_SOURCES = man/lpass.1
+MAN_OBJECTS = lpass.1.gz
BASH = lpass_copy.sh
EXECUTABLE = lpass
@@ -12,6 +15,7 @@ all: $(EXECUTABLE)
clean:
@rm -rf $(EXECUTABLE) $(OBJECTS)
+ @rm -rf $(MAN_OBJECTS)
$(OBJECTS):
@$(CC) -c $(CFLAGS) $(SOURCES)
@@ -21,12 +25,16 @@ $(EXECUTABLE): $(OBJECTS)
install: all
@echo installing files to $(PREFIX)
- @install $(EXECUTABLE) $(PREFIX)
- @chmod 755 $(PREFIX)/$(EXECUTABLE)
- @install $(BASH) $(PREFIX)
- @chmod 755 $(PREFIX)/$(BASH)
+ @install $(EXECUTABLE) $(PREFIX) && chmod 755 $(PREFIX)/$(EXECUTABLE)
+ @install $(BASH) $(PREFIX) && chmod 755 $(PREFIX)/$(BASH)
+ @echo installing man page
+ @cat $(MAN_SOURCES) | gzip > $(MAN_OBJECTS)
+ @install $(MAN_OBJECTS) $(MAN_PATH)
uninstall:
@echo removing files from $(PREFIX)
- @rm -rf $(PREFIX)/$(EXECUTABLE)
- @rm -rf $(PREFIX)/$(BASH) \ No newline at end of file
+ @echo deleting man page
+ @rm -rf \
+ $(PREFIX)/$(EXECUTABLE) \
+ $(PREFIX)/$(BASH) \
+ $(MAN_PATH)/$(MAN_OBJECTS) \ No newline at end of file