Update build system
authorSteven Luo <steven+maemo@steven676.net>
Mon, 22 Feb 2010 05:37:12 +0000 (21:37 -0800)
committerSteven Luo <steven+maemo@steven676.net>
Mon, 22 Feb 2010 05:37:12 +0000 (21:37 -0800)
As currently set up, it takes far too much external knowledge to
generate builds for Fremantle (a set of EXTRA_CPPFLAGS as well as
EXTRA_LDFLAGS); this is because the Makefiles were originally written
when there was only one target system (Diablo).

To fix this, provide new "diablo" and "fremantle" targets that can be
used to build the appropriate browser-switchboard without further
configuration, and make the "all" target print out a help message.  For
the config UI, provide new "fremantle-hildon-app" and "fremantle-plugin"
targets, and rename the existing targets to "diablo-hildon-app" and
"diablo-plugin" to match.

Makefile
config-ui/Makefile

index 8442de4..d608e3c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,16 @@ PREFIX = /usr
 APP = browser-switchboard
 obj = main.o launcher.o dbus-server-bindings.o configfile.o log.o
 
-all: $(APP)
+all:
+       @echo 'Usage:'
+       @echo '    make diablo -- build for Diablo'
+       @echo '    make fremantle -- build for Fremantle'
+diablo: $(APP)
+fremantle:
+       @$(MAKE) \
+           EXTRA_CPPFLAGS='-DFREMANTLE `pkg-config --cflags dbus-1` $(EXTRA_CPPFLAGS)' \
+           EXTRA_LDFLAGS='`pkg-config --libs dbus-1` $(EXTRA_LDFLAGS)' $(APP)
+
 
 $(APP): dbus-server-glue.h $(obj)
        $(CC) $(CFLAGS) $(LDFLAGS) -o $(APP) $(obj)
@@ -32,4 +41,4 @@ install: all
 clean:
        rm -f $(APP) *.o dbus-server-glue.h
 
-.PHONY: strip install
+.PHONY: strip install diablo fremantle
index 42f2003..c0c13b4 100644 (file)
@@ -20,10 +20,20 @@ happ_obj = $(APP).happ.o $(other_obj)
 PLUGIN = lib$(APP).so
 plugin_obj = $(APP).plugin.o ../configfile.plugin.o
 
-all: plugin
-plugin: $(PLUGIN)
+all:
+       @echo 'Usage:'
+       @echo '    make app -- build standalone GTK+ application'
+       @echo '    make diablo-hildon-app -- build standalone Diablo Hildon application'
+       @echo '    make diablo-plugin -- build Diablo hildon-control-panel plugin'
+       @echo '    make fremantle-hildon-app -- build standalone Fremantle Hildon application'
+       @echo '    make fremantle-plugin -- build Fremantle hildon-control-panel plugin'
 app: $(APP)
-hildon-app: $(HILDON_APP)
+diablo-hildon-app: $(HILDON_APP)
+diablo-plugin: $(PLUGIN)
+fremantle-hildon-app:
+       @$(MAKE) EXTRA_CPPFLAGS='-DFREMANTLE $(EXTRA_CPPFLAGS)' $(HILDON_APP)
+fremantle-plugin:
+       @$(MAKE) EXTRA_CPPFLAGS='-DFREMANTLE $(EXTRA_CPPFLAGS)' $(PLUGIN)
 
 $(APP): $(app_obj)
        $(CC) $(CFLAGS) $(LDFLAGS) -o $(APP) $(app_obj)
@@ -60,4 +70,4 @@ install-plugin: plugin
 clean:
        rm -f $(APP) $(HILDON_APP) $(PLUGIN) *.o ../configfile.o
 
-.PHONY: strip strip-plugin install install-plugin plugin app hildon-app
+.PHONY: strip strip-plugin install install-plugin app diablo-hildon-app diablo-plugin fremantle-hildon-app fremantle-plugin