diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 32 |
1 files changed, 11 insertions, 21 deletions
@@ -1,31 +1,21 @@ .POSIX: -CFLAGS = -std=c11 -pipe -O3 -Wall -Wextra -Werror -pedantic -PREFIX = /usr -MANDIR = ${PREFIX}/share/man +PREFIX = /usr +DPREFIX = ${DESTDIR}${PREFIX} +MANDIR = ${DPREFIX}/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 +all: + @echo "run `tup` to build the library" >&2 install: - mkdir -p ${PREFIX}/include ${PREFIX}/lib ${MANDIR}/man0 ${MANDIR}/man3 - cp ${outputs} ${PREFIX}/lib - cp lux.h ${PREFIX}/include - cp man/*.0 ${MANDIR}/man0 - cp man/*.3 ${MANDIR}/man3 + mkdir -p ${DPREFIX}/include ${DPREFIX}/lib ${DMANDIR}/man0 ${DMANDIR}/man3 + cp src/liblux.a src/liblux.so ${DPREFIX}/lib + cp src/lux.h ${DPREFIX}/include + cp man/*.0 ${DMANDIR}/man0 + cp man/*.3 ${DMANDIR}/man3 file=/usr/share/groff/site-tmac/mdoc.local; \ grep '^\.ds doc-str-Lb-liblux' $$file > /dev/null || \ cat man/Lb-desc.tmac >> $$file clean: - rm -f ${outputs} liblux.o + rm -rf .tup/ src/*.[ao] src/*.so |