summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-03-24 22:18:32 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-03-24 22:18:32 +1300
commit3673c1b4c4c8e34dca4abe51305d1a34a7f94f4a (patch)
treee5e5504e00b8e1e35fe0e6ca3a927bc4ac98aa86
parent82d4ec2ca2eb3fea07f5d53f2f167eaebd78b833 (diff)
downloadayylmao-3673c1b4c4c8e34dca4abe51305d1a34a7f94f4a.tar.gz
Makefile tidyup tweaksHEADmaster
-rw-r--r--Makefile42
1 files changed, 23 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index 22e9297..93bdfe5 100644
--- a/Makefile
+++ b/Makefile
@@ -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 ./$@