logo

error-standalone

standalone <error.h> implementation intended for muslgit clone https://anongit.hacktivis.me/git/error-standalone.git/

Makefile (1158B)


  1. # Copyright © 2024 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  2. # SPDX-License-Identifier: MIT
  3. PREFIX ?= /usr
  4. LIBDIR ?= ${PREFIX}/lib
  5. INCDIR ?= ${PREFIX}/include
  6. PKG_CONFIG_DIR = ${LIBDIR}/pkgconfig/
  7. all: liberror.so liberror.a
  8. error.o: error.c error.h
  9. ${CC} ${CFLAGS} -c -o error.o error.c
  10. test-error: test-error.c error.o
  11. ${CC} ${CFLAGS} -o test-error test-error.c error.o ${LDFLAGS} ${LDSTATIC}
  12. liberror.so: error.o
  13. ${CC} ${CFLAGS} -shared -Wl,-soname=liberror.so -o liberror.so error.o ${LDFLAGS}
  14. liberror.a: error.o
  15. ${AR} rc liberror.a error.o
  16. install-shared: install liberror.so
  17. mkdir -p ${DESTDIR}${LIBDIR}/
  18. cp -p liberror.so ${DESTDIR}${LIBDIR}/
  19. install-static: install liberror.a
  20. mkdir -p ${DESTDIR}${LIBDIR}/
  21. cp -p liberror.a ${DESTDIR}${LIBDIR}/
  22. install:
  23. mkdir -p ${DESTDIR}${INCDIR}/
  24. cp error.h ${DESTDIR}${INCDIR}/error.h
  25. mkdir -p ${DESTDIR}${PKG_CONFIG_DIR}/
  26. sed -e 's;@PREFIX@;${PREFIX};' -e 's;@LIBDIR@;${LIBDIR};' -e 's;@INCDIR@;${INCDIR};' error-standalone.pc.in > ${DESTDIR}${PKG_CONFIG_DIR}/error-standalone.pc
  27. clean:
  28. rm -f error.o liberror.so liberror.a
  29. .PHONY: install-shared install-static install clean