aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDavid <dbphillipsnz@gmail.com>2014-05-10 13:31:43 +1200
committerDavid <dbphillipsnz@gmail.com>2014-06-06 20:29:36 +1200
commitc537b4cc6d0bf2cedcb95848328e902c5be50ace (patch)
treeb6bda9925afbef3f4266ba15f3d9e931eee06512 /Makefile
parentbf04ee460a3221f8d4b6caa628a5820375642545 (diff)
downloadparamano-c537b4cc6d0bf2cedcb95848328e902c5be50ace.tar.xz
Better makefile (I got sidetracked)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile62
1 files changed, 50 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 3f7d098..0e49f28 100644
--- a/Makefile
+++ b/Makefile
@@ -6,11 +6,24 @@ INSTALL_PATH=/
ifdef DEBUG
EXTRA_CFLAGS+=-DDEBUG
-else
- EXTRA_CFLAGS=
endif
+DEPS = bat_tray.h \
+ bool.h \
+ common.h \
+ config_file.h \
+ debug.h \
+ defaults.h \
+ getcore.h \
+ getfreq.h \
+ getgov.h \
+ reload.h \
+ trayfreq.h \
+ tray.h \
+ trayfreq_set_interface.h \
+ widget_manager.h
+
GLIB_CFLAGS = -I/usr/include/glib-2.0 \
-I/usr/lib/glib-2.0/include
@@ -56,19 +69,41 @@ all: trayfreq trayfreq-set lang
########################################################################
-# Make trayfreq-set program for setting governors
-trayfreq-set:
- $(CC) -o trayfreq-set $(trayfreq_set_SOURCES) $(trayfreq_set_CFLAGS) $(trayfreq_set_LDFLAGS) $(EXTRA_CFLAGS)
+# Make main trayfreq system tray program
+trayfreq: bat_tray.o \
+ common.o \
+ config_file.o \
+ defaults.o \
+ getcore.o \
+ getfreq.o \
+ getgov.o \
+ reload.o \
+ trayfreq.o \
+ tray.o \
+ trayfreq_set_interface.o \
+ widget_manager.o
+ $(CC) -o $@ $? $(trayfreq_LDFLAGS)
+
+########################################################################
+# Make trayfreq-set utility
+trayfreq-set: \
+ trayfreq_set.o \
+ getcore.o \
+ getfreq.o \
+ getgov.o
+
+ $(CC) -o $@ $? $(trayfreq_set_LDFLAGS)
########################################################################
+
########################################################################
-# Make main trayfreq system tray program
-trayfreq:
- $(CC) -o trayfreq $(trayfreq_SOURCES) $(trayfreq_CFLAGS) $(trayfreq_LDFLAGS) $(EXTRA_CFLAGS)
+%.o: %.c $(DEPS)
+ $(CC) -c -o $@ $< $(trayfreq_CFLAGS) $(EXTRA_CFLAGS)
########################################################################
+
########################################################################
# Make language files
lang:
@@ -79,7 +114,7 @@ lang:
########################################################################
# Remove generated files
clean:
- rm -f trayfreq trayfreq-set lc/*.mo
+ rm -f trayfreq trayfreq-set *.o lang/*.mo
########################################################################
@@ -87,14 +122,17 @@ clean:
# Install entire suite
install:
mkdir -p $(INSTALL_PATH)/usr/share/trayfreq/
- cp data/*.png $(INSTALL_PATH)/usr/share/trayfreq/
-
mkdir -p $(INSTALL_PATH)/usr/share/locale/fr/LC_MESSAGES/
+ mkdir -p $(INSTALL_PATH)/etc/
+
+ 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 $(INSTALL_PATH)/usr/share/trayfreq/trayfreq.conf
+ 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
+
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
########################################################################