summaryrefslogtreecommitdiff
path: root/Makefile
blob: 93bdfe5c199d95d4be67dfd6de6a993ddad4d81e (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
33
34
35
36
.POSIX:
.PHONY: all install install-dynamic install-static install-man clean

PREFIX = $(HOME)/.local

CFLAGS = -I $(PREFIX)/include
LDFLAGS = -L $(PREFIX)/lib -l ayylmao

ALL = ayylmao.dynamic ayylmao.static

all: $(ALL)

install: install-dynamic install-man

install-dynamic: ayylmao.dynamic
	mkdir -p -- $(PREFIX)/bin
	cp -p -- ayylmao.dynamic $(PREFIX)/bin/ayylmao

install-static: ayylmao.static
	mkdir -p -- $(PREFIX)/bin
	cp -p -- ayylmao.static $(PREFIX)/bin/ayylmao

install-man: ayylmao.6
	mkdir -p -- $(PREFIX)/share/man/man6
	cp -p -- ayylmao.6 $(PREFIX)/share/man/man6

clean:
	rm -f -- $(ALL)

ayylmao.dynamic: ayylmao.c
	$(CC) ayylmao.c -o $@ $(CFLAGS) $(LDFLAGS)
	chmod +x ./$@

ayylmao.static: ayylmao.c
	$(CC) -static ayylmao.c -o $@ $(CFLAGS) $(LDFLAGS)
	chmod +x ./$@