chiark / gitweb /
Bugfix.
[userv.git] / Makefile.in
index d880a3be4c7977ef27414b5f1a87be8a00e0ed7a..315583b60f8cde0c462a1dfbd6b053a0867f149d 100644 (file)
@@ -27,8 +27,39 @@ M4FLAGS=
 LEX=flex
 CWD=$(shell pwd)
 
+INSTALL=@INSTALL@
+INSTALL_PROGRAM=@INSTALL_PROGRAM@
+INSTALL_DATA=@INSTALL_DATA@
+prefix=@prefix@
+exec_prefix=$(prefix)
+bindir=$(exec_prefix)/bin
+sbindir=$(exec_prefix)/sbin
+etcdir=/etc
+etcsubdir=$(etcdir)/userv
+
+SOURCES=       Makefile.in configure.in acconfig.h                     \
+               client.c common.h                                       \
+               daemon.c daemon.h ddebug.c parser.c lib.c lib.h         \
+               language.i4 lexer.l.m4 tokens.h.m4
+ALSOSHIP=      system.default system.override \
+               spec.sgml overview.fig overview.ps \
+               COPYING buildship install-sh .cvsignore
+GENSHIP=       lexer.l lexer.c tokens.h pcsum.h configure config.h.in \
+               spec.html spec.ps overview.ps
+
+SHIPTARGETS=   $(SOURCES) $(ALSOSHIP) $(GENSHIP)
+
 all:           daemon client
 
+install:       all
+               $(INSTALL_PROGRAM) -s -o root -g root -m 755 daemon $(sbindir)/uservd
+               $(INSTALL_PROGRAM) -s -o root -g root -m 4755 client $(bindir)/userv
+               $(INSTALL) -d -o root -g root -m 2755 $(etcsubdir)
+               if ! test -f $(etcsubdir)/system.default; then \
+                       $(INSTALL_DATA) -o root -g root system.default $(etcsubdir); fi
+               if ! test -f $(etcsubdir)/system.override; then \
+                       $(INSTALL_DATA) -o root -g root system.override $(etcsubdir); fi
+
 daemon:                daemon.o parserlexer.o ddebug.o lib.o
 
 lexer.l:       language.i4
@@ -45,8 +76,8 @@ parserlexer.o:        lexer.c parser.c config.h common.h pcsum.h daemon.h lib.h tokens.
 # lexer.c #include's parser.c at the end.  Blame flex.
                $(CC) -c $(CPPFLAGS) $(CFLAGS) lexer.c -o $@
 
-pcsum.h:       common.h Makefile
-               cat common.h Makefile | md5sum | perl -pe 's/../0x$$&,/g; s/,$$//;' \
+pcsum.h:       common.h
+               md5sum common.h | perl -pe 's/../0x$$&,/g; s/,$$//;' \
                        >pcsum.h.new && mv pcsum.h.new pcsum.h
 
 tokens.h:      language.i4
@@ -68,6 +99,28 @@ distclean:   clean
 realclean:     distclean
                rm -f configure config.h.in
 
+shipprep:      $(SHIPTARGETS)
+
+ship:          $(SHIPTARGETS)
+               rm -rf shipcheck
+               mkdir -p shipcheck/userv-$(VERSION)
+               cp -a $^ shipcheck/userv-$(VERSION)
+               cd shipcheck && \
+                GZIP=-9v tar zvvcf userv-$(VERSION).tar.gz userv-$(VERSION)
+               rm -rf shipcheck/userv-$(VERSION)
+
+linecount:     $(SOURCES)
+               wc -l $^
+
+%.html:                %.sgml
+               rm -rf $@; debiandoc2html $<
+
+%.ps:          %.sgml
+               debiandoc2ps -1 -k -O $< >$@.new && mv $@.new $@
+
+%.ps:          %.fig
+               fig2dev -L ps -c -l dummy -P -z A4 $< >$@.new && mv $@.new $@
+
 %.l:           %.l.m4
                $(M4) $(M4FLAGS) -- $< >$@.new && mv $@.new $@