From 38d3fe573f4d0ad2115eaca71a0b8f67fd01a580 Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 30 Nov 2017 06:42:49 +0100 Subject: build-sandbox: Move to top-level build-support This is not only useful for packaging games, so let's make it available from the vuizvui scope, so we can use it from other packages as well. Signed-off-by: aszlig --- pkgs/build-support/build-sandbox/src/Makefile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pkgs/build-support/build-sandbox/src/Makefile (limited to 'pkgs/build-support/build-sandbox/src/Makefile') diff --git a/pkgs/build-support/build-sandbox/src/Makefile b/pkgs/build-support/build-sandbox/src/Makefile new file mode 100644 index 00000000..cd642b8e --- /dev/null +++ b/pkgs/build-support/build-sandbox/src/Makefile @@ -0,0 +1,23 @@ +BINARIES = $(wildcard $(BINDIR)/*) +WRAPPERS = $(subst $(BINDIR),$(out)/bin,$(BINARIES)) + +NIX_VERSION = `pkg-config --modversion nix-main | \ + sed -e 's/^\([0-9]\+\)\.\([0-9]\+\).*/\1\2/'` + +OBJECTS = nix-query.o path-cache.o params.o setup.o + +CFLAGS = -g -Wall -std=gnu11 -DFS_ROOT_DIR=\"$(out)\" +CXXFLAGS = -g -Wall -std=c++14 `pkg-config --cflags nix-main` +CXXFLAGS += -DNIX_VERSION=$(NIX_VERSION) +LDFLAGS = `pkg-config --libs nix-main` + +all: $(OBJECTS) + +$(out)/bin/%: CFLAGS += -DWRAPPED_PROGNAME=\"$(@F)\" +$(out)/bin/%: CFLAGS += -DWRAPPED_PATH=\"$(BINDIR)/$(@F)\" +$(out)/bin/%: $(OBJECTS) + mkdir -p $(out)/bin + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $? sandbox.c + +.PHONY: install +install: $(WRAPPERS) -- cgit 1.4.1