summaryrefslogtreecommitdiff
path: root/Makefile
blob: a1f9e310caf5c377666daab0d322a407092a37c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.PHONY: all install clean

PREFIX = $(HOME)/.local

CC = clang
CFLAGS = -std=c90 -Weverything -fPIC

all: libayylmao.a libayylmao.so

install: libayylmao.so libayylmao.a
	mkdir -p -- $(PREFIX)/lib $(PREFIX)/include
	install -m 0644 -- ayylmao.h $(PREFIX)/include
	install -m 0644 -- libayylmao.so libayylmao.a $(PREFIX)/lib

clean:
	rm -f -- *.a *.o *.so

libayylmao.a: ayy.o lmao.o
	ar rcs "$@" ayy.o lmao.o

libayylmao.so: ayy.o lmao.o
	$(CC) $(CFLAGS) -shared -Wl,-soname,"$@" -o "$@" ayy.o lmao.o