diff --git a/Makefile b/Makefile index 1a030fa..495b9bc 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,8 @@ CFLAGS ?= -Os CPPLAGS += -pedantic -Wall LDFLAGS += -lm -DESTDIR ?= /usr/local +PREFIX ?= /usr/local +DESTDIR ?= / BINS=ff-glitch ff-glitch2 @@ -13,7 +14,8 @@ all: $(BINS) $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $< $(LDFLAGS) install: $(BINS) - install $(BINS) $(DESTDIR)/bin + install -d $(DESTDIR)/$(PREFIX)/bin + install $(BINS) $(DESTDIR)/$(PREFIX)/bin clean: rm -f $(BINS) diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..65618d7 --- /dev/null +++ b/default.nix @@ -0,0 +1,10 @@ +with import {}; +stdenv.mkDerivation { + src = ./.; + name = "ff-glitch"; + enableParallelBuilding = true; + + installPhase = '' + make install PREFIX=$out + ''; +}