summaryrefslogtreecommitdiff
path: root/Makefile
blob: 22e92970221357db5958cfbb68b513e3bc9c5cbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
.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

all : ayylmao.dynamic ayylmao.static

install: install-dynamic install-man

install-dynamic : ayylmao.dynamic
	mkdir -p -- "$(PREFIX)"/bin
	install -m 0755 -- ayylmao.dynamic "$(PREFIX)"/bin/ayylmao

install-static : ayylmao.static
	mkdir -p -- "$(PREFIX)"/bin
	install -m 0755 -- ayylmao.static "$(PREFIX)"/bin/ayylmao

install-man:
	mkdir -p -- "$(PREFIX)"/share/man/man6
	install -m 0644 -- *.6 "$(PREFIX)"/share/man/man6

clean :
	rm -f -- ayylmao.dynamic ayylmao.static

ayylmao.dynamic : ayylmao.c
	$(CC) ayylmao.c -o ayylmao.dynamic $(CFLAGS) $(LDFLAGS) 

ayylmao.static : ayylmao.c
	$(CC) -static ayylmao.c -o ayylmao.static $(CFLAGS) $(LDFLAGS)