aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2021-12-01 01:39:09 +1100
committerNicholas Tay <nick@windblume.net>2021-12-01 01:58:25 +1100
commit02fa5f3702a3a1be1c0dc6176f2009124940a7a7 (patch)
tree9da85f3a4041e452f5944874233ee023f9f5b67a /Makefile
parent9d14400b961f9ecb3135a1e415ff614fd4625dce (diff)
downloadpassgen-02fa5f3702a3a1be1c0dc6176f2009124940a7a7.tar.gz
passgen-02fa5f3702a3a1be1c0dc6176f2009124940a7a7.tar.bz2
passgen-02fa5f3702a3a1be1c0dc6176f2009124940a7a7.zip
Improve Makefile with changeable name + install function
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 12 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 7dc6a5a..050a149 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,18 @@
+NAME = passgen
+PREFIX = $(HOME)/.local
+
CC = gcc
-CFLAGS = -Wall -Wextra -Wshadow -Werror -pedantic
+CFLAGS += -Wall -Wextra -Wshadow -Werror -pedantic
+
+default: $(NAME)
-default: passgen
+$(NAME): $(NAME).c config.h
+ $(CC) $(CFLAGS) -o $(NAME) $(NAME).c
-passgen: passgen.c
- $(CC) $(CFLAGS) -o passgen passgen.c
+install: $(NAME)
+ install -d $(DESTDIR)$(PREFIX)/bin/
+ install -m 755 $(NAME) $(DESTDIR)$(PREFIX)/bin/
clean:
rm -f *.o
- rm -f passgen
+ rm -f $(NAME)