diff options
-rw-r--r-- | Makefile | 42 |
1 files changed, 23 insertions, 19 deletions
@@ -1,32 +1,36 @@ +.POSIX: .PHONY: all install install-dynamic install-static install-man clean PREFIX = $(HOME)/.local -CC = clang -CFLAGS = -std=c90 -Weverything -I "$(PREFIX)"/include -LDFLAGS = -L "$(PREFIX)"/lib -l ayylmao +CFLAGS = -I $(PREFIX)/include +LDFLAGS = -L $(PREFIX)/lib -l ayylmao -all : ayylmao.dynamic ayylmao.static +ALL = ayylmao.dynamic ayylmao.static + +all: $(ALL) install: install-dynamic install-man -install-dynamic : ayylmao.dynamic - mkdir -p -- "$(PREFIX)"/bin - install -m 0755 -- ayylmao.dynamic "$(PREFIX)"/bin/ayylmao +install-dynamic: ayylmao.dynamic + mkdir -p -- $(PREFIX)/bin + cp -p -- ayylmao.dynamic $(PREFIX)/bin/ayylmao -install-static : ayylmao.static - mkdir -p -- "$(PREFIX)"/bin - install -m 0755 -- ayylmao.static "$(PREFIX)"/bin/ayylmao +install-static: ayylmao.static + mkdir -p -- $(PREFIX)/bin + cp -p -- ayylmao.static $(PREFIX)/bin/ayylmao -install-man: - mkdir -p -- "$(PREFIX)"/share/man/man6 - install -m 0644 -- *.6 "$(PREFIX)"/share/man/man6 +install-man: ayylmao.6 + mkdir -p -- $(PREFIX)/share/man/man6 + cp -p -- ayylmao.6 $(PREFIX)/share/man/man6 -clean : - rm -f -- ayylmao.dynamic ayylmao.static +clean: + rm -f -- $(ALL) -ayylmao.dynamic : ayylmao.c - $(CC) ayylmao.c -o ayylmao.dynamic $(CFLAGS) $(LDFLAGS) +ayylmao.dynamic: ayylmao.c + $(CC) ayylmao.c -o $@ $(CFLAGS) $(LDFLAGS) + chmod +x ./$@ -ayylmao.static : ayylmao.c - $(CC) -static ayylmao.c -o ayylmao.static $(CFLAGS) $(LDFLAGS) +ayylmao.static: ayylmao.c + $(CC) -static ayylmao.c -o $@ $(CFLAGS) $(LDFLAGS) + chmod +x ./$@ |