Makefile.in: Kill unused TGZ_PREFIX
[paraslash.git] / Makefile.in
index aef0c0c95b2b6d4984c586906e84196612a3a292..760a61783819484d3cfe103600cc05396ffa6761 100644 (file)
@@ -1,4 +1,4 @@
-COPYRIGHT = Copyright (c) 1997-2006 by Andre Noll
+COPYRIGHT = Copyright (c) 1997-2007 by Andre Noll
 DISCLAIMER = This is free software with ABSOLUTELY NO WARRANTY. See COPYING for details.
 
 prefix = @prefix@
@@ -19,14 +19,10 @@ cc_version = $(shell $(CC) --version | head -n 1)
 codename = inductive resonance
 
 DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W
-
 DEBUG_CPPFLAGS += -Wredundant-decls
-
 # produces false positives
 # DEBUG_CPPFLAGS += -Wunreachable-code
-
 #CPPFLAGS += -Wwrite-strings
-
 # invalid option for gcc-3.3.5
 # CPPFLAGS += -Wextra
 
@@ -48,8 +44,11 @@ CPPFLAGS += -Wmissing-format-attribute
 CPPFLAGS += -Wunused-macros
 CPPFLAGS += -Wshadow
 
-BINARIES = para_server para_client para_gui para_audioc para_recv para_filter para_write @extra_binaries@
-
+BINARIES = para_server para_client para_gui para_audioc para_recv \
+       para_filter para_write @extra_binaries@
+man_binaries := $(filter-out para_dbadm para_slider para_krell.so, $(BINARIES))
+man_pages := $(patsubst %, man/man1/%.1, $(man_binaries))
+man_pages_html := $(patsubst %, man/html/%.html, $(man_binaries))
 FONTS := $(wildcard fonts/*.png)
 PICS := $(wildcard pics/paraslash/*.jpg)
 MANS := $(wildcard doc/man/man1/*.1)
@@ -58,8 +57,7 @@ gengetopts_c := $(gengetopts:.ggo=.cmdline.c)
 gengetopts_h := $(gengetopts:.ggo=.cmdline.h)
 all_c_files := $(wildcard *.c)
 c_sources := $(filter-out $(gengetopts_c), $(all_c_files))
-grutatxt := COPYING NEWS README.mysql CREDITS INSTALL README \
-       FEATURES GPL
+grutatxt := COPYING NEWS README.mysql CREDITS INSTALL README FEATURES GPL
 grutatxt_html := $(grutatxt:=.html)
 html_in := $(wildcard web/*.in.html)
 gen_html := $(subst web/,web/sync/,$(html_in))
@@ -75,21 +73,18 @@ shots := $(patsubst %,web/sync/%,$(shots))
 web_pics := web/sync/paraslash.png web/sync/paraslash.ico
 web_misc := overview.pdf versions/paraslash-git.tar.bz2 PUBLIC_KEY key.anonymous para.css doc
 web_misc := $(patsubst %,web/sync/%,$(web_misc))
-
 autocrap := config.h.in configure
-
 tarball_pfx := @PACKAGE_TARNAME@-@PACKAGE_VERSION@
-
 tarball_delete = web versions pics/screenshots pics/web .changelog_before_cvs \
        .changelog_cvs
 tarball_delete := $(patsubst %,$(tarball_pfx)/%,$(tarball_delete))
 tarball_add := $(gengetopts_c) $(gengetopts_h) $(autocrap)
 
-.PHONY: clean distclean maintainer-clean install html www tags ChangeLog doxygen gruta
+.PHONY: clean distclean maintainer-clean install html www tags doxygen gruta man
 all: $(BINARIES)
 www: $(gen_html) $(gruta_html) $(web_pics) $(web_misc) $(shots) tags doxygen doc
 gruta: $(gen_html) $(gruta_html)
-
+man: $(man_pages) $(man_pages_html)
 
 sdl_gui_objs = sdl_gui.cmdline.o SFont.o sdl_gui.o gui_common.o exec.o \
        close_on_fork.o string.o stat.o fd.o
@@ -102,7 +97,7 @@ slider_objs = slider.o string.o
 
 include Makefile.deps
 
-V := ($(TGZ_PREFIX)@PACKAGE_STRING@, $(codename))\n$(COPYRIGHT)\n$(DISCLAIMER)
+V := (@PACKAGE_STRING@, $(codename))\n$(COPYRIGHT)\n$(DISCLAIMER)
 module_ggo_opts := --set-version="(@PACKAGE_STRING@, $(codename))"
 
 grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo
@@ -148,30 +143,29 @@ grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo
                --set-package="para_$(subst .cmdline,,$(*F))" \
                --set-version="$V"  < $<
 
-server_command_list.c: server.cmd server_command_list.h
-       ./command_util.sh c_file < $< >>$@
-server_command_list.h: server.cmd
-       ./command_util.sh header < $< >> $@
+%_command_list.c %_command_list.h: %.cmd
+       ./command_util.sh c < $< >$@
+       ./command_util.sh h < $< >$(@:%.c=%.h)
+
+%_command_list.man: %.cmd
+       ./command_util.sh man < $< > $@
+
+server_command_lists = server_command_list.man random_selector_command_list.man \
+       playlist_selector_command_list.man mysql_selector_command_list.man
+man/man1/para_server.1: para_server $(server_command_lists)
+       opts="-N `for i in $(server_command_lists); do echo "-i $$i"; done`"; \
+       help2man $$opts ./para_server > $@
 
-mysql_selector_command_list.c: mysql_selector.cmd mysql_selector_command_list.h
-       ./command_util.sh c_file < $< >>$@
-mysql_selector_command_list.h: mysql_selector.cmd
-       ./command_util.sh header < $< >> $@
+man/man1/para_audiod.1: para_audiod audiod_command_list.man
+       help2man -N -i audiod_command_list.man ./para_audiod > $@
 
-random_selector_command_list.c: random_selector.cmd random_selector_command_list.h
-       ./command_util.sh c_file < $< >>$@
-random_selector_command_list.h: random_selector.cmd
-       ./command_util.sh header < $< >> $@
+man/man1/%.1: %
+       help2man -N $< > $@
+
+man/html/%.html: man/man1/%.1
+       man2html $< > $@
 
-playlist_selector_command_list.c: playlist_selector.cmd playlist_selector_command_list.h
-       ./command_util.sh c_file < $< >>$@
-playlist_selector_command_list.h: playlist_selector.cmd
-       ./command_util.sh header < $< >> $@
 
-audiod_command_list.c: audiod.cmd audiod_command_list.h
-       ./command_util.sh c_file < $< >>$@
-audiod_command_list.h: audiod.cmd
-       ./command_util.sh header < $< >> $@
 
 ortp_recv.o: ortp_recv.c
        $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ortp_cppflags@ $<
@@ -250,8 +244,7 @@ para_krell.so: $(krell_objs)
        $(CC) -Wall -fPIC @GTK_CFLAGS@ krell.o -o $@ @GTK_LIBS@ -shared
 
 clean:
-       rm -f *.o $(BINARIES) *_command_list.*
-
+       rm -f *.o $(BINARIES)
 distclean: clean
        rm -f Makefile autoscan.log config.status config.log && \
        rm -rf web/sync/* autom4te.cache aclocal.m4
@@ -259,9 +252,11 @@ distclean: clean
 
 maintainer-clean: distclean
        rm -f $(gengetopts_c) $(gengetopts_h) *.tar.bz2 \
-               $(grutatxt_html) ChangeLog* config.h configure \
+               $(grutatxt_html) config.h configure \
                config.h.in skencil/*.pdf skencil/*.ps
        rm -rf doc
+       rm -f *_command_list.* *.man man/man1/* man/html/*
+
 
 install: all
        umask 022 && \
@@ -287,8 +282,6 @@ install: all
        rm -f $(tarball_pfx).tar
        ls -l $(tarball_pfx).tar.bz2
 
-ChangeLog:
-       para_util changelog > $@
 web/%.in.html: %
        grutatxt -nb  < $< > $@
 tags: