summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Shaw <jshaw@netsurf-browser.org>2008-03-29 13:09:26 (GMT)
committer James Shaw <jshaw@netsurf-browser.org>2008-03-29 13:09:26 (GMT)
commit5ca451cf34283a7f23dfaa9864a6c422c0229f0c (patch)
treedcbe3ba0f4099b9fce51884bb8ee7d2af0b2cdb4
parente38094d32d15263b23b8571a691e2c38ad8e6bdb (diff)
downloadlibrosprite-5ca451cf34283a7f23dfaa9864a6c422c0229f0c.tar.gz
librosprite-5ca451cf34283a7f23dfaa9864a6c422c0229f0c.tar.bz2
Add install target to Makefile -- thanks to John Mark Bell
svn path=/import/jshaw/libsprite/; revision=10021
-rw-r--r--trunk/Makefile28
-rw-r--r--trunk/librosprite.pc.in10
2 files changed, 36 insertions, 2 deletions
diff --git a/trunk/Makefile b/trunk/Makefile
index 0dcabcb..84bd408 100644
--- a/trunk/Makefile
+++ b/trunk/Makefile
@@ -2,6 +2,10 @@ AR = ar
CC = gcc
LD = gcc
DOXYGEN = doxygen
+INSTALL = install
+SED = sed
+MKDIR = mkdir
+
ARFLAGS = -cru
CFLAGS = -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \
-Wwrite-strings -Wstrict-prototypes \
@@ -12,6 +16,16 @@ CFLAGS = -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \
-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
+
+# 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 +44,15 @@ docs:
${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
+ $(MKDIR) -p $(PREFIX)/lib/pkgconfig
+ $(MKDIR) -p $(PREFIX)/lib
+ $(MKDIR) -p $(PREFIX)/include
+ $(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
+
diff --git a/trunk/librosprite.pc.in b/trunk/librosprite.pc.in
new file mode 100644
index 0000000..322ca21
--- a/dev/null
+++ b/trunk/librosprite.pc.in
@@ -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}