diff --git a/.gitmodules b/.gitmodules index 82b4940..9514a0d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "libjade"] path = libjade url = https://github.com/Rixxc/libjade.git -[submodule "jasmin"] - path = jasmin - url = https://github.com/Rixxc/jasmin.git diff --git a/Makefile b/Makefile index 0c3e93c..823a4cb 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -JC ?= jasmin/compiler/jasminc +JC ?= jasminc CC ?= gcc MAKE ?= make -.PHONY: clean run $(JC) +.PHONY: clean run all: build @true @@ -16,10 +16,7 @@ build/%.o: build/%.S clean: rm build/* 2> /dev/null || true -$(JC): - nix-shell jasmin/default.nix --command 'make -C jasmin/compiler CIL -j$(nproc) && make -C jasmin/compiler' - -build/%.S: src/%.jazz $(JC) +build/%.S: src/%.jazz JASMINPATH="Jade=libjade/src/" $(JC) $< -o $@ syscall/jasmin_syscall.o: syscall/jasmin_syscall.c syscall/jasmin_syscall.h diff --git a/default.nix b/default.nix index 8b6e489..f0547df 100644 --- a/default.nix +++ b/default.nix @@ -1,15 +1,22 @@ { pkgs ? import { } }: with pkgs; -# let -# jasmin-src = fetchFromGitHub { -# owner = "jasmin-lang"; -# repo = "jasmin"; -# rev = "9bb6340fe0e3c5d78ea3957f6c5c3564c3424770"; -# hash = "sha256-EVwnD6dZLTy9MgR6gdymhg3Ipudpj1mchDlMpCAdITE="; -# }; -# -# jasmin = callPackage "${jasmin-src}/default.nix" { inherit pkgs; }; -# in +let + jasmin-src = fetchFromGitHub { + owner = "Rixxc"; + repo = "jasmin"; + rev = "244d42d2a8c37d7607abf7dd5e92eddd2c339340"; + hash = "sha256-EDLsFsRZmSzei2LvgJfI6W+DiErnfrwO7ciom/1+6BQ="; + }; + + jasmin-drv = callPackage "${jasmin-src}/default.nix" { inherit pkgs; }; + jasmin = jasmin-drv.overrideAttrs { + name = "jasmin with syscalls"; + buildPhase = '' + make -C compiler/ CIL + make -C compiler/ + ''; + }; +in stdenv.mkDerivation { name = "x25519-agent"; src = nix-gitignore.gitignoreSource [ ] ./.; @@ -17,15 +24,15 @@ stdenv.mkDerivation { nativeBuildInputs = [ gnumake gcc - # jasmin + jasmin ]; - # configurePhase = '' - # mkdir build - # ''; - # - # installPhase = '' - # mkdir -p $out/lib - # cp build/libagent.a $out/lib - # ''; + configurePhase = '' + mkdir build + ''; + + installPhase = '' + mkdir -p $out/lib + cp build/libagent.a $out/lib + ''; } diff --git a/jasmin b/jasmin deleted file mode 160000 index 244d42d..0000000 --- a/jasmin +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 244d42d2a8c37d7607abf7dd5e92eddd2c339340