initial import
[libicd-wpa] / Makefile
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..acd2cab
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,36 @@
+LIBTOOL=libtool
+
+CFLAGS += -Wall -O2 -DDEBUG -DOSSOLOG_STDERR -shared
+LDFLAGS += -shared -module
+
+# Library flags
+PKG_CFLAGS := $(shell pkg-config --cflags glib-2.0 gconf-2.0 dbus-1 dbus-glib-1 osso-ic)
+PKG_LDFLAGS := $(shell pkg-config --libs glib-2.0 gconf-2.0 dbus-1 dbus-glib-1)
+CFLAGS   += $(PKG_CFLAGS)
+LDFLAGS  += $(PKG_LDFLAGS)
+
+LTFLAGS = -shared
+
+BINARY = libicd_network_wpa.so
+OBJS = icd.o wlan.o networks.o gconf.o \
+       dbus.o dbus-helper.o dbus-handler.o supp.o
+
+all: $(BINARY)
+
+$(BINARY): $(OBJS)
+       $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $^
+       
+%.o: %.c
+       $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $< -o $@
+
+clean:
+       $(LIBTOOL) --mode=clean $(RM) libicd_network_wpa.so *.o
+       
+install: $(BINARY)
+       $(LIBTOOL) --mode=install install -c --strip --mode=644 \
+               $(BINARY) $(DESTDIR)/usr/lib/icd2/
+       $(LIBTOOL) --mode=finish $(DESTDIR)/usr/lib/icd2/
+       
+
+.PHONY: all clean install
+