NEWS update
[paraslash.git] / Makefile.in
index 06cc15bb2c5d539ab0482bac59beec80e60247ba..d44716e517961848022fc872d89ab02cf8254555 100644 (file)
@@ -1,38 +1,32 @@
-COPYRIGHT = Copyright (c) 1997-2006 by Andre Noll
-DISCLAIMER = This is free software with ABSOLUTELY NO WARRANTY. See COPYING for details.
-
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 
 BINDIR = @bindir@
 VARDIR = /var/paraslash
-PKGDATADIR = @datadir@/@PACKAGE_NAME@
+PKGDATADIR = @datarootdir@/@PACKAGE_NAME@
 FONTDIR = $(PKGDATADIR)/fonts
 PICDIR = $(PKGDATADIR)/pics
-MANDIR = @prefix@/share/man/man1
+MANDIR = @datarootdir@/man/man1
 
 install_sh = @install_sh@
-SSL_LIBS = @SSL_LIBS@
-SSL_LDFLAGS = @SSL_LDFLAGS@
 
-extra_binaries = @extra_binaries@
 build_date = $(shell date)
 system = $(shell uname -rs)
 cc_version = $(shell $(CC) --version | head -n 1)
-version = @PACKAGE_VERSION@
-codename = oriented abstraction
+codename = isotropic threshold
 
 DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W
-
 DEBUG_CPPFLAGS += -Wredundant-decls
-
 # produces false positives
 # DEBUG_CPPFLAGS += -Wunreachable-code
+# DEBUG_CPPFLAGS += -Wwrite-strings
 
-#CPPFLAGS += -Wwrite-strings
+# invalid option for gcc-3.3.3
+# DEBUG_CPPFLAGS += -Wextra
+# DEBUG_CPPFLAGS += -Wold-style-definition
 
-# invalid option for gcc-3.3.5
-# CPPFLAGS += -Wextra
+# many warnings about trivial stuff
+# CPPFLAGS += -Wconversion
 
 CPPFLAGS += -Os
 CPPFLAGS += -Wall
@@ -45,25 +39,25 @@ CPPFLAGS += -DFONTDIR='"$(PKGDATADIR)/fonts"'
 CPPFLAGS += -DPICDIR='"$(PKGDATADIR)/pics"'
 CPPFLAGS += -DBUILD_DATE='"$(build_date)"'
 CPPFLAGS += -DSYSTEM='"$(system)"'
-CPPFLAGS += -DVERSION='"$(version)"'
 CPPFLAGS += -DCODENAME='"$(codename)"'
 CPPFLAGS += -DCC_VERSION='"$(cc_version)"'
 CPPFLAGS += -Werror-implicit-function-declaration
 CPPFLAGS += -Wmissing-format-attribute
 CPPFLAGS += -Wunused-macros
-
-BINARIES = para_server para_client para_gui para_audiod para_audioc para_recv para_filter para_write $(extra_binaries)
-
+CPPFLAGS += -Wshadow
+CPPFLAGS += -Wbad-function-cast
+
+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)
 gengetopts := $(wildcard *.ggo)
 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))
@@ -72,45 +66,47 @@ gruta_in := $(grutatxt:=.in.html)
 gruta_in := $(patsubst %,web/%,$(gruta_in))
 gruta_html := $(grutatxt:=.html)
 gruta_html := $(patsubst %,web/sync/%,$(gruta_html))
-shots := gui-2005-11-12.png para_audiod-startup.txt
-shots += para_krell-2005-02.png para_server-startup.txt
-shots += para_slider-2004-12.png sdl_gui.jpg para_krell-2005-02.png
+shots := gui-2005-11-12.png para_audiod-startup.txt para_krell-2005-02.png \
+       para_server-startup.txt para_slider-2004-12.png sdl_gui.jpg \
+       para_krell-2005-02.png
 shots := $(patsubst %,web/sync/%,$(shots))
 web_pics := web/sync/paraslash.png web/sync/paraslash.ico
-web_misc := demo-script overview.pdf versions/paraslash-git.tar.bz2 PUBLIC_KEY key.anonymous para.css doc
+web_misc := overview.pdf versions/@PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2 PUBLIC_KEY \
+       key.anonymous para.css
 web_misc := $(patsubst %,web/sync/%,$(web_misc))
-
+web_man := web/sync/man
 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
+.PHONY: clean distclean maintainer-clean install html www tags doxygen gruta \
+       man html_man
 all: $(BINARIES)
-www: $(gen_html) $(gruta_html) $(web_pics) $(web_misc) $(shots) tags doxygen doc
+www: $(gen_html) $(gruta_html) $(web_pics) $(web_misc) $(shots) $(web_man) \
+       tags doxygen
+gruta: $(gen_html) $(gruta_html)
+man: $(man_pages)
+html_man: $(man_pages_html)
 
