# $Id: GNUmakefile.in,v 1.14 2003/05/22 22:30:20 archie Exp $ # # Variables. Edit to suit. # srcdir = . top_srcdir = . prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin mandir = ${prefix}/man etcdir = ${prefix}/etc cc = cc install = /usr/bin/install binown = root bingroup = wheel manown = root mangroup = wheel shareown = root sharegroup = wheel # # Below here should not need to be edited # PROG= @PROG@ VERSION= @VERSION@ SRCS= @SRCS@ CFLAGS= @CFLAGS@ -include $(srcdir)/linuxhacks.h -DOPENSSL_NO_KRB5 MAN= @MAN@ SFILES= @SFILES@ prog= $(PROG) objs= $(SRCS:.c=.o) cman= $(foreach m,$(MAN),$(m).gz) files= $(SFILES) all: $(prog) $(cman) %.gz: % gzip < $+ > $@ %.o: %.c $(cc) -c -o $@ $(CFLAGS) -I$(srcdir) $+ lws.1: lws.1.in sed 's,@PREFIX@,${prefix},g' < $+ > $@ $(prog): $(objs) $(cc) -o $@ $+ -lpdel -lexpat -lssl -lcrypto -lcrypt -lpthread clean: rm -rf $(objs) $(prog) $(cman) \ lws-$(VERSION) lws-$(VERSION).tar.gz lws.1 install: install-prog install-manpages install-files uninstall: uninstall-prog uninstall-manpages uninstall-files install-prog: $(prog) $(install) -c -o $(binown) -g $(bingroup) -m 755 \ $(prog) $(DESTDIR)$(bindir)/$(prog) uninstall-prog: rm -f $(DESTDIR)$(bindir)/$(prog) install-manpages: $(cman) @for p in $(MAN); do \ section=`echo $$p | sed 's/^[^.]*.//g'`; \ f=`basename $$p`; \ if [ ! -d $(DESTDIR)$(mandir)/man$$section ]; then \ echo $(install) -d -o $(manown) -g $(mangroup) -m 755 \ $(DESTDIR)$(mandir)/man$$section; \ $(install) -d -o $(manown) -g $(mangroup) -m 755 \ $(DESTDIR)$(mandir)/man$$section; \ fi; \ echo $(install) -c -o $(manown) -g $(mangroup) -m 444 \ $$p.gz $(DESTDIR)$(mandir)/man$$section/$$f.gz; \ $(install) -c -o $(manown) -g $(mangroup) -m 444 \ $$p.gz $(DESTDIR)$(mandir)/man$$section/$$f.gz; \ done uninstall-manpages: @for p in $(MAN); do \ section=`echo $$p | sed 's/^[^.]*.//g'`; \ f=`basename $$p`; \ echo rm -f $(DESTDIR)$(mandir)/man$$section/$$f.gz; \ rm -f $(DESTDIR)$(mandir)/man$$section/$$f.gz; \ done install-files: $(files) @if [ ! -d $(DESTDIR)$(etcdir)/lws ]; then \ echo $(install) -d -o $(shareown) -g $(sharegroup) -m 755 \ $(DESTDIR)$(etcdir)/lws; \ $(install) -d -o $(shareown) -g $(sharegroup) -m 755 \ $(DESTDIR)$(etcdir)/lws; \ fi cp -R $+ $(DESTDIR)$(etcdir)/lws chown -R $(shareown):$(sharegroup) $(DESTDIR)$(etcdir)/lws find $(DESTDIR)$(etcdir)/lws -type d | xargs chmod 0755 find $(DESTDIR)$(etcdir)/lws -type f | xargs chmod 0644 ( cd $(DESTDIR)$(etcdir)/lws/ca && sh check_cert \ ../bogus-ssl.key ../bogus-ssl.crt `hostname` ) chmod 0600 $(DESTDIR)$(etcdir)/lws/bogus-ssl.key chmod 0600 $(DESTDIR)$(etcdir)/lws/ca/ca.key uninstall-files: @for p in $(files); do \ echo rm -rf $(DESTDIR)$(etcdir)/lws/$$p; \ rm -rf $(DESTDIR)$(etcdir)/lws/$$p; \ done