ENGINE-884: replacement for ENGINE-883 git hooks; moves functionality into build system for Linux. (N.B.: ENGINE-886 will address this for Windows.

pull/3/head
Krista Bennett 2 years ago
parent 8fc9172917
commit 9e9b3f9d72

@ -48,9 +48,8 @@ else
$(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
endif
ifeq (,$(wildcard commit_hash.h))
$(shell cp ../templates/commit_hash.h ./commit_hash.h)
endif
# Commit hash header file - if we don't run this, it won't build.
COMMIT_HASH:=$(shell git rev-parse HEAD)
ifdef SQLITE3_FROM_OS
NO_SOURCE+= sqlite3.c
@ -75,7 +74,7 @@ all: $(TARGET)
-include Makefile.protocols
%.d: %.c
%.d: %.c commit_hash.h
@set -e; rm -f $@; \
$(CC) -MM $(CFLAGS) $(CPPFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
@ -91,20 +90,28 @@ $(TARGET): libpEpEngine.a
.PHONY: objects clean install_headers install uninstall beinstall
objects: $(ALL_OBJECTS)
commit_hash.h:
ifeq (,$(COMMIT_HASH))
$(shell cp ../templates/commit_hash.h commit_hash.h)
else
sed "s/\(PEP_CURRENT_COMMIT_HASH\ =\).*/\1\"$(COMMIT_HASH)\"/" ../templates/commit_hash.h > commit_hash.h
endif
objects: $(ALL_OBJECTS) commit_hash.h
libpEpEngine.a: $(ALL_OBJECTS)
libpEpEngine.a: $(ALL_OBJECTS) commit_hash.h
$(AR) -rc $@ $^
clean:
rm -f *.d *.o *.a $(TARGET) *.dll *.so *.zip *.d.* *.def *~
rm -Rf $(TARGET).dSYM
rm -f KeySync_fsm.* Sync_actions.c Sync_event.* Sync_func.* Sync_impl.* sync_codec.* distribution_codec.*
rm -f commit_hash.h
# CAVEAT:
# install_headers is needed for building *STANDALONE* pEp MIME - it is NOT used for built-in functionality!!!
install_headers: $(TARGET)
install_headers: $(TARGET) commit_hash.h
mkdir -p $(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 \

@ -11,18 +11,12 @@
# if __has_include ("commit_hash.h")
# include "commit_hash.h"
# else
# define PEP_CURRENT_COMMIT_HASH="DUMMY_COMMIT_HASH_ERROR"
# define PEP_CURRENT_COMMIT_HASH = "DUMMY_COMMIT_HASH_ERROR"
# endif
#else
// Well, we tried. Better hope the git setup is correct.
// IF NOT, or you aren't using git, please copy the commit_hash.h file from
// templates/ into src/ if this include fails.
# include "commit_hash.h"
#endif
#include "commit_hash.h" // We need this everywhere. So.
// maximum attachment size to import as key 25MB, maximum of 20 attachments
#define MAX_KEY_SIZE (25 * 1024 * 1024)
#define MAX_KEYS_TO_IMPORT 20

Loading…
Cancel
Save