-client_objs = client.cmdline.o client.o net.o string.o crypt.o
 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
 dbadm_objs = dbadm.o exec.o close_on_fork.o string.o
 fade_objs = fade.cmdline.o fade.o exec.o close_on_fork.o string.o fd.o
 krell_objs = krell.o string.o
 slider_objs = slider.o string.o
-audioc_objs = audioc.cmdline.o audioc.o string.o net.o fd.o
 
 *.o: para.h config.h gcc-compat.h
 
 include Makefile.deps
 
-V := ($(TGZ_PREFIX)@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
        gengetopt $(module_ggo_opts) \
+               -S \
                --set-package=grab \
                --no-handle-help \
                --no-handle-error \
@@ -132,15 +128,76 @@ grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo
                --arg-struct-name=$(subst .ggo,,$<)_args_info \
                --file-name=$(subst .ggo,,$<).cmdline \
                --func-name $(subst _filter.ggo,,$<)_cmdline_parser < $<
+%_write.cmdline.h %_write.cmdline.c: %_write.ggo
+       gengetopt -S $(module_ggo_opts) \
+               --set-package=$(subst .ggo,,$<) \
+               --arg-struct-name=$(subst .ggo,,$<)_args_info \
+               --file-name=$(subst .ggo,,$<).cmdline \
+               --func-name $(subst _write.ggo,,$<)_cmdline_parser < $<
 
 %.cmdline.h %.cmdline.c: %.ggo
        case $< in client.ggo) O="--unamed-opts=command";; \
                audioc.ggo) O="--unamed-opts=command";; \
        esac; \
-       gengetopt $$O --conf-parser --file-name=$(*F).cmdline --set-package="para_$(subst .cmdline,,$(*F))" --set-version="$V"  < $<
+       gengetopt $$O \
+               --no-handle-version \
+               --conf-parser \
+               --file-name=$(*F).cmdline \
+               --func-name $(*F)_cmdline_parser \
+               --arg-struct-name=$(*F)_args_info \
+               --set-package="para_$(subst .cmdline,,$(*F))" \
+               --set-version="@PACKAGE_VERSION@"  < $<
 
-para_recv: @recv_objs@
-       $(CC) @recv_objs@ -o $@ @recv_ldflags@
+%_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)
+       mkdir -p man/man1
+       opts="-N `for i in $(server_command_lists); do echo "-i $$i"; done`"; \
+       help2man $$opts ./para_server > $@
+
+man/man1/para_audiod.1: para_audiod audiod_command_list.man
+       mkdir -p man/man1
+       help2man -N -i audiod_command_list.man ./para_audiod > $@
+
+man/man1/%.1: %
+       mkdir -p man/man1
+       help2man -N ./$< > $@
+
+man/html/%.html: man/man1/%.1
+       mkdir -p man/html
+       man2html $< > $@
+
+
+
+ortp_recv.o: ortp_recv.c
+       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ortp_cppflags@ $<
+
+ortp_send.o: ortp_send.c
+       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ortp_cppflags@ $<
+
+oggdec.o: oggdec.c
+       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
+ogg_afh.o: ogg_afh.c
+       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
+
+mp3dec.o: mp3dec.c
+       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @mad_cppflags@ $<
+
+aacdec.o: aacdec.c
+       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
+
+aac_common.o: aac_common.c
+       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
+
+aac_afh.o: aac_afh.c
+       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
 
 slider.o: slider.c
        $(CC) -c -Wall -o $@ -g @GLIB_CFLAGS@  @GTK_CFLAGS@ $<
@@ -148,19 +205,25 @@ slider.o: slider.c
 krell.o: krell.c
        $(CC) -Wall -O -g -fPIC @GTK_CFLAGS@ -c -o $@ krell.c
 
+mysql_selector.o: mysql_selector.c
+       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @mysql_cppflags@ $<
+
 %.cmdline.o: %.cmdline.c
        $(CC) -c $(CPPFLAGS) $<
 %.o: %.c
        $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
 
+para_recv: @recv_objs@
+       $(CC) @recv_objs@ -o $@ @recv_ldflags@
+
 para_filter: @filter_objs@
        $(CC) @filter_objs@ -o $@ @filter_ldflags@
 
 para_slider: $(slider_objs)
        $(CC) $(slider_objs) -o $@ @GTK_LIBS@ @GLIB_LIBS@ -lzmw
 
-para_client: $(client_objs)
-       $(CC) -o $@ $(client_objs) $(SSL_LDFLAGS) $(SSL_LIBS)
+para_client: @client_objs@
+       $(CC) -o $@ @client_objs@ @client_ldflags@
 
 para_gui: @gui_objs@
        $(CC) -o $@ @gui_objs@ -lncurses
