aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-02-22 14:14:28 +0100
committerMattias Andrée <m@maandree.se>2026-02-22 14:14:28 +0100
commitf4a40c25b29c3b4db904ef66667d129b38b279d3 (patch)
tree6ab6bb7c5757d267045940f81d21f7465ce05e4f /Makefile
parentUpdate e-mail and urls (diff)
downloadautopasswd-f4a40c25b29c3b4db904ef66667d129b38b279d3.tar.gz
autopasswd-f4a40c25b29c3b4db904ef66667d129b38b279d3.tar.bz2
autopasswd-f4a40c25b29c3b4db904ef66667d129b38b279d3.tar.xz
m fixes
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile57
1 files changed, 14 insertions, 43 deletions
diff --git a/Makefile b/Makefile
index 30d2b86..55ddd0a 100644
--- a/Makefile
+++ b/Makefile
@@ -3,61 +3,32 @@
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
-PREFIX = /usr
-BIN = /bin
-BINDIR = $(PREFIX)$(BIN)
-DATA = /share
-DATADIR = $(PREFIX)$(DATA)
-LICENSEDIR = $(DATADIR)/licenses
+CONFIGFILE = config.mk
+include $(CONFIGFILE)
-PKGNAME = autopasswd
-COMMAND = autopasswd
-
-OPTIMISE = -O3
-
-WARN = -Wall -Wextra -pedantic -Wdouble-promotion -Wformat=2 -Winit-self -Wmissing-include-dirs \
- -Wtrampolines -Wfloat-equal -Wshadow -Wmissing-prototypes -Wmissing-declarations \
- -Wredundant-decls -Wnested-externs -Winline -Wno-variadic-macros -Wswitch-default \
- -Wsync-nand -Wunsafe-loop-optimizations -Wcast-align -Wstrict-overflow -Wundef \
- -Wbad-function-cast -Wcast-qual -Wpacked -Wlogical-op -Wstrict-prototypes -Wconversion \
- -Wold-style-definition -Wvector-operation-performance -Wunsuffixed-float-constants \
- -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \
- -Wsuggest-attribute=format -Wnormalized=nfkc -Wdeclaration-after-statement
-
-F_OPTS = -ftree-vrp -fstrict-aliasing -fipa-pure-const -fstack-usage -fstrict-overflow \
- -funsafe-loop-optimizations -fno-builtin
-
-FLAGS = $(OPTIMISE) -std=gnu99 $(F_OPTS) $(WARN)
-
-
-.PHONY: all
all: bin/autopasswd
bin/autopasswd: obj/autopasswd.o
@mkdir -p bin
- $(CC) $(FLAGS) -lpassphrase -largparser -lkeccak -o $@ $^ $(LDFLAGS)
+ $(CC) -o $@ obj/autopasswd.o $(LDFLAGS)
obj/%.o: src/%.c
@mkdir -p obj
- $(CC) $(FLAGS) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
-
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
-.PHONY: install
install: bin/autopasswd
- install -dm755 -- "$(DESTDIR)$(BINDIR)"
- install -m755 bin/autopasswd -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
- install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
- install -m644 COPYING LICENSE -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
-
+ mkdir -p -- "$(DESTDIR)$(BINDIR)"
+ mkdir -p -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+ cp -- bin/autopasswd "$(DESTDIR)$(BINDIR)/$(COMMAND)"
+ cp -- COPYING LICENSE "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/"
-.PHONY: uninstall
uninstall:
- -rm -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
- -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING"
- -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
+ -rm -f -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
+ -rm -f -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING"
+ -rm -f -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
-rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
-
-.PHONY: clean
clean:
- -rm -r bin obj
+ -rm -rf -- bin obj
+
+.PHONY: all install uninstall clean