Index: librosprite.pc.in =================================================================== --- librosprite.pc.in (revision 0) +++ librosprite.pc.in (revision 0) @@ -0,0 +1,10 @@ +prefix=PREFIX +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: librosprite +Description: Loads RISC OS sprite files +Version: 0.0.1 +Libs: -L${libdir} -lrosprite +Cflags: -I${includedir} Index: Makefile =================================================================== --- Makefile (revision 518) +++ Makefile (working copy) @@ -2,6 +2,9 @@ CC = gcc LD = gcc DOXYGEN = doxygen +INSTALL = install +SED = sed + ARFLAGS = -cru CFLAGS = -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \ -Wwrite-strings -Wstrict-prototypes \ @@ -12,6 +15,11 @@ -Wmissing-declarations -Wmissing-prototypes LDFLAGS = -L./ +# Installation prefix, if not already defined (e.g. on command line) +PREFIX ?= /usr/local + +.PHONY: all clean docs install + all: example palette2c example: librosprite.a example.o @@ -30,5 +38,12 @@ ${DOXYGEN} clean: - rm -f $(wildcard *.o) $(wildcard *.a) example palette - rm -rf doc \ No newline at end of file + rm -f $(wildcard *.o) $(wildcard *.a) example palette2c librosprite.pc + rm -rf doc + +install: librosprite.a + $(INSTALL) --mode=644 -t $(PREFIX)/lib librosprite.a + $(INSTALL) --mode=644 -t $(PREFIX)/include librosprite.h + $(SED) -e 's#PREFIX#$(PREFIX)#' librosprite.pc.in >librosprite.pc + $(INSTALL) --mode=644 -t $(PREFIX)/lib/pkgconfig librosprite.pc +