diff --git a/.gitignore b/.gitignore index 75ffb8b..73c6c67 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.o *.so* *.1 +libxdo.pc xdo_version.h xdotool diff --git a/Makefile b/Makefile index b18b8fb..f7d4555 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ INSTALLBIN?=$(PREFIX)/bin INSTALLLIB?=$(PREFIX)/lib INSTALLMAN?=$(PREFIX)/man INSTALLINCLUDE?=$(PREFIX)/include +INSTALLPC?=$(PREFIX)/lib/pkgconfig LDCONFIG?=ldconfig DPREFIX=$(DESTDIR)$(PREFIX) @@ -11,6 +12,7 @@ DINSTALLBIN=$(DESTDIR)$(INSTALLBIN) DINSTALLLIB=$(DESTDIR)$(INSTALLLIB) DINSTALLMAN=$(DESTDIR)$(INSTALLMAN) DINSTALLINCLUDE=$(DESTDIR)$(INSTALLINCLUDE) +DINSTALLPC=$(DESTDIR)$(INSTALLPC) MAJOR=$(shell sh version.sh --major) VERSION=$(shell sh version.sh) @@ -69,7 +71,7 @@ xdotool.static: xdotool.o $(CMDOBJS) xdo.o xdo_search.o $(CC) -o xdotool.static xdotool.o xdo.o xdo_search.o $(CMDOBJS) $(LDFLAGS) -lm $(XDOTOOL_LIBS) $(LIBXDO_LIBS) .PHONY: install -install: pre-install installlib installprog installman installheader post-install +install: pre-install installlib installprog installman installheader installpc post-install .PHONY: pre-install pre-install: @@ -100,6 +102,11 @@ installheader: xdo.h install -d $(DINSTALLINCLUDE) install xdo.h $(DINSTALLINCLUDE)/xdo.h +.PHONY: installpc +installpc: libxdo.pc + install -d $(DINSTALLPC) + install libxdo.pc $(DINSTALLPC)/libxdo.pc + .PHONY: installman installman: xdotool.1 install -d $(DINSTALLMAN)/man1 @@ -142,6 +149,9 @@ libxdo.a: xdo.o xdo_search.o libxdo.$(VERLIBSUFFIX): libxdo.$(LIBSUFFIX) ln -s $< $@ +libxdo.pc: + sh pc.sh $(VERSION) $(INSTALLLIB) $(INSTALLINCLUDE) > libxdo.pc + # xdotool the binary requires libX11 now for XSelectInput and friends. # This requirement will go away once more things are refactored into # libxdo. diff --git a/pc.sh b/pc.sh new file mode 100755 index 0000000..da7c81d --- /dev/null +++ b/pc.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +VERSION=$1 +LIBDIR=$2 +INCLUDEDIR=$3 + +cat <