aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)