summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-07-20 15:18:48 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-07-20 15:18:48 (GMT)
commitdc107107f73942574a0b2d1d9c1edd05b0ff1796 (patch)
treef9c798a6f3d3e6d67e5f5ad3bdccb319d25582c0 /Makefile
parent1870d48fc8ec38978a3ce4e262cded70216b84d0 (diff)
downloadlz4-dc107107f73942574a0b2d1d9c1edd05b0ff1796.zip
lz4-dc107107f73942574a0b2d1d9c1edd05b0ff1796.tar.gz
lz4-dc107107f73942574a0b2d1d9c1edd05b0ff1796.tar.bz2
Added : pkg-config (issue 135)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 16 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 28a0bfc..f9775db 100644
--- a/Makefile
+++ b/Makefile
@@ -31,7 +31,8 @@
# ################################################################
# Version numbers
-export RELEASE=rc120
+VERSION=120
+export RELEASE=r$(VERSION)
LIBVER_MAJOR=1
LIBVER_MINOR=3
LIBVER_PATCH=0
@@ -101,19 +102,29 @@ liblz4: lz4.c lz4hc.c
@ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT)
clean:
- @rm -f core *.o *.a *.$(SHARED_EXT) *.$(SHARED_EXT).* $(DISTRIBNAME) *.sha1
+ @rm -f core *.o *.a *.$(SHARED_EXT) *.$(SHARED_EXT).* $(DISTRIBNAME) *.sha1 liblz4.pc
@cd $(PRGDIR); $(MAKE) clean
@echo Cleaning completed
+#------------------------------------------------------------------------
#make install option is designed for Linux & OSX targets only
+
ifneq (,$(filter $(shell uname),Linux Darwin))
-install: liblz4
- @install -d -m 755 $(DESTDIR)$(LIBDIR)/ $(DESTDIR)$(INCLUDEDIR)/
+liblz4.pc: liblz4.pc.in Makefile
+ sed -e 's|@PREFIX@|$(PREFIX)|' \
+ -e 's|@LIBDIR@|$(LIBDIR)|' \
+ -e 's|@INCLUDEDIR@|$(INCLUDEDIR)|' \
+ -e 's|@VERSION@|$(VERSION)|' \
+ $< >$@
+
+install: liblz4 liblz4.pc
+ @install -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/ $(DESTDIR)$(INCLUDEDIR)/
@install -m 755 liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER)
@cp -a liblz4.$(SHARED_EXT_MAJOR) $(DESTDIR)$(LIBDIR)
@cp -a liblz4.$(SHARED_EXT) $(DESTDIR)$(LIBDIR)
+ @cp -a liblz4.pc $(DESTDIR)$(LIBDIR)/pkgconfig/
@install -m 644 liblz4.a $(DESTDIR)$(LIBDIR)/liblz4.a
@install -m 644 lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h
@install -m 644 lz4hc.h $(DESTDIR)$(INCLUDEDIR)/lz4hc.h
@@ -123,6 +134,7 @@ install: liblz4
uninstall:
rm -f $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT)
rm -f $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_MAJOR)
+ rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/liblz4.pc
[ -x $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER) ] && rm -f $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER)
[ -f $(DESTDIR)$(LIBDIR)/liblz4.a ] && rm -f $(DESTDIR)$(LIBDIR)/liblz4.a
[ -f $(DESTDIR)$(INCLUDEDIR)/lz4.h ] && rm -f $(DESTDIR)$(INCLUDEDIR)/lz4.h