added a few libraries to get proper dependencies. is it a good idea?
[simple-launcher] / Makefile
index 1a4cb5a..5131963 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,33 +7,42 @@ GCONFLIBS := $(shell pkg-config gconf-2.0 --libs)
 DBUSCFLAGS := $(shell pkg-config dbus-1 --cflags)
 DBUSLIBS := $(shell pkg-config dbus-1 --libs)
 
-CXXFLAGS=-Wall -g -MMD $(GTKCFLAGS) $(DBUSCFLAGS) $(GCONFCFLAGS)
+HILDONCFLAGS := $(shell pkg-config hildon-1 --cflags)
+HILDONLIBS := $(shell pkg-config hildon-1 --libs)
+
+HDESKTOPCFLAGS := $(shell pkg-config libhildondesktop --cflags)
+HDESKTOPLIBS := $(shell pkg-config libhildondesktop --libs)
+
+CXXFLAGS=-Wall -g -MMD $(HILDONCFLAGS) $(HDESKTOPCFLAGS) $(GTKCFLAGS) $(DBUSCFLAGS) $(GCONFCFLAGS)
 #LDFLAGS = -module -avoid-version
 LDFLAGS = -shared
-LIBS = -lstdc++
+LIBS = $(HILDONLIBS) $(HDESKTOPLIBS) -lstdc++
 
 TARGET=simple-launcher.so
 DESKTOP_FILE=simple-launcher.desktop
 BACKUP_CONF=simple-launcher.backup
 
-all: $(TARGET)
-
-tests: test test1 test2
+SOURCES := \
+       dialog-entry.cc \
+       gconf-wrapper.cc \
+       launchable-item.cc \
+       launcher-item.cc \
+       settings-dialog.cc \
+       settings-page-entries.cc \
+       settings-page-items.cc \
+       simple-launcher.cc \
+       utils.cc \
+       applet-wrapper.cc
 
-$(TARGET): simple-launcher.o launchable-item.o launcher-item.o settings-page-items.o utils.o settings-dialog.o gconf-wrapper.o dialog-entry.o settings-page-entries.o
-       $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
-
-test: test.o launcher-item.o
-       g++ -o $@ $^ $(GTKLIBS) $(DBUSLIBS) $(LIBS) -losso
+OBJS := $(SOURCES:%.cc=%.o)
 
-test1: test1.o settings-page-items.o launcher-item.o
-       g++ -g -o $@ $^ $(GTKLIBS) $(DBUSLIBS) $(LIBS)
+all: $(TARGET)
 
-test2: test2.o gconf-wrapper.o
-       g++ -g -o $@ $^ $(GCONFLIBS)
+$(TARGET): $(OBJS)
+       $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 clean:
-       rm -f *.d *.o $(TARGET) test test1 test2
+       rm -f *.d *.o $(TARGET)
 
 install: $(TARGET)
        install -d $(DESTDIR)/usr/share/applications/hildon-home