merged heads sync
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Sun, 07 Apr 2019 21:55:43 +0200
branchsync
changeset 34611f941d2d031a
parent 3460 0eb31e30e4fc
parent 3451 4b95e5f1fbf3
child 3462 652172b1b367
merged heads
src/pEpEngine.c
     1.1 --- a/.hgignore	Sun Apr 07 21:49:51 2019 +0200
     1.2 +++ b/.hgignore	Sun Apr 07 21:55:43 2019 +0200
     1.3 @@ -76,7 +76,11 @@
     1.4  sync/.actions
     1.5  sync/.codegen
     1.6  sync/.statemachines
     1.7 +sync/.copy
     1.8  test/msg_2.0.asc
     1.9  test/*Tests
    1.10  test/*.txt
    1.11  lldb-history
    1.12 +*.swo
    1.13 +test/.scripts
    1.14 +test/.suitemaker
     2.1 --- a/Makefile	Sun Apr 07 21:49:51 2019 +0200
     2.2 +++ b/Makefile	Sun Apr 07 21:55:43 2019 +0200
     2.3 @@ -19,11 +19,10 @@
     2.4      $(info ================================================)
     2.5  endif
     2.6  
     2.7 -.PHONY: all
     2.8  all:
     2.9  	$(MAKE) -C sync
    2.10  	$(MAKE) -C asn.1
    2.11 -	$(MAKE) -C src all
    2.12 +	$(MAKE) -C src
    2.13  
    2.14  .PHONY: install
    2.15  install: all
    2.16 @@ -60,6 +59,5 @@
    2.17  package: clean
    2.18  	cd .. ; COPYFILE_DISABLE=true tar cjf pEpEngine.tar.bz2 "$(HERE_REL)"
    2.19  
    2.20 -.PHONY: db
    2.21  db:
    2.22  	$(MAKE) -C db db
     3.1 --- a/Makefile.conf	Sun Apr 07 21:49:51 2019 +0200
     3.2 +++ b/Makefile.conf	Sun Apr 07 21:55:43 2019 +0200
     3.3 @@ -198,6 +198,16 @@
     3.4  #ETPAN_INC=-I$(HOME)/include
     3.5  
     3.6  
     3.7 +######### pEp MIME #########
     3.8 +# set this to skip libetpan and use PEP_MIME instead
     3.9 +# PEP_MIME=1
    3.10 +#
    3.11 +# pEp MIME library search flag
    3.12 +PEP_MIME_LIB=
    3.13 +# pEp MIME include search flag
    3.14 +PEP_MIME_INC=
    3.15 +
    3.16 +
    3.17  ######### sqlite3 #########
    3.18  # If empty (or undefined), compile sqlite3 from the sources shipped with the pEp distribution.
    3.19  # Otherwise, use an sqlite3 implementation found in the OS's include/library paths.
     4.1 --- a/asn.1/Makefile	Sun Apr 07 21:49:51 2019 +0200
     4.2 +++ b/asn.1/Makefile	Sun Apr 07 21:55:43 2019 +0200
     4.3 @@ -6,25 +6,23 @@
     4.4  ALL_SOURCE=$(subst $(NO_SOURCE),,$(wildcard *.c))
     4.5  ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE))
     4.6  
     4.7 -all: generate
     4.8 +all: Sync.c
     4.9  	make libasn1.a
    4.10  
    4.11  libasn1.a: $(ALL_OBJECTS)
    4.12  	$(AR) -rc $@ $(ALL_OBJECTS)
    4.13  
    4.14 -generate: Sync.c
    4.15 -	rm -f converter-sample.c
    4.16 -
    4.17  %.o: %.c %.h
    4.18  	$(CC) $(CFLAGS) $(OPTIMIZE) -I. $(ASN1C_INC) -c $< -o $@
    4.19  
    4.20  Sync.c: sync.asn1 keysync.asn1 pEp.asn1
    4.21  	$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 keysync.asn1 $<
    4.22 +	rm -f converter-sample.c
    4.23  
    4.24  sync.asn1 keysync.asn1 pEp.asn1:
    4.25  	cp -f ../sync/generated/*.asn1 ../asn.1
    4.26  
    4.27 -.PHONY: clean install uninstall tags
    4.28 +.PHONY: clean uninstall tags
    4.29  
    4.30  clean:
    4.31  	rm -f *.a *.o *.c *.h *.sample sync.asn1 keysync.asn1
     5.1 --- a/src/Makefile	Sun Apr 07 21:49:51 2019 +0200
     5.2 +++ b/src/Makefile	Sun Apr 07 21:55:43 2019 +0200
     5.3 @@ -5,27 +5,34 @@
     5.4  
     5.5  include ../Makefile.conf
     5.6  
     5.7 -CFLAGS+= $(ETPAN_INC) -I../asn.1 -DSYSTEM_DB=\"$(SYSTEM_DB)\" $(EXTRA_MACROS)
     5.8 -LDFLAGS+= $(ETPAN_LIB) -L../asn.1 -shared
     5.9 -LDLIBS+= -lc -letpan -lasn1
    5.10 +CFLAGS+= $(ETPAN_INC) $(PEP_MIME_INC) -I../asn.1 -DSYSTEM_DB=\"$(SYSTEM_DB)\" $(EXTRA_MACROS)
    5.11 +LDFLAGS+= $(ETPAN_LIB) $(PEP_MIME_LIB) -L../asn.1 -shared
    5.12 +LDLIBS+= -lc -lasn1
    5.13  NO_SOURCE=
    5.14  
    5.15 +ifndef PEP_MIME
    5.16 +LDLIBS+= -letpan
    5.17 +else
    5.18 +LDLIBS+= -lpEpMIME
    5.19 +NO_SOURCE+= etpan_mime.c
    5.20 +endif
    5.21 +
    5.22  ifeq ($(BUILD_ON),Darwin)
    5.23      ifeq ($(BUILD_FOR),Darwin)
    5.24          CFLAGS+= -DSQLITE_THREADSAFE=1
    5.25          LDLIBS+= -lz -liconv
    5.26      else
    5.27 -        $(error I don't know how to make for $(BUILD_FOR) on $(BUILD_ON))
    5.28 +        $(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
    5.29      endif
    5.30  else ifeq ($(BUILD_ON),Linux)
    5.31      ifeq ($(BUILD_FOR),Linux)
    5.32          CFLAGS+= -DSQLITE_THREADSAFE=1 -D_GNU_SOURCE
    5.33          LDLIBS+= -ldl -luuid
    5.34      else
    5.35 -        $(error I don't know how to make for $(BUILD_FOR) on $(BUILD_ON))
    5.36 +        $(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
    5.37      endif
    5.38  else
    5.39 -    $(error I don't know how to make for $(BUILD_FOR) on $(BUILD_ON))
    5.40 +    $(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
    5.41  endif
    5.42  
    5.43  ifdef SQLITE3_FROM_OS
    5.44 @@ -57,7 +64,6 @@
    5.45  DEPENDS=$(subst .c,.d,$(ALL_SOURCE))
    5.46  ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE))
    5.47  
    5.48 -.PHONY: all
    5.49  all: $(TARGET)
    5.50  
    5.51  -include Makefile.protocols
    5.52 @@ -76,7 +82,6 @@
    5.53  $(TARGET): libpEpEngine.a
    5.54  	$(CC) $(ALL_OBJECTS) $(LDFLAGS) $(LDLIBS) -o $@
    5.55  
    5.56 -.PHONY: objects
    5.57  objects: $(ALL_OBJECTS)
    5.58  
    5.59  libpEpEngine.a: $(ALL_OBJECTS)
    5.60 @@ -88,10 +93,10 @@
    5.61  	rm -Rf $(TARGET).dSYM
    5.62  	rm -f KeySync_fsm.* Sync_actions.c Sync_event.* Sync_func.* Sync_impl.* sync_codec.*
    5.63  
    5.64 -.PHONY: install
    5.65 -install: $(TARGET)
    5.66 -	mkdir -p "$(PREFIX)/lib/"
    5.67 -	cp $< $(PREFIX)/lib/
    5.68 +# CAVEAT:
    5.69 +# install_headers is needed for building pEp MIME
    5.70 +
    5.71 +install_headers:
    5.72  	mkdir -p $(PREFIX)/include/pEp
    5.73  	cp pEpEngine.h keymanagement.h message_api.h dynamic_api.h stringlist.h \
    5.74  	   timestamp.h identity_list.h bloblist.h stringpair.h message.h mime.h \
    5.75 @@ -99,6 +104,10 @@
    5.76  	   labeled_int_list.h key_reset.h base64.h sync_codec.h \
    5.77  	   ../asn.1/*.h $(PREFIX)/include/pEp/
    5.78  
    5.79 +install: $(TARGET) install_headers
    5.80 +	mkdir -p "$(PREFIX)/lib/"
    5.81 +	cp $< $(PREFIX)/lib/
    5.82 +
    5.83  .PHONY: uninstall
    5.84  uninstall:
    5.85  	rm -f $(PREFIX)/lib/$(TARGET)
     6.1 --- a/src/pEpEngine.c	Sun Apr 07 21:49:51 2019 +0200
     6.2 +++ b/src/pEpEngine.c	Sun Apr 07 21:55:43 2019 +0200
     6.3 @@ -11,7 +11,7 @@
     6.4  #include <time.h>
     6.5  #include <stdlib.h>
     6.6  
     6.7 -#define _PEP_SQLITE_DEBUG 1
     6.8 +#define _PEP_SQLITE_DEBUG 0
     6.9  #if _PEP_SQLITE_DEBUG
    6.10  #include <sqlite3.h>
    6.11  #endif
     7.1 --- a/sync/Makefile	Sun Apr 07 21:49:51 2019 +0200
     7.2 +++ b/sync/Makefile	Sun Apr 07 21:55:43 2019 +0200
     7.3 @@ -3,7 +3,7 @@
     7.4  
     7.5  include ../Makefile.conf
     7.6  
     7.7 -all: copy
     7.8 +all: .copy
     7.9  
    7.10  generated:
    7.11  	mkdir -p $@
    7.12 @@ -26,9 +26,9 @@
    7.13  	rm -rf generated
    7.14  	rm -f *.xml *.xsl .statemachines .actions .codecs .messages *.dot *.svg
    7.15  
    7.16 -.PHONY: copy
    7.17 -copy: .actions .statemachines .codecs .messages
    7.18 +.copy: .actions .statemachines .codecs .messages
    7.19  	cp -f generated/*.c generated/*.h ../src
    7.20 +	touch .copy
    7.21  
    7.22  %.xml: %.fsm
    7.23  	yml2c $< -o $@
     8.1 --- a/test/Makefile	Sun Apr 07 21:49:51 2019 +0200
     8.2 +++ b/test/Makefile	Sun Apr 07 21:55:43 2019 +0200
     8.3 @@ -96,17 +96,13 @@
     8.4  TEST_CMD_PFX=
     8.5  
     8.6  
     8.7 -.PHONY: all
     8.8 -all: suitemaker $(TARGET) scripts
     8.9 +all: src/SuiteMaker.cc
    8.10 +	make $(TARGET) .scripts
    8.11  
    8.12  %.d: %.cc
    8.13  	$(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $< | sed -e 's,\($*\)\.o[ :]*,\1.o $@: ,g' > $@
    8.14  
    8.15 -$(TARGET): $(OBJS)
    8.16 -	$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@
    8.17 -
    8.18 -.PHONY: suitemaker
    8.19 -suitemaker:
    8.20 +src/SuiteMaker.cc: gensuitemaker.py
    8.21  ifndef PY_ENV
    8.22  	@echo "WARNING: Can't find python3 - this is fine unless you're adding test suites. If so, please install python3."
    8.23  else
    8.24 @@ -116,22 +112,25 @@
    8.25  	# Comma-separated list, no spaces
    8.26  	$(PY_ENV) gensuitemaker.py --exclude=$(EXCLUDE)
    8.27  endif
    8.28 +	touch .suitemaker
    8.29  endif
    8.30  
    8.31 -.PHONY: scripts
    8.32 -scripts:
    8.33 +$(TARGET): $(OBJS)
    8.34 +	$(LINK.cc) $(OBJS) $(LOADLIBES) $(LDLIBS) -o $@
    8.35 +
    8.36 +.scripts:
    8.37  ifdef PY_ENV
    8.38  	$(PY_ENV) genscripts.py
    8.39 +	touch .scripts
    8.40  endif
    8.41  
    8.42 -.PHONY: test
    8.43  test: all
    8.44  	$(TEST_CMD_PFX) $(TEST_DEBUGGER) ./$(TARGET)
    8.45  
    8.46  .PHONY: clean
    8.47  clean:
    8.48  	$(RM) $(TARGET) $(TARGET).o $(TARGET).d $(OBJS) $(notdir $(basename $(OBJS))) $(DEPS)
    8.49 -	$(RM) $(HERE)/*Tests msg_2.0.asc $(HERE)/pEp_test_home
    8.50 +	$(RM) $(HERE)/*Tests msg_2.0.asc $(HERE)/pEp_test_home .scripts
    8.51  
    8.52  # If only the goal 'clean' is given, do not generate and include the '%.d' files.¬
    8.53  ifneq ($(MAKECMDGOALS),clean)