Made a new makefile for scratchbox builds
authorGregor Riepl <onitake@gmail.com>
Tue, 27 Jul 2010 20:32:55 +0000 (22:32 +0200)
committerGregor Riepl <onitake@gmail.com>
Tue, 27 Jul 2010 20:32:55 +0000 (22:32 +0200)
Fixed errors in MADDE makefile
Updated readme with bug report info
Fixed path in event script

Makefile
Makefile.madde [new file with mode: 0644]
README
event.d-mtetherd

index 663a47d..5cc417f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,29 +1,27 @@
-MAD = mad
 CC = gcc
-CFLAGS = -Wall -O0 -g -D_GNU_SOURCE
-INCLUDES = -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include
-LDFLAGS = -g
-LIBS = -ldbus-1 -lpthread
-SSH_ADDRESS = developer@192.168.253.254
-SSH_SCP = scp
-SSH_SSH = ssh
-SSH_PATH = /home/developer
-DATA_FILES = main.c device.c device.h event.d-mtetherd
+CFLAGS = -Wall -O2 -g -D_GNU_SOURCE
+INCLUDES = $(shell pkg-config dbus-1 --cflags)
+LDFLAGS =
+LIBS = $(shell pkg-config dbus-1 --libs)
+PREFIX = /usr
 
 mtetherd: mtetherd.o device.o
-       $(MAD) $(CC) $(LDFLAGS) $(LIBS) -o $@ $^
+       $(CC) $(LDFLAGS) $(LIBS) -o $@ $^
 
-%PHONY: copy run clean
+%PHONY: clean install uninstall
 
-copy: mtetherd $(DATA_FILES)
-       $(SSH_SCP) $^ $(SSH_ADDRESS):$(SSH_PATH)
+clean:
+       rm -f *.o mtetherd
 
-run: copy
-       $(SSH_SSH) $(SSH_ADDRESS) $(SSH_PATH)/maemo-tethering
+install: mtetherd
+       install -m 755 -D mtetherd $(PREFIX)/sbin/mtetherd
+       install -m 644 -D event.d-mtetherd /etc/event.d/mtetherd
+       install -m 644 -D README $(PREFIX)/share/doc/mtetherd/README
 
-clean:
-       rm -f *.o maemo-tethering
+uninstall:
+       rm -f $(PREFIX)/sbin/mtetherd
+       rm -f /etc/event.d/mtetherd
+       rm -rf $(PREFIX)/share/doc/mtetherd
 
 %.o: %.c
-       $(MAD) $(CC) $(CFLAGS) $(INCLUDES) -o $@ -c $^
-
+       $(CC) $(CFLAGS) $(INCLUDES) -o $@ -c $^
diff --git a/Makefile.madde b/Makefile.madde
new file mode 100644 (file)
index 0000000..5c951b9
--- /dev/null
@@ -0,0 +1,29 @@
+MAD = mad
+CC = gcc
+CFLAGS = -Wall -O0 -g -D_GNU_SOURCE
+INCLUDES = -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include
+LDFLAGS = -g
+LIBS = -ldbus-1 -lpthread
+SSH_ADDRESS = developer@192.168.253.254
+SSH_SCP = scp
+SSH_SSH = ssh
+SSH_PATH = /home/developer
+DATA_FILES = main.c device.c device.h event.d-mtetherd
+
+mtetherd: mtetherd.o device.o
+       $(MAD) $(CC) $(LDFLAGS) $(LIBS) -o $@ $^
+
+%PHONY: copy run clean
+
+copy: mtetherd $(DATA_FILES)
+       $(SSH_SCP) $^ $(SSH_ADDRESS):$(SSH_PATH)
+
+run: copy
+       $(SSH_SSH) $(SSH_ADDRESS) $(SSH_PATH)/mtetherd
+
+clean:
+       rm -f *.o mtetherd
+
+%.o: %.c
+       $(MAD) $(CC) $(CFLAGS) $(INCLUDES) -o $@ -c $^
+
diff --git a/README b/README
index ada9d53..18418ae 100644 (file)
--- a/README
+++ b/README
@@ -55,8 +55,9 @@ connection is available.
 
 Bugs:
 
-Likely.
-Please submit a bug report on garage.maemo.org if you find any!
+If you find any, please report them via the Maemo Garage bug tracker at
+https://garage.maemo.org/projects/mtetherd/ or send an email to
+onitake@gmail.com
 
 Legal:
 
index cf4dd9d..c3e118e 100644 (file)
@@ -1,4 +1,4 @@
-description "maemo-tethering"
+description "Maemo Tethering Daemon"
 author "Gregor Riepl <onitake@gmail.com>"
 
 start on started dbus
@@ -6,7 +6,7 @@ stop on stopping dbus
 
 console none
 
-exec /usr/sbin/maemo-tethering
+exec /usr/sbin/mtetherd
 
 respawn