diff --git a/Makefile b/Makefile index 50b1ba3..e7b1b5a 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ TESTS = $(wildcard tests/*.c) EXAMPLES = $(wildcard examples/*.c) EXAMPLESEXE = $(EXAMPLES:.c=) -.PHONY: all check clean libs +.PHONY: all check clean libs $(DIST)/$(PROJ).pc all: $(EXAMPLESEXE) check @@ -50,14 +50,19 @@ $(DIST)/lib$(PROJ).a: $(PROJ).c mpc.h libs: $(DIST)/lib$(PROJ).so $(DIST)/lib$(PROJ).a +$(DIST)/$(PROJ).pc: $(DIST) $(PROJ).pc + cp $(PROJ).pc $(DIST)/$(PROJ).pc + sed -i '1i\prefix=$(PREFIX)/' $(DIST)/$(PROJ).pc + clean: rm -rf -- $(DIST) install: all - install -d -m644 $(DESTDIR)$(PREFIX)/{include,lib,share/$(PROJ)} + install -d -m644 $(DESTDIR)$(PREFIX)/{include,lib/pkgconfig,share/$(PROJ)} install -m755 -t $(DESTDIR)$(PREFIX)/lib $(DIST)/lib* install -m644 -t $(DESTDIR)$(PREFIX)/share/$(PROJ) $(PROJ).{c,h} install -m644 $(PROJ).h $(DESTDIR)$(PREFIX)/include/$(PROJ).h + install -m644 $(DIST)/$(PROJ).pc $(DESTDIR)$(PREFIX)/lib/pkgconfig/$(PROJ).pc uninstall: rm -rf -- \ diff --git a/mpc.pc b/mpc.pc new file mode 100644 index 0000000..858f0c7 --- /dev/null +++ b/mpc.pc @@ -0,0 +1,8 @@ +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: mpc +Description: Library for creating parser combinators +Version: 0.9.0 +Libs: -L${libdir} -lmpc +Cflags: -I${includedir}