added pkconfig target

This commit is contained in:
Richard Aas 2015-09-21 05:40:56 +00:00
parent 68c278b1e9
commit 7798e7f379

View file

@ -73,6 +73,19 @@ ifneq ($(RANLIB),)
@$(RANLIB) $@
endif
libre.pc:
@echo 'prefix='$(PREFIX) > libre.pc
@echo 'exec_prefix=$${prefix}' >> libre.pc
@echo 'libdir=$${prefix}/lib' >> libre.pc
@echo 'includedir=$${prefix}/include/re' >> libre.pc
@echo '' >> libre.pc
@echo 'Name: libre' >> libre.pc
@echo 'Description: ' >> libre.pc
@echo 'Version: '$(VERSION) >> libre.pc
@echo 'URL: http://creytiv.com/re.html' >> libre.pc
@echo 'Libs: -L$${libdir} -lre' >> libre.pc
@echo 'Cflags: -I$${includedir}' >> libre.pc
$(BUILD)/%.o: src/%.c $(BUILD) Makefile $(MK) $(MODMKS)
@echo " CC $@"
@$(CC) $(CFLAGS) -c $< -o $@ $(DFLAGS)
@ -85,15 +98,17 @@ $(BUILD): Makefile $(MK) $(MODMKS)
.PHONY: clean
clean:
@rm -rf $(SHARED) $(STATIC) test.d test.o test $(BUILD)
@rm -rf $(SHARED) $(STATIC) libre.pc test.d test.o test $(BUILD)
install: $(SHARED) $(STATIC)
@mkdir -p $(DESTDIR)$(LIBDIR) $(DESTDIR)$(INCDIR) $(DESTDIR)$(MKDIR)
install: $(SHARED) $(STATIC) libre.pc
@mkdir -p $(DESTDIR)$(LIBDIR) $(DESTDIR)$(LIBDIR)/pkgconfig \
$(DESTDIR)$(INCDIR) $(DESTDIR)$(MKDIR)
$(INSTALL) -m 0644 $(shell find include -name "*.h") \
$(DESTDIR)$(INCDIR)
$(INSTALL) -m 0755 $(SHARED) $(DESTDIR)$(LIBDIR)
$(INSTALL) -m 0755 $(STATIC) $(DESTDIR)$(LIBDIR)
$(INSTALL) -m 0644 libre.pc $(DESTDIR)$(LIBDIR)/pkgconfig
$(INSTALL) -m 0644 $(MK) $(DESTDIR)$(MKDIR)
uninstall:
@ -101,6 +116,7 @@ uninstall:
@rm -rf $(DESTDIR)$(MKDIR)
@rm -f $(DESTDIR)$(LIBDIR)/$(SHARED)
@rm -f $(DESTDIR)$(LIBDIR)/$(STATIC)
@rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/libre.pc
-include test.d