@@ -168,8 +231,8 @@ para_gui: @gui_objs@
 para_audiod: @audiod_objs@
        $(CC) -o $@ @audiod_objs@ @audiod_ldflags@
 
-para_audioc: $(audioc_objs)
-       $(CC) -o $@ $(audioc_objs)
+para_audioc: @audioc_objs@
+       $(CC) -o $@ @audioc_objs@
 
 para_dbadm: $(dbadm_objs)
        $(CC) -o $@ $(dbadm_objs) -lncurses -lmenu
@@ -191,7 +254,6 @@ para_krell.so: $(krell_objs)
 
 clean:
        rm -f *.o $(BINARIES)
-
 distclean: clean
        rm -f Makefile autoscan.log config.status config.log && \
        rm -rf web/sync/* autom4te.cache aclocal.m4
@@ -199,62 +261,55 @@ 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
-
-install: all
-       umask 022 && \
-       mkdir -p $(BINDIR) $(VARDIR) && \
-       $(install_sh) -s -m 755 $(BINARIES) $(BINDIR) && \
-       mkdir -p $(FONTDIR) && \
-       $(install_sh) -m 644 $(FONTS) $(FONTDIR) && \
-       mkdir -p $(PICDIR) && \
-       $(install_sh) -m 644 $(PICS) $(PICDIR) && \
-       mkdir -p $(MANDIR) && \
-       $(install_sh) -m 644 $(MANS) $(MANDIR)
-
-@PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2: $(tarball_add) doc
-       rm -f $(tarball_pfx).tar.bz2
-       git-tar-tree HEAD $(tarball_pfx) | tar --delete $(tarball_delete) > $(tarball_pfx).tar
+       rm -f *_command_list.* *.man man/man1/* man/html/*
+
+
+install: all man
+       mkdir -p $(BINDIR) $(FONTDIR) $(PICDIR) $(MANDIR)
+       $(install_sh) -s -m 755 $(BINARIES) $(BINDIR)
+       $(install_sh) -m 644 $(FONTS) $(FONTDIR)
+       $(install_sh) -m 644 $(PICS) $(PICDIR)
+       $(install_sh) -m 644 $(man_pages) $(MANDIR)
+       mkdir -p $(VARDIR) >/dev/null 2>&1 || true # not fatal, so don't complain
+
+@PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2: $(tarball_add) $(man_pages)
+       rm -rf $(tarball_pfx).tar.bz2 $(tarball_pfx)
+       git-archive --format=tar --prefix=$(tarball_pfx)/ HEAD \
+               | tar --delete $(tarball_delete) > $(tarball_pfx).tar
        mkdir $(tarball_pfx)
        cp -r $(tarball_add) $(tarball_pfx)
-       tar c doc/man | (cd $(tarball_pfx); tar x)
+       mkdir -p $(tarball_pfx)/man/man1
+       cp -r $(man_pages) $(tarball_pfx)/man/man1
        tar rf $(tarball_pfx).tar $(tarball_pfx)/*
        rm -rf $(tarball_pfx)
        bzip2 -9 $(tarball_pfx).tar
        rm -f $(tarball_pfx).tar
        ls -l $(tarball_pfx).tar.bz2
 
-ChangeLog:
-       para_util changelog > $@
 web/%.in.html: %
-       grutatxt -nb < $< > $@
+       grutatxt -nb  < $< > $@
 tags:
        rm -rf web/sync/HTML && gtags && htags -nF && mv HTML web/sync
-doc:
-       para_util doc
 web/header2.html: web/header.html
        sed -e 's|href="|href="\.\.\/\.\./|g' \
                -e 's|SRC="|SRC="\.\.\/\.\./|g' $< > $@
 doxygen: web/header2.html
        mkdir -p web/sync/doxygen
        doxygen
-web/sync/doc: doc
-       cp -a $< $@
-web/sync/doxygen:
+web/sync/man: html_man
        mkdir -p $@
+       cp -a $(man_pages_html) $@
 web/sync/%.html: web/%.in.html web/header.html web/footer.html web/sync
        cat web/header.html $< web/footer.html > $@
 web/sync/%.png: pics/web/%.png web/sync
        cp $< $@
 web/sync/%.ico: pics/web/%.ico web/sync
        cp $< $@
-web/sync/demo-script: scripts/demo-script web/sync
-       cp $< $@
 web/sync/para.css: web/para.css web/sync
        cp $< $@
-web/sync/versions/paraslash-git.tar.bz2: paraslash-git.tar.bz2 web/sync
+web/sync/versions/@PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2: @PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2 web/sync
        cp -a versions web/sync && cp $< $@
 web/sync/overview.pdf: skencil/overview.pdf web/sync
        cp $< $@