summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-02-17 02:40:00 +0100
committerMattias Andrée <maandree@operamail.com>2014-02-17 02:40:00 +0100
commitda569639d7dc09f560db377842105de8a73b2e44 (patch)
tree24b12e3643e4deceee24ad0ea7a5fc36ba0b000d /Makefile
parentfinish makefile (diff)
downloadblueshift-da569639d7dc09f560db377842105de8a73b2e44.tar.gz
blueshift-da569639d7dc09f560db377842105de8a73b2e44.tar.bz2
blueshift-da569639d7dc09f560db377842105de8a73b2e44.tar.xz
fix datadir and libdir in source files when building
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 11 insertions, 5 deletions
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