Makefile improvements (#50)

* Add Libs.private to pkg-config file
* Allow users to specify `PREFIX` in Makefile
This commit is contained in:
Lennart Grahl 2017-04-28 14:15:16 +02:00 committed by Richard Aas
parent a1f84fe762
commit b7aeedc7bb

View file

@ -35,9 +35,9 @@ MODULES += json
INSTALL := install
ifeq ($(DESTDIR),)
PREFIX := /usr/local
PREFIX ?= /usr/local
else
PREFIX := /usr
PREFIX ?= /usr
endif
ifeq ($(LIBDIR),)
LIBDIR := $(PREFIX)/lib
@ -85,6 +85,7 @@ libre.pc:
@echo 'Version: '$(VERSION) >> libre.pc
@echo 'URL: http://creytiv.com/re.html' >> libre.pc
@echo 'Libs: -L$${libdir} -lre' >> libre.pc
@echo 'Libs.private: -L$${libdir} -lre ${LIBS}' >> libre.pc
@echo 'Cflags: -I$${includedir}' >> libre.pc
$(BUILD)/%.o: src/%.c $(BUILD) Makefile $(MK) $(MODMKS)