aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDavid <dbphillipsnz@gmail.com>2014-05-10 22:35:00 +1200
committerDavid <dbphillipsnz@gmail.com>2014-06-06 20:30:36 +1200
commita04001bb863cc853c1f064c2eb91391fbc24dc1b (patch)
treec53ca9d2949e6277a32f27adbdbc827ea5d98096 /Makefile
parente076ef53d0af32c88deda0a63a6b58f9d5e04c0d (diff)
downloadparamano-a04001bb863cc853c1f064c2eb91391fbc24dc1b.tar.xz
Makefile options for portability
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 23 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 157ad5d..12bdf96 100644
--- a/Makefile
+++ b/Makefile
@@ -3,11 +3,22 @@
MAKE = make
CC = gcc
INSTALL_PATH=/
+PREFIX=/usr
+BINDIR=$(PREFIX)/bin
+SUDO=/usr/bin/sudo
+TRAYFREQ_SET=$(BINDIR)/trayfreq-set
+LOCALE_DIR=$(PREFIX)/share/locale/
ifdef DEBUG
EXTRA_CFLAGS+=-DDEBUG
endif
+EXTRA_CFLAGS+= -DPREFIX=\"$(PREFIX)\" \
+ -DBINDIR=\"$(BINDIR)\" \
+ -DSUDO=\"$(SUDO)\" \
+ -DTRAYFREQ_SET=\"$(TRAYFREQ_SET)\" \
+ -DLOCALE_DIR=\"$(LOCALE_DIR)\"
+
DEPS = bat_tray.h \
bool.h \
@@ -119,18 +130,19 @@ clean:
########################################################################
# Install entire suite
install:
- mkdir -p $(INSTALL_PATH)/usr/share/trayfreq/
- mkdir -p $(INSTALL_PATH)/usr/share/locale/fr/LC_MESSAGES/
- mkdir -p $(INSTALL_PATH)/etc/
+ mkdir -p $(PREFIX)/share/trayfreq/
+ mkdir -p $(LOCALE_DIR)/fr/LC_MESSAGES/
+ mkdir -p $(PREFIX)/etc/
+
+ cp data/*.png $(PREFIX)/share/trayfreq/
+ cp lc/fr.mo $(LOCALE_DIR)/fr/LC_MESSAGES/trayfreq.mo
- cp data/*.png $(INSTALL_PATH)/usr/share/trayfreq/
- cp lc/fr.mo $(INSTALL_PATH)/usr/share/locale/fr/LC_MESSAGES/trayfreq.mo
+ install -Dm 644 data/trayfreq.conf $(PREFIX)/etc/trayfreq.conf
+ install -Dm 644 data/trayfreq.desktop $(PREFIX)/etc/xdg/autostart/trayfreq.desktop
- install -Dm 644 data/trayfreq.conf $(INSTALL_PATH)/etc/trayfreq.conf
- install -Dm 644 data/trayfreq.desktop $(INSTALL_PATH)/etc/xdg/autostart/trayfreq.desktop
- install -Dm 755 trayfreq $(INSTALL_PATH)/usr/bin/trayfreq
- install -Dm 755 trayfreq-set $(INSTALL_PATH)/usr/bin/trayfreq-set
+ install -Dm 755 trayfreq $(BINDIR)/trayfreq
+ install -Dm 755 trayfreq-set $(BINDIR)/trayfreq-set
- ln -s /usr/share/licenses/common/GLPv3/license.txt $(INSTALL_PATH)/usr/share/trayfreq/LICENCE
- ln -s ../../../etc/trayfreq.conf $(INSTALL_PATH)/usr/share/trayfreq/trayfreq.conf
+ ln -s ../licenses/common/GLPv3/license.txt $(PREFIX)/share/trayfreq/LICENCE
+ ln -s ../../../etc/trayfreq.conf $(PREFIX)/share/trayfreq/trayfreq.conf
########################################################################