summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-02-24 07:11:30 +0100
committerMattias Andrée <maandree@operamail.com>2014-02-24 07:11:30 +0100
commit1123e48fc4cd9a7894e48117981415b76c2ed991 (patch)
tree284c3872c42875def8bc6adf0facfc775ebff1e4 /Makefile
parentm + doc (diff)
downloadblueshift-1123e48fc4cd9a7894e48117981415b76c2ed991.tar.gz
blueshift-1123e48fc4cd9a7894e48117981415b76c2ed991.tar.bz2
blueshift-1123e48fc4cd9a7894e48117981415b76c2ed991.tar.xz
prototype list_monitors
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 14 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index d1910b2..48ac92d 100644
--- a/Makefile
+++ b/Makefile
@@ -7,9 +7,11 @@
PREFIX ?= /usr
BIN ?= /bin
LIB ?= /lib
+LIBEXEC ?= /libexec
DATA ?= /share
BINDIR ?= $(PREFIX)$(BIN)
LIBDIR ?= $(PREFIX)$(LIB)
+LIBEXECDIR ?= $(PREFIX)$(LIBEXEC)
DATADIR ?= $(PREFIX)$(DATA)
DOCDIR ?= $(DATADIR)/doc
LICENSEDIR ?= $(DATADIR)/licenses
@@ -30,6 +32,7 @@ LIBS_vidmode = x11 xxf86vm
LIBS = python3 $(foreach B,$(SERVER_BINDINGS),$(LIBS_$(B)))
STD = c99
FLAGS = $$($(PKGCONFIG) --cflags --libs $(LIBS)) -std=$(STD) $(WARN) $(OPTIMISE) -fPIC
+# TODO only link to used libs for each binary
DATAFILES = 2deg 10deg redshift redshift_old
PYFILES = __main__.py colour.py curve.py monitor.py solar.py icc.py
@@ -59,7 +62,8 @@ dvi: blueshift.dvi
ps: blueshift.ps
.PHONY: command
-command: $(foreach C,$(CBINDINGS),bin/$(C)) bin/blueshift
+command: $(foreach C,$(CBINDINGS),bin/$(C)) bin/blueshift_idcrtc bin/blueshift
+# TODO make bin/blueshift_idcrtc optional
.PHONY: shell
shell: bash zsh fish
@@ -87,8 +91,13 @@ obj/%.py: src/%.py
cp $< $@
sed -i '/^DATADIR *= /s#^.*$$#DATADIR = '\''$(DATADIR)/$(PKGNAME)'\''#' $@
sed -i '/^LIBDIR *= /s#^.*$$#LIBDIR = '\''$(LIBDIR)'\''#' $@
+ sed -i '/^LIBEXECDIR *= /s#^.*$$#LIBEXECDIR = '\''$(LIBEXECDIR)'\''#' $@
+bin/blueshift_idcrtc: obj/blueshift_idcrtc.o
+ @mkdir -p bin
+ $(CC) $(FLAGS) -o $@ $^
+
bin/%.so: obj/%.o obj/%_c.o
@mkdir -p bin
$(CC) $(FLAGS) -shared -o $@ $^
@@ -155,6 +164,8 @@ install-command: $(foreach C,$(CBINDINGS),bin/$(C)) bin/blueshift $(foreach D,$(
install -m755 bin/blueshift -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
install -dm755 -- "$(DESTDIR)$(LIBDIR)"
install -m755 $(foreach C,$(CBINDINGS),bin/$(C)) -- "$(DESTDIR)$(LIBDIR)"
+ install -dm755 -- "$(DESTDIR)$(LIBEXECDIR)"
+ install -m755 bin/blueshift_idcrtc -- "$(DESTDIR)$(LIBEXECDIR)/blueshift_idcrtc"
install -dm755 -- "$(DESTDIR)$(DATADIR)/$(PKGNAME)"
install -m644 -- $(foreach D,$(DATAFILES),res/$(D)) "$(DESTDIR)$(DATADIR)/$(PKGNAME)"
@@ -214,6 +225,8 @@ install-fish: bin/blueshift.fish
uninstall:
-rm -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
-rm -- $(foreach C,$(CBINDINGS),"$(DESTDIR)$(LIBDIR)/$(C)")
+ -rm -- "$(DESTDIR)$(LIBEXECDIR)/blueshift_idcrtc"
+ -rmdir -- "$(DESTDIR)$(LIBEXECDIR)"
-rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING"
-rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
-rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"