diff options
author | Nicholas Tay <nick@windblume.net> | 2021-12-01 01:39:09 +1100 |
---|---|---|
committer | Nicholas Tay <nick@windblume.net> | 2021-12-01 01:58:25 +1100 |
commit | 02fa5f3702a3a1be1c0dc6176f2009124940a7a7 (patch) | |
tree | 9da85f3a4041e452f5944874233ee023f9f5b67a /Makefile | |
parent | 9d14400b961f9ecb3135a1e415ff614fd4625dce (diff) | |
download | passgen-02fa5f3702a3a1be1c0dc6176f2009124940a7a7.tar.gz passgen-02fa5f3702a3a1be1c0dc6176f2009124940a7a7.tar.bz2 passgen-02fa5f3702a3a1be1c0dc6176f2009124940a7a7.zip |
Improve Makefile with changeable name + install function
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -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)
|