Parcourir la source

Build Arduino packages by default

Frank Denis il y a 9 ans
Parent
commit
68668ade49
2 fichiers modifiés avec 17 ajouts et 2 suppressions
  1. 14 2
      Makefile
  2. 3 0
      hydrogen.h

+ 14 - 2
Makefile

@@ -6,17 +6,28 @@ RANLIB = avr-ranlib
 WFLAGS = -Wall -Wextra -Wmissing-prototypes -Wdiv-by-zero -Wbad-function-cast -Wcast-align -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wnested-externs -Wno-unknown-pragmas -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-enum -Wno-type-limits
 CFLAGS = -I. -mmcu=$(TARGET_DEVICE) -DHYDRO_HWTYPE=$(HYDRO_HWTYPE) -Os -mcall-prologues $(WFLAGS)
 OBJ = hydrogen.o
+ARDUINO_PACKAGE = hydrogen-crypto.zip
 SRC = \
+	hydrogen.c \
 	hydrogen.h \
-	impl/secretbox.h \
 	impl/common.h \
 	impl/core.h \
 	impl/hash.h \
+	impl/hash128.h \
 	impl/hydrogen_p.h \
 	impl/random.h \
+	impl/secretbox.h \
 	impl/stream.h
 
-all: libhydrogen.a
+all: package
+	7z a -tzip -mx=9 -r ${1}.zip $1
+
+package: $(ARDUINO_PACKAGE)
+
+$(ARDUINO_PACKAGE):
+	7z a -tzip -mx=9 -r $(ARDUINO_PACKAGE) $(SRC)
+
+lib: libhydrogen.a
 
 $(OBJ): $(SRC)
 
@@ -29,3 +40,4 @@ libhydrogen.a: $(OBJ)
 clean:
 	rm -f libhydrogen.a $(OBJ)
 	rm -f tests/tests
+	rm -f $(ARDUINO_PACKAGE)

+ 3 - 0
hydrogen.h

@@ -17,6 +17,9 @@ extern "C" {
 #define HYDRO_HWTYPE HYDRO_HWTYPE_ATMEGA328
 #endif
 
+#define HYDRO_VERSION_MAJOR 0
+#define HYDRO_VERSION_MINOR 1
+
 int hydro_init(void);
 
 /* ---------------- */