chiark / gitweb /
Unset environment when testing Disobedience --help/--version, to
[disorder] / disobedience / Makefile.am
index cfa1f38f7c986823b214c4ea8d34708bbb932b34..335e5711d5dfe7fbbcbe4b0d8ef05de9dec6cef9 100644 (file)
@@ -1,6 +1,6 @@
 #
 # This file is part of DisOrder.
-# Copyright (C) 2006 Richard Kettlewell
+# Copyright (C) 2006-2008 Richard Kettlewell
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 #
 
 bin_PROGRAMS=disobedience
+doc_DATA=disobedience.html
 
 AM_CPPFLAGS=-I${top_srcdir}/lib -I../lib
 AM_CFLAGS=$(GLIB_CFLAGS) $(GTK_CFLAGS)
+PNGS:=$(shell export LC_COLLATE=C;echo ${top_srcdir}/images/*.png)
 
 disobedience_SOURCES=disobedience.h disobedience.c client.c queue.c    \
-                 choose.c misc.c style.h control.c properties.c menu.c
-disobedience_LDADD=../lib/libdisorder.a $(LIBPCRE) $(LIBGC) $(LIBGCRYPT)
+                 choose.c misc.c control.c properties.c menu.c \
+                 log.c progress.c login.c rtp.c help.c \
+                 ../lib/memgc.c settings.c
+disobedience_LDADD=../lib/libdisorder.a $(LIBPCRE) $(LIBGC) $(LIBGCRYPT) \
+       $(LIBASOUND) $(COREAUDIO)
 disobedience_LDFLAGS=$(GTK_LIBS)
 
 install-exec-hook:
@@ -33,14 +38,31 @@ install-exec-hook:
 
 check: check-help
 
-disobedience.o: style.h
+disobedience.html: ../doc/disobedience.1 $(top_srcdir)/scripts/htmlman
+       rm -f $@.new
+       $(top_srcdir)/scripts/htmlman $< >$@.new
+       chmod 444 $@.new
+       mv -f $@.new $@
 
-style.h: ${srcdir}/disobedience.rc ${top_srcdir}/scripts/text2c
-       ${top_srcdir}/scripts/text2c style ${srcdir}/disobedience.rc > style.h.tmp
-       mv style.h.tmp style.h
+misc.o: images.h
 
-EXTRA_DIST=disobedience.rc
+images.h: $(PNGS)
+       exec > @$.new;                                                  \
+       for png in $(PNGS); do                                          \
+         name=`echo $$png | $(GNUSED) 's,.*/,,;s,\.png,,;'`;                   \
+         gdk-pixbuf-csource --raw --name=image_$$name $$png;           \
+       done;                                                           \
+       echo "static const struct image images[] = {";                  \
+       for png in $(PNGS); do                                          \
+         name=`echo $$png | $(GNUSED) 's,.*/,,;s,\.png,,;'`;                   \
+         echo "  { \"$$name.png\", image_$$name },";                   \
+       done;                                                           \
+       echo "};"
+       mv @$.new $@
 
 # check everything has working --help
 check-help: all
-       ./disobedience --version > /dev/null
+       unset DISPLAY;./disobedience --version > /dev/null
+       unset DISPLAY;./disobedience --help > /dev/null
+
+export GNUSED