From da569639d7dc09f560db377842105de8a73b2e44 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 17 Feb 2014 02:40:00 +0100 Subject: fix datadir and libdir in source files when building MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c9a895f..5ae2a67 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,7 @@ STD = c99 FLAGS = $$($(PKGCONFIG) --cflags --libs $(LIBS)) -std=$(STD) $(WARN) $(OPTIMISE) -fPIC DATAFILES = 2deg 10deg redshift redshift_old +PYFILES = colour.py curve.py monitor.py solar.py @@ -36,15 +37,20 @@ all: command command: bin/blueshift_randr.so bin/blueshift -bin/blueshift.zip: src/*.py - @mkdir -p bin - cd src && zip ../$@ *.py - -bin/blueshift: bin/blueshift.zip +bin/blueshift: obj/blueshift.zip echo '#!/usr/bin/python3' > $@ cat $< >> $@ chmod a+x $@ +obj/blueshift.zip: $(foreach F,$(PYFILES),obj/$(F)) + @mkdir -p bin + cd obj && zip ../$@ $(foreach F,$(PYFILES),$(F)) + +obj/%.py: src/%.py + cp $< $@ + sed -i '/^DATADIR *= /s#^.*$$#DATADIR = '\''$(DATADIR)/$(PKGNAME)'\''#' $@ + sed -i '/^LIBDIR *= /s#^.*$$#LIBDIR = '\''$(LIBDIR)'\''#' $@ + bin/blueshift_randr.so: obj/blueshift_randr.o obj/blueshift_randr_c.o @mkdir -p bin -- cgit v1.2.3-70-g09d2