Add support for $(DESTDIR) to Makefiles.

This allows the files built for ($PREFXI) to be installed into
$(DESTDIR)$(PREFIX) - useful for building distribution packages. Use
like this:

   make DESTDIR=$PWD/build/
ENGINE-878
Hartmut Goebel 2 years ago
parent bcf55e3652
commit 3d96984c3c

@ -18,8 +18,8 @@ system.db: create_system_db.sql $(DICOS)
.PHONY: install
install: system.db
mkdir -p $(PER_MACHINE_DIRECTORY)
cp system.db $(PER_MACHINE_DIRECTORY)
mkdir -p $(DESTDIR)$(PER_MACHINE_DIRECTORY)
cp system.db $(DESTDIR)$(PER_MACHINE_DIRECTORY)
.PHONY: clean
clean:

@ -94,9 +94,9 @@ srcclean:
rm *.cc *.hh *.hxx
install: lib
mkdir -p "$(PREFIX)/lib/"
cp -v libpEpMIME.a $(PREFIX)/lib
mkdir -p "$(DESTDIR)$(PREFIX)/lib/"
cp -v libpEpMIME.a $(DESTDIR)$(PREFIX)/lib
uninstall:
rm $(PREFIX)/lib/libpEpMIME.a
rm $(DESTDIR)$(PREFIX)/lib/libpEpMIME.a

@ -101,26 +101,26 @@ clean:
# install_headers is needed for building *STANDALONE* pEp MIME - it is NOT used for built-in functionality!!!
install_headers: $(TARGET)
mkdir -p $(PREFIX)/include/pEp
mkdir -p $(DESTDIR)$(PREFIX)/include/pEp
cp pEpEngine.h keymanagement.h message_api.h dynamic_api.h stringlist.h \
timestamp.h identity_list.h bloblist.h stringpair.h message.h mime.h group.h \
cryptotech.h sync_api.h blacklist.h pEp_string.h openpgp_compat.h engine_sql.h \
labeled_int_list.h key_reset.h base64.h sync_codec.h distribution_codec.h storage_codec.h \
status_to_string.h aux_mime_msg.h keyreset_command.h platform.h platform_unix.h ../asn.1/*.h \
$(PREFIX)/include/pEp/
$(DESTDIR)$(PREFIX)/include/pEp/
# FIXME: Does anyone but Roker use install_headers? Otherwise, remove the dependency.
install: $(TARGET) install_headers
mkdir -p "$(PREFIX)/lib/"
cp -v $< $(PREFIX)/lib/
cp -v libpEpEngine.a $(PREFIX)/lib/
mkdir -p "$(DESTDIR)$(PREFIX)/lib/"
cp -v $< $(DESTDIR)$(PREFIX)/lib/
cp -v libpEpEngine.a $(DESTDIR)$(PREFIX)/lib/
beinstall: install
cp platform*.h $(PREFIX)/include/pEp/
cp platform*.h $(DESTDIR)$(PREFIX)/include/pEp/
uninstall:
rm -f $(PREFIX)/lib/$(TARGET)
rm -rf $(PREFIX)/include/pEp
rm -f $(DESTDIR)$(PREFIX)/lib/$(TARGET)
rm -rf $(DESTDIR)$(PREFIX)/include/pEp
tags: $(wildcard *.c) $(wildcard *.h)
ctags --sort=yes *.c *.h

Loading…
Cancel
Save