-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from mirage/new-layout
New layout about freestanding & xen artifacts
- Loading branch information
Showing
18 changed files
with
153 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
opam install -y mirage | ||
(cd mirage && mirage configure -t unix && make depends && mirage build && ./digestif_test && mirage clean && cd ..) || exit 1 | ||
(cd mirage && mirage configure -t hvt && make depends && mirage build && mirage clean && cd ..) || exit 1 | ||
if [ $(uname -m) = "amd64" ] || [ $(uname -m) = "x86_64" ]; then | ||
(cd mirage && mirage configure -t xen && make depend && mirage build && mirage clean && cd ..) || exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
(lang dune 2.6) | ||
(lang dune 2.7) | ||
(name digestif) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
PKG_CONFIG_PATH := $(shell opam config var prefix)/lib/pkgconfig | ||
|
||
EXISTS := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --exists ocaml-freestanding; echo $$?) | ||
|
||
.PHONY: all clean | ||
all: libdigestif_freestanding_stubs.a | ||
|
||
ifeq ($(EXISTS), 1) | ||
libdigestif_freestanding_stubs.a: | ||
touch $@ | ||
else | ||
CC ?= cc | ||
FREESTANDING_CFLAGS := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --cflags ocaml-freestanding) | ||
CFLAGS := -O3 $(FREESTANDING_CFLAGS) | ||
|
||
OBJS= blake2b.o blake2s.o md5.o ripemd160.o sha1.o sha256.o sha512.o sha3.o whirlpool.o misc.o stubs.o | ||
|
||
libdigestif_freestanding_stubs.a: $(OBJS) | ||
$(AR) r $@ $^ | ||
endif | ||
|
||
clean: | ||
$(RM) $(OBJS) libdigestif_freestanding_stubs.a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
(copy_files# | ||
(alias install) | ||
(files ../src-c/native/*)) | ||
|
||
(rule | ||
(deps Makefile) | ||
(targets libdigestif_freestanding_stubs.a) | ||
(action | ||
(no-infer | ||
(progn | ||
(run %{make}))))) | ||
|
||
(install | ||
(package digestif) | ||
(section lib) | ||
(files libdigestif_freestanding_stubs.a)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
true: package(digestif.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
open Mirage | ||
|
||
let main = foreign "Unikernel.Make" (console @-> job) | ||
|
||
let packages = [ package "digestif" ] | ||
|
||
let () = register ~packages "digestif-test" [ main $ default_console ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Make (Console : Mirage_console.S) = struct | ||
let log console fmt = Format.kasprintf (Console.log console) fmt | ||
|
||
let start console = | ||
let hash = Digestif.SHA1.digest_string "Hello World!" in | ||
log console "%a" Digestif.SHA1.pp hash | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.