aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: f8624521feb87f64aa6db7b340db550e3012ac93 (plain) (blame)
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
.POSIX:

CFLAGS = -std=c11 -pipe -O3 -Wall -Wextra -Werror -pedantic
PREFIX = /usr
MANDIR = ${PREFIX}/share/man

sources = liblux.o lux.h
outputs = liblux.so liblux.a

all: ${outputs}

liblux.o: liblux.c

liblux.a: ${sources}
	${AR} ${ARFLAGS} $@ liblux.o

liblux.so: ${sources}
	${CC} ${CFLAGS} -o $@ -fPIC -shared liblux.o

install:
	mkdir -p ${PREFIX}/include ${PREFIX}/lib ${MANDIR}/man3
	cp ${outputs} ${PREFIX}/lib
	cp lux.h ${PREFIX}/include
	cp man/* ${MANDIR}/man3

clean:
	rm -f ${outputs} liblux